Comments (5)
Ping @gbprod, maybe you could bring some context to this issue. Did you look into indenting already? Did you have some issues? Thanks!
from nvim-treesitter.
Having multiple parsers for the same file is not supported. If you have multiple languages, you need to either define a "base language" with injections, or have an "extended" language that inherits from the base language (without injections), as in cpp
from c
or terraform
from hcl
(or vice versa).
from nvim-treesitter.
Would need to fix indent to accept the smallest range, instead of the smallest root tree
I don't know how to do that though :). PR Welcome
from nvim-treesitter.
Oh I see, thanks!
I tried to extends tree-sitter-html but I had too much trouble with externals (scanner.c), and it seems I couldn't add new rules. I felt like I was wasting time.
If it's the correct way to go, I'll give it another shot then.
@clason can I define injections for indents? The upstream plugin is already configured for highlights for example.
Thanks for your help!
EDIT: I didn't understand injections, injections.scm
is responsible for incorrect indenting:
((content) @injection.content
(#set! injection.language "html")
(#set! injection.combined))
Without this, twig indenting works! How can I apply my indent rules when twig is inside a html block?
from nvim-treesitter.
Ping @gbprod, maybe you could bring some context to this issue. Did you look into indenting already? Did you have some issues? Thanks!
Hi!
I've never tried to make indentation works for twig (mostly because I don't know how to make it works with combined injection).
But it would be awesome to improve this :)
I will make some tests ;)
from nvim-treesitter.
Related Issues (20)
- [Bug]: Vue <Tag.Field><Tag.Field/> Highlighting anomaly. HOT 9
- Highlighting not enabled by default in lazy.nvim HOT 4
- E475 highlighting in lua lang HOT 1
- Highlighting not working when I open the file a second time HOT 6
- [R] Error with @injection content HOT 5
- setting language injection to yaml inside yaml causes stack overflow HOT 2
- Error: No handler for is-not? HOT 11
- [Feature] support goctl nvim-treesitter code highlights. HOT 1
- "Error in decoration provider treesitter/highlighter.win" inescapable error opening LaTeX files on Ubuntu HOT 3
- [hurl] Problem with GraphQL injections HOT 12
- Php: incorrect indentation after Class declaration
- R: no indentation after `for` and `if` when there is no bracket HOT 8
- Unable to install just parser HOT 4
- Neovim crashes after trying to access the neovim help page on Windows 10 HOT 5
- Any way to track neovim release compatibility and pin nvim-treesitter before it gets ahead of the release?
- [PHP]: Indentation indent the line above where the cursor is going. HOT 17
- get_parser_install_dir: "site dir" should be used when "package dir" is readonly HOT 5
- Invalid node type "macro_type_specifier" HOT 1
- Highlighting is not working for angular HOT 8
- conda installed curl with the wrong certificate file causes nvim-treesitter install parser failed HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nvim-treesitter.