Closed scripthunter7 closed 8 months ago
@ameshkov The highlighter can tokenize the main syntactic elements. If we introduce the linter, I think we can remove most of the reserved/burned in variable names (logical expression variables, modifier names, etc) from the highlighter. I think it is enough for the highlighter to handle just the syntax itself, the concrete content is probably not necessary at this level. Only in specific cases should we deal with content, e.g. if
should be followed by a logical expression, or safari_cb_affinity
should be handled properly, but variable names/content can be generic.
That way Linguist will not mark as invalid any modifiers or variables introduced in the meantime, and the linter will detect when unsupported names are used by the user (in CLI / CI workflow / VSCode).
@MasterKia Now I see that the scriptlet in the highlighter is universally supported, there is no need to do anything there, the scriptlet you mentioned appears fine in the highlighter. However, the logical expression variable is marked as invalid, which is a problem.
New syntax ("call-nothrow" and "ext_devbuild"):
https://github.com/gorhill/uBlock/commit/e93117cbb607472a830e1c0653dfbddde4c965fc
https://github.com/gorhill/uBlock/commit/464b54bbc6432fa07c85820b37f72b77f0855638 Should I open another issue?
Originally posted by @MasterKia in https://github.com/ameshkov/VscodeAdblockSyntax/issues/58#issuecomment-1483315289