atom-ide-ui not triggering for embedded scopes
Description
atom-ide-ui is only considering the file's grammar scope, not the scopes at the cursor position(s).
Expected Behavior
atom-ide-ui should respect a Linter provider's grammarScopes property. The contents of this can change at any time (but the reference should stay the same), and this should be handled at the cursor level. Meaning if the user has any cursor within a scope denoted in grammarScopes then the related Linter providers are triggered.
Actual Behavior
atom-ide-ui fails to trigger providers which don't list the file's "main" grammar in their scopes. For example linter-eslint allows linting of the JavaScript within HTML files if you add source.js.embedded.html to the list of allowed scopes (either manually or with the "Lint HTML Files" option), and then put the cursor within a section of JavaScript code and request a lint() (after configuring ESLint itself to support this of course). This works just fine with linter, but with atom-ide-ui the lint() method of linter-eslint is never called in this setup.
If you add text.html.basic to linter-eslint's scopes manually, then atom-ide-ui will request a lint() on the file, but that is incorrect since linter-eslint has no idea how to lint HTML, it only understands embedded JavaScript.
Versions
- Atom: v1.24.0-beta3
- Client OS: Windows 10 x64
- atom-ide-ui: v0.7.1
Additional Details
This was originally reported in https://github.com/AtomLinter/linter-eslint/issues/1071 and sounds like it might be the issue behind #136.
Installed packages
Community Packages (80) C:\Users\abneyl\.atom\packages
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] (disabled)
├── [email protected]
├── [email protected]
├── [email protected] (disabled)
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] (disabled)
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] (disabled)
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] (disabled)
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]
Ah interesting, I didn't know grammarScopes were interpreted this way by linter... that makes things a bit more difficult, as we've always assumed that it referred to the grammar on the TextEditor.
I guess it's not explicit in the type documentation, but it's how we handled things like the embedded scopes that triggered this discovery. I've got a huge backlog of things for the AtomLinter org or I'd look into how to fix it!
Hi, now that tree-sitter is rolling out to more and more people, this is causing users of linter-eslint (and maybe other packages) serious confusion. Any chance it can get some eyes? Or if not, maybe some suggestions on how to go about fixing this, so the community could step up?