Find out where a certain language is defined


#1

Hi,

I’m editing a markdown file and I noticed that there’s a little problem with syntax highlighting; so I wanted to find out if the definition comes from a package (and which one) or is in core, but I have no idea how to do that.

Given a certain language, how do I find where Atom is getting its definition from?


#2

It’s almost always from the language-[language-name] package. So Ruby is defined in the language-ruby package, C and C++ are defined in the language-c package, etc.


#3

So I thought, but it is displayed as ‘GitHub Markdown’, and the only installed package that matches /markdown/ or /md/ is markdown-preview, which doesn’t seem to include a language specification.


#4

language-gfm is the package you’re looking for. It’s one of the few confusing exceptions to the rule.


#5

OK, sorry, there is a language-markdown package, but it doesn’t show up in neither Settings / Packages / Installed packages nor in the output of apm ls…


#6

language-gfm is the package you’re looking for.


#7

Thank you, that’s it—and there’s already an open issue for my problem.

How could have I figured that by myself?


#8

Go to the Settings View. On the Packages tab, search for "language’, skim down the list until you see “Markdown” in the description. Perhaps it isn’t the most automated of ways, but it only took me a few seconds to do manually.


#9

Could you post a link to the issue?


#10

@burodepeper: https://github.com/atom/language-gfm/issues/146

A word beginning with _ will trigger ‘italic’ even when inside a code block (code indented with 4 spaces).


#11

Thank you.


#12

Ah yeah, emphasis is “a bitch”; see https://github.com/atom/language-gfm/issues/44 for instance. Could you try language-markdown to see if that gives you better results?

FYI, language-markdown disables language-gfm by default, so you’ll have to re-enable it manually if you don’t like language-markdown and want to switch back.


#13

Seems to work fine, thank you!