language-javascript-semantic icon indicating copy to clipboard operation
language-javascript-semantic copied to clipboard

Breaks jshint and refactor packages

Open pajtai opened this issue 11 years ago • 5 comments
trafficstars

I really like this package, but enabling it breaks jshint

To repro first install:

Make sure they work. Now enable this package and note that jshint no longer highlights and refactor no longer is able to select variables or refactor.

pajtai avatar Sep 05 '14 04:09 pajtai

This happens to me to. +1

Duder-onomy avatar Sep 08 '14 17:09 Duder-onomy

It's because this creates a whole new grammar for semantic highlighting, which should be wholly unnecessary. I don't know enough about how this package works, or I would file an Atom bug myself. @p-e-w, could you file an informed bug on atom/highlights for this? Specifically on hooks for semantic highlighters?

dead-claudia avatar Dec 01 '14 06:12 dead-claudia

Correction: file it on atom/atom.

dead-claudia avatar Dec 01 '14 06:12 dead-claudia

@impinball: Semantic highlighting does require full text parsing and, as such, a grammar. There is just no shortcut here. My guess is that the reason jshint and refactor-js fail is actually that this package uses the grammar name js-semantic rather than simply js like the default JavaScript grammar that ships with Atom.

p-e-w avatar Dec 07 '14 11:12 p-e-w

@p-e-w I meant that it currently requires a full grammar, but the fact it does is probably a design oversight with Atom.

You are very likely correct in that those packages break because this labels itself as an alternate grammar.

I wonder if it would be possible to overwrite the native js grammar with a third party plugin. If so, that would be awesome. If not, then getting such a feature added to Atom might be the way to fix this. (Semantic highlighting could break most themes because they aren't semantic highlighting schemes, something to take into account.) Another way might be to allow aliases of grammars that supercede grammar selection (i.e. is checked for first), although this probably complicates an already notably slow editor.

So far, my initial toying around suggests it is impossible to overwrite native grammars, but I don't know a lot about Atom plugin development.

dead-claudia avatar Dec 08 '14 01:12 dead-claudia