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

Improve syntax highlighting using a Language Server Protocol implementation #686

Open
1 of 13 tasks
ggrossetie opened this issue Jan 10, 2023 · 7 comments
Open
1 of 13 tasks

Comments

@ggrossetie
Copy link
Member

ggrossetie commented Jan 10, 2023

We currently rely on a TextMate grammar but it cannot properly parse AsciiDoc.

I think we should migrate to semantic highlighting: code.visualstudio.com/api/language-extensions/semantic-highlight-guide or LSP: code.visualstudio.com/api/language-extensions/language-server-extension-guide

If someone wants to give it a try, please feel free to do so!

Related issues:

@ggrossetie
Copy link
Member Author

It's worth noting that semantic tokens do not support embedded languages:

microsoft/vscode#163292

In other words, source blocks won't be properly highlighted in AsciiDoc.

I don't think we should adopt the semantic tokens feature until embedded languages are supported.

I guess our only solution right now is to use LSP.

@ggrossetie ggrossetie changed the title Improve syntax highlighting using a semantic token provider Improve syntax highlighting using a Language Server Protocol implementation Nov 12, 2023
@ViToni
Copy link
Contributor

ViToni commented Mar 26, 2024

Is this basically the same issue as #625 ?

@ggrossetie
Copy link
Member Author

Initially, I thought it would be possible to implement a syntax highlighter using semantic token provider, that's why I've created a new issue.

Since we need to use LSP, it's indeed a duplicate of #625. I think we should close #625 in favor of this one.

@ViToni
Copy link
Contributor

ViToni commented Mar 26, 2024

Looking into LSP has been on my ToDo list for a long time. This issue might be somethIng to get this action item checked off. Wondering though if it might be better to have a dedicated project for that as a LSP implementation (e.g. asciidoctor-lsp) could be used independently of this extension.

@ggrossetie
Copy link
Member Author

@ViToni If you want to work on it that would be awesome! Yes, we should create a dedicated project! In case you've missed it, the AsciiDoc specification is under way:

The current syntax highlighter is broken and we could do so much more with a proper LSP (suggestion, lint, reformat and so on)

@ViToni
Copy link
Contributor

ViToni commented Mar 26, 2024

@ggrossetie I'd try to get my feets wet. Not sure how far I get, but at least I'd like to give it a try.
I'll join the chat in the next days.

@ViToni
Copy link
Contributor

ViToni commented Apr 3, 2024

Related to: asciidoctor/asciidoctor#3630

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

No branches or pull requests

2 participants