georgewfraser / vscode-tree-sitter

Accurate syntax coloring for VSCode using tree-sitter
MIT License
175 stars 25 forks source link

Why exactly is it deprecated? #44

Open enbugger opened 2 years ago

enbugger commented 2 years ago

Hi, I'm new in VSCode extension development. I can't get how the new VSCode feature replaced this addon.

With the improving support for custom syntax coloring through language server, this extension is no longer needed

As I understand the code highlighting is not in the scope of LSP specification. The tree-sitter does a good job on it. Is there some extension in LSP - VCCode communication that allows the server to submit coloring properties?

sogaiu commented 2 years ago

May be what is being referred to is this sort of thing: https://github.com/microsoft/vscode/issues/86415

FWIW, there is another effort for doing syntax highlighting via tree-sitter for VSCode here: https://github.com/EvgeniyPeshkov/syntax-highlighter

zm-cttae commented 1 year ago

~Late but~ ~EvgeniyPeshkov/syntax-highlighter~ ~has seen recent activity and is now being worked on again.~

Enivex commented 1 year ago

Late but EvgeniyPeshkov/syntax-highlighter has seen recent activity and is now being worked on again.

The last commit was in 2021?

ratijas commented 9 months ago

I'd imagine writing whole a language server is an order of magnitude more difficult than simply adding a tree sitter grammar file. So I also don't understand the deprecation. Those are just two different things.

zm-cttae commented 9 months ago

Whoops. I was thinking of the discussion in jeff-hykin/experimental-tree-sitter.
From what I gather, fallenwood/syntax-highlighter has the tree-sitter upgrade necessary to fix the fault.

ratijas commented 9 months ago

Yes, I did upgrade {Syntax Highlighter} locally. Unfortunately, I had to remove Ruby and D languages. Over the weekends I managed to make it run in VS Code again, added qmljs syntax/parser, and it even somehow worked. However, speaking from my brief experience, it made things worse for Python sources. Also that very custom format of grammars json is quite limiting compared to native tree-sitter query language, and reparsing the whole document on every change without accounting for edit deltas doesn't sound very efficient.

I haven't got around to experiment with this repo yet, but from what I gather, colors.ts manually walks up and down the tree in a less declarative way than {Syntax Highlighter} does.

Not sure what would be the best path from here…