Skip to content
This repository has been archived by the owner on Nov 11, 2018. It is now read-only.

Does not automatically use semantic highlighting #33

Open
omnidan opened this issue Oct 10, 2015 · 7 comments
Open

Does not automatically use semantic highlighting #33

omnidan opened this issue Oct 10, 2015 · 7 comments

Comments

@omnidan
Copy link

omnidan commented Oct 10, 2015

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 😕

@bruinebeer
Copy link

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

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

I think this will solve your problem :)

@omnidan
Copy link
Author

omnidan commented Nov 22, 2015

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

@monfera
Copy link

monfera commented Dec 5, 2015

@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.

@wiwa
Copy link

wiwa commented Dec 10, 2015

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

@Nargonath
Copy link

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

@Nargonath
Copy link

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.

@sylvesterworks
Copy link

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!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants