ikatyang / tree-sitter-markdown

Markdown grammar for tree-sitter
https://ikatyang.github.io/tree-sitter-markdown
MIT License
183 stars 29 forks source link

Where are injections / aliases kept? #49

Open NullVoxPopuli opened 2 years ago

NullVoxPopuli commented 2 years ago

I noticed that glimmer is highlighted in markdown codefences, but the more limited subset of a language, hbs, is not: image

where would I add an alias for hbs to use the glimmer highlighting?

tubbo commented 2 years ago

I don't see this happen at all. Are you sure you're not running another plugin like inkarkat/vim-SyntaxRange that does this for you?

When I have vim-markdown disabled, so it falls back to tree-sitter, this is what I see:

Screen Shot 2022-09-08 at 9 57 49 AM

With the aforementioned plugins enabled, I get:

Screen Shot 2022-09-08 at 9 58 15 AM

The only reason I don't drop vim-markdown entirely is this project's lack of fenced code block highlighting. :(

NullVoxPopuli commented 2 years ago

your languages in your screenshots, bash and ruby exist as standalone languages -- as does happen in my screenshot with glimmer -- hbs isn't a language, but a file extension (for a language that has a subset of features compared to glimmer), and I'd like to alias glimmer to hbs so that I don't need to create an hbs grammar

NullVoxPopuli commented 2 years ago

another example:

```js
export const x = 'no highlight';
```

```javascript
export const x = 'this is highlighted'
```