Sorry in advance if this all sounds daft and confused -- I absolutely am slightly confused.
As of now I only have JS & a couple unrelated grammars installed (C, Lua, Vim, etc.) per :TSInstallInfo. However, upon opening a JS file, I run into this suspect highlight:
My specific problem is that this is an incredibly naive determination for a TS type. I get that there's limitations as to what you can do with the AST alone, and this is still a perfectly valid way to import types even if there's less ambiguous alternatives such as import type { ... } or import { type ... today. However, in a .js file it goes from being a weak assumption to one that's incorrect -- you cannot import types that way in JS.
Hence my confusion. I'm not sure how that TS-specific highlight is being added when I don't have the TS grammar installed, and I'm not sure why it's being applied to a .js file. :echo &filetype returns javascript so nothing appears to be fishy with the file type detection. I don't understand where this is coming from or why.
Sorry in advance if this all sounds daft and confused -- I absolutely am slightly confused.
As of now I only have JS & a couple unrelated grammars installed (C, Lua, Vim, etc.) per
:TSInstallInfo
. However, upon opening a JS file, I run into this suspect highlight:I see nothing in this grammar that would trigger that (as far as I can tell) but I do see the following from the TS grammar that could be to blame?
https://github.com/tree-sitter/tree-sitter-typescript/blob/73c4447796b251295b498227bad028d88dc1918b/queries/highlights.scm#L6-L7
My specific problem is that this is an incredibly naive determination for a TS type. I get that there's limitations as to what you can do with the AST alone, and this is still a perfectly valid way to import types even if there's less ambiguous alternatives such as
import type { ... }
orimport { type ...
today. However, in a.js
file it goes from being a weak assumption to one that's incorrect -- you cannot import types that way in JS.Hence my confusion. I'm not sure how that TS-specific highlight is being added when I don't have the TS grammar installed, and I'm not sure why it's being applied to a
.js
file.:echo &filetype
returnsjavascript
so nothing appears to be fishy with the file type detection. I don't understand where this is coming from or why.Thanks for anyone's time, I appreciate it.