aya-dev icon indicating copy to clipboard operation
aya-dev copied to clipboard

Highlighting lexer

Open ice1000 opened this issue 3 years ago • 4 comments
trafficstars

For every time user edit a file, the LSP unload it. We can do better:

  • We lex the file on save.
  • We provide precise token-based highlight for the file, on save, based on the lex result.
  • We provide navigation on Ctrl+L Ctrl+L (already done).

This is inspired from @agda.

@imkiva wdty

ice1000 avatar Nov 18 '22 11:11 ice1000

I remember agda-vscode maintains an edit-list to correct highlight positions when the user edits the file. But VSCode seems not to fire certain events as user types (instead, it fires a file change event on save).

imkiva avatar Nov 20 '22 10:11 imkiva

Oh I have a solution! Your suggestion is pretty awesome!!!!

imkiva avatar Nov 20 '22 10:11 imkiva

What solution?

ice1000 avatar Dec 07 '22 11:12 ice1000

On save, the server sends the highlight result from SyntaxHighlight to client. The old approach (sending highlight result after C-l C-l) is deprecated.

imkiva avatar Dec 07 '22 12:12 imkiva