Skip to content
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

JS code hint exclusions ignored sometimes #12592

Open
core-ai-bot opened this issue Aug 31, 2021 · 5 comments
Open

JS code hint exclusions ignored sometimes #12592

core-ai-bot opened this issue Aug 31, 2021 · 5 comments

Comments

@core-ai-bot
Copy link
Member

Issue by zaggino
Friday Mar 28, 2014 at 03:11 GMT
Originally opened as adobe/brackets#7342


Doing this in a clone of brackets-git
Create a .jscodehints file like this:

{ 
    "excluded-files": [
        "ExtensionInfo.js"
    ],
    "excluded-directories" : [
        "src"
    ]
}

Now close all Brackets instances, start again, open main.js and start typing:
image

I'd expect to see no hints from the file itself...

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Friday Mar 28, 2014 at 23:40 GMT


@zaggino I'm guessing that it will always look at the text in the current editor, and thus the prefs only prevent it from going out and loading other files that aren't actually open. But haven't looked at the code to verify...

@core-ai-bot
Copy link
Member Author

Comment by zaggino
Saturday Mar 29, 2014 at 08:08 GMT


More info@peterflynn

  1. main.js is the only opened file in the working tree
  2. only method get is used in the main.js so I have no idea, how it could get getSync and hasLatestVersion without reading the excluded ExtensionInfo.js - I would understand if I saw get here and nothing else because this one could be parsed from current file.

@core-ai-bot
Copy link
Member Author

Comment by MarcelGerber
Tuesday Apr 01, 2014 at 17:49 GMT


I can repro this. It's not even possible that the code hints parsed src/ErrorHandler.js, which is the only one calling ExtensionInfo.getSync(). After removing these lines (and restarting), the code hints were still there. So they must parse ExtensionInfo.js.

@core-ai-bot
Copy link
Member Author

Comment by dangoor
Monday Apr 07, 2014 at 18:28 GMT


What I believe is happening here is that there are two ways in which a file is sent to Tern for generating hints:

  1. The code hints code gathers up nearby files for generating hints
  2. Tern requests a file that it sees as being a dependency because of require calls

The exclusion code is likely keeping the first code path from resulting in hints, but not preventing the second. That behavior doesn't seem right to me.

@core-ai-bot
Copy link
Member Author

Comment by dangoor
Monday Apr 07, 2014 at 18:28 GMT


Reviewed medium priority to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant