Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

JS code hint exclusions ignored sometimes #7342

Open
zaggino opened this issue Mar 28, 2014 · 5 comments
Open

JS code hint exclusions ignored sometimes #7342

zaggino opened this issue Mar 28, 2014 · 5 comments

Comments

@zaggino
Copy link
Contributor

zaggino commented Mar 28, 2014

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...

@peterflynn
Copy link
Member

@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...

@zaggino
Copy link
Contributor Author

zaggino commented Mar 29, 2014

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.

@marcelgerber
Copy link
Contributor

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.

@dangoor dangoor self-assigned this Apr 7, 2014
@dangoor dangoor changed the title [JSCodeHints] Config file doesn't work JS code hint exclusions ignored sometimes Apr 7, 2014
@dangoor
Copy link
Contributor

dangoor commented Apr 7, 2014

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.

@dangoor
Copy link
Contributor

dangoor commented Apr 7, 2014

Reviewed medium priority to me

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

No branches or pull requests

5 participants