-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: ConsoleNinja augments files that are not being executed #195
Comments
Things that could be useful:
|
The other issue here is that it was not obvious what the issue was. If there's a way to increase the signal that console ninja touched a file, that would be amazing. Like an annotation in the File Explorer, or some sort of verbose output, maybe? |
Thanks for getting back to me. Your comments make sense.
Thanks - wasn't sure of your use case and wanted to confirm.
We had discussed something similar. Thinking about the future of what may be required for a project, we may have other project-level configuration that will need to be configured. Instead of an
Good suggestion. Not entirely sure how we limit the noise, perhaps only emitting once per file. Having said that, I'm not sure how much it would help in this case (unless you've had the problem before and know to expect it). We'll have a think about what we want to do to address your issue and we will get back to you. |
LMK if I can help at all :) |
In this specific case, seeing an indication that the I first saw it when I migrated the project to TypeScript and so I thought it was related to that for the longest time. |
@ArtemGovorov Oh! That's a great suggestion. It's usually only open files I care about - so that would work well and I can set that as a workspace setting so others working with VSCode and ConsoleNinja will just get the right behavior. Although, what happens if two VSCode projects are open; one only looking at opened files and one looking at all files? I noticed that currently, ConsoleNinja affects even things running from outside VSCode; so which instance of VSCode "wins" in that scenario? The most recent one opened? |
This shouldn't cause a problem. Unless I misunderstand what you're asking, VS Code won't allow you to open the same project more than once, and Console Ninja starts for your project in each VS Code instance. If you're seeing different behavior or having problems with multiple Console Ninja's interfering with each other, please let us know. |
Ah, I get you. So it applies to the specific workspace. So when I ran an external console and saw an issue, it was because ConsoleNinja is monitoring that specific workspace, not all files anywhere. Got it. Thanks for clarifying that; makes sense. :) |
What happened?
In my project, checksync, I have a folder of examples (named
__examples__
) that are not executed code but are instead used by integration tests. Unfortunately, Console Ninja is still modifying them on load and causing the tests to fail when VSCode is running.Version
v0.0.215
Steps to reproduce (or sample repo)
somewhatabstract/checksync
repoyarn
(you need yarn v1 installed - usingnpx yarn@1
should work if it isn't installed)yarn test ./src/__tests__/integration.test.ts
You can verify that the
console.log
calls are getting modified in the example code by adding aconsole.log
in the./src/checksum.ts
file to doconsole.log(saltedContent);
and you will see that when Console Ninja is enabled, it the content includes anoo_oo
type call on eachconsole.log
in the example code.It appears that Console Ninja hooks all file reads and modifies them, even if they are not executed code. At the very least, there should be a way to tell it not to process certain files or to only include certain files (like include src only); ideally it should be able to work this out from the existing configurations (like babel config?), but I recognize that's hard.
Log output
The text was updated successfully, but these errors were encountered: