Tree-sitter grammar not appearing in list

Hi All,

I’ve started working on a tree-sitter grammar for Atom. I’ve completed the tree-sitter grammar package, but am having trouble getting it working in atom. It’s not appearing in the list of grammars.

I followed the usual steps in the flight manual for creating tree-sitter grammars, and the start of the grammar looks like this:

name: 'Semmle QL'
scopeName: 'source.ql'
type: 'tree-sitter'
parser: 'tree-sitter-ql'

fileTypes: ['ql', 'qll']

firstLineRegex: [
  # import
  '^import\s[a-z]+\\r?\\n'
]

comments:
  start: '// '

scopes:
 //...

Here’s my atom version:

$ atom -v
Atom    : 1.38.2
Electron: 4.2.5
Chrome  : 69.0.3497.128
Node    : 10.11.0

I also had to deal with the module version mismatch for node, which I fixed by running apm rebuild in the package directory. There are now no errors or anything appearing on startup.

When I try to add a classic textmate grammar in the same grammar directory, it seems to work fine and is picked up, it’s only the tree-sitter one that isn’t.

Any help would be greatly appreciated!

Thanks,
Sam.

cc @Aerijo

Upon further investigation, it seems that my atom installation may not be loading any tree-sitter grammars at all? I installed language-tree-test and that’s also not showing up in the list, and linter-tree-sitter seems to not be doing anything interesting for any standard atom languages that use tree-sitter…

This has been fixed, it is currently available in nightly https://atom.io/nightly

The grammars are loaded, it’s just the selector that doesn’t show them.

1 Like

Thank you, trying it out on the nightly worked!