asciidoctor / asciidoctor-vscode

AsciiDoc support for Visual Studio Code using Asciidoctor
Other
328 stars 97 forks source link

link:<url>[Link text] not highlighted properly in editor #833

Closed Oobiewan closed 8 months ago

Oobiewan commented 8 months ago

I am editing documents with links in them that use the syntax: link:<url>[linktext] As "link:" is not highlighted, it reads as if it was part of the text, which is quite annoying. I expect that "link:" is highlighted when it's part of the linking syntax, e.g., with the same color as [ ] or { }.

Oobiewan commented 8 months ago

I just switched to the "Dark Modern" theme (from the default VS Code dark), and "link:" is now highlighted as expected. I'm not sure if this means that the issue can be closed.

ggrossetie commented 8 months ago

My guess is that the syntax highlighter does its job correctly but the built-in theme has no color (or a very light color) associated with the "token".

Here's the rule we are using: https://github.com/asciidoctor/asciidoctor-vscode/blob/e190123fa2cfcf5f168fc9bb0ab406caf82fb2b1/syntaxes/Asciidoctor.json#L965-L983

link is identified as entity.name.function.asciidoc and indeed this token is only defined in "dark_plus" included in "dark_modern":

https://github.com/microsoft/vscode/blob/58041888f48dc35ab6f4885765b7a45d1d67fe8e/extensions/theme-defaults/themes/dark_plus.json#L6-L18

You might want to open a new feature request at https://github.com/microsoft/vscode/issues.