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

Does not automatically use semantic highlighting

Open omnidan opened this issue 9 years ago • 7 comments

My .js files still open with the JavaScript syntax by default. I even tried manually setting .js to js-semantic, but that didn't work because of an atom bug.

Any idea what's going on there? I know it's supposed to default to semantic highlighting and override the default JavaScript syntax, but that's not happening to me for some reason :confused:

omnidan avatar Oct 10 '15 01:10 omnidan

@omnidan I have added this to my config.cson file.

# ..
core:
  customFileTypes:
    "source.js-semantic": [
      "js"
    ]
# ..

I think this will solve your problem :)

bruinebeer avatar Nov 21 '15 21:11 bruinebeer

@bruinebeer thanks a lot! Seems like that worked :grin: I'm still wondering why this plugin doesn't do it by default, though.

omnidan avatar Nov 22 '15 20:11 omnidan

@bruinebeer it worked for me too, and I'm as puzzled as @omnidan :-) It's an awesome package, and Atom packages are often underdocumented (w.r.t. basic things like... er... how to use them) and channel new users to Google search. Also, a lot of packages (or maybe an Atom core limitation) require the geriatric Microsoft methodology (get out / get in) to effect changes. For example, after this config, one needs to close the JS files and reopen them to see the change. Also, there seems to be two different, competing abstractions in Atom for syntax highlighting. For example, any JS you have in an HTML file will continue to use the 'default' highlighting even if 'html' is added to the above config snippet.

monfera avatar Dec 05 '15 12:12 monfera

the customFileTypes fix didn't work for me. Is this supposed to work with normal .js files?

wiwa avatar Dec 10 '15 17:12 wiwa

@WiWa did you manage to make it work? I'm in the same situation.

Nargonath avatar Jan 05 '16 14:01 Nargonath

I didn't see but I had a build error. I just had to rebuild it and now it works with the previous add to config.cson. I'm on Atom 1.3.2 by the way. Thanks guys.

Nargonath avatar Jan 05 '16 17:01 Nargonath

i'm on atom.io 1.4.1 now, and atom seems to think that everything in JS should be one of 5 colors... it's becoming painful - i miss the semantic highlighting.

i've done as others have suggested above and updated my config.cson file to include the customFileTypes setting, which also does nothing to help the situation.

  core:
    customFileTypes:
      "source.js-semantic": [
        "js"
      ]
   ...

are there any more tricks to kick the highlighter into action?

edit: nevermind - i noticed the little red icon in the bottom of the atom window, which prompted a rebuild of the package, which was actually successful. then reloading Atom, and highlighting is back. cheer!

sylvesterworks avatar Jan 26 '16 21:01 sylvesterworks