Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highlighting lexer #691

Open
ice1000 opened this issue Nov 18, 2022 · 4 comments
Open

Highlighting lexer #691

ice1000 opened this issue Nov 18, 2022 · 4 comments
Labels
highlighter Faithful one lsp

Comments

@ice1000
Copy link
Member

ice1000 commented Nov 18, 2022

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 ice1000 added the lsp label Nov 18, 2022
@imkiva
Copy link
Member

imkiva commented Nov 20, 2022

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
Copy link
Member

imkiva commented Nov 20, 2022

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

@ice1000
Copy link
Member Author

ice1000 commented Dec 7, 2022

What solution?

@imkiva
Copy link
Member

imkiva commented Dec 7, 2022

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.

@ice1000 ice1000 added the highlighter Faithful one label Dec 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
highlighter Faithful one lsp
Projects
None yet
Development

No branches or pull requests

2 participants