swarm-game / swarm

Resource gathering + programming game
Other
835 stars 52 forks source link

Semantic Token LSP API for syntax highlighting #324

Open TristanCacqueray opened 2 years ago

TristanCacqueray commented 2 years ago

Is your feature request related to a problem? Please describe. See #323

Describe the solution you'd like The LSP should support SemanticTokensClientCapabilities to provide syntax highlighting. Then the emacs regex and textmate should be removed.

byorgey commented 2 years ago

Some relevant links:

byorgey commented 2 years ago

Relevant in comparison to #323 is that although the LSP semantic token specification/API seems to optionally support incremental updates aka deltas, our parser does not support incremental parsing. There is certainly work in Haskell on incremental parsing, e.g. https://hackage.haskell.org/package/incremental-parser , https://publications.lib.chalmers.se/records/fulltext/local_94979.pdf , and even megaparsec itself seems to have some kind of support for incremental parsing.