Skip to content

feat: Migrate logic to tree sitter parser#32

Draft
Batalex wants to merge 2 commits into
mainfrom
tree-sitter
Draft

feat: Migrate logic to tree sitter parser#32
Batalex wants to merge 2 commits into
mainfrom
tree-sitter

Conversation

@Batalex

@Batalex Batalex commented Jun 26, 2026

Copy link
Copy Markdown
Owner

This PR is a big rework of the internals of craft-ls.

Craft-ls previously used pyyaml primitives to parse broken documents as best as we could. Turns out, having a broken document is not the exception but the norm when we develop a language server.
The biggest issue with the pyyaml approach is that it is a top-to-bottom parsing, meaning that editing the document in the middle discards half of it for the language server until we type enough characters to get a valid yaml file.

Parsing the document using tree sitter gives us a robust way of getting the content of the document by properly wrapping broken yaml syntax in error nodes.

We also have a solid foundation for adding our own linter rules later on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant