question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use the analysis server for semantic highlighting

See original GitHub issue

On the insiders channel, VS Code now provides apis for semantic token highlighting. This would allow Dart Code to enhance the static grammar-based highlighter with highlighting information from the analyzer.

In particular, the extension could use it to:

  • be more accurate at semantic highlighting (members starting with an uppercase, named get/set, complex string literals, …)
  • highlight non-Dart files via analysis server plugins

To my knowledge, LSP doesn’t support syntax highlighting (yet). So I think this would have to be implemented using the DAS protocol and a contributor for now. I’ve started some work on this and I hope I can open a PR next week.

Current issues

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:15 (14 by maintainers)

github_iconTop GitHub Comments

2reactions
DanTupcommented, Dec 10, 2020

@simolus3 LSP v3.16 is due to be finalised imminently (hurrah!). I have started preparing to land changes in the server:

https://dart-review.googlesource.com/c/sdk/+/175722/

Once LSP 3.16 is final (and the next version of VS Code) I’ll make a new preview build of Dart-Code with the new client that will work with the server changes.

I’ve included a basic plugin test in that CL, though if there are cases you think it doesn’t cover, please let me know (or feel free to contribute changes).

2reactions
DanTupcommented, Oct 14, 2020

@simolus3 still haven’t forgotten this, but it’s still unfinalized in LSP so I’ve been holding off merging or doing any more. There are also a few things I’ve asked about, like supporting multiline/nested tokens that haven’t really been resolved yet.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Semantic Highlight Guide | Visual Studio Code Extension API
Semantic highlighting is an addition to syntax highlighting as described in the Syntax Highlight guide. Visual Studio Code uses TextMate grammars as the ......
Read more >
Neovim 101 — Semantic Highlighting | by alpha2phi - Medium
We briefly went through semantic highlighting using Tree-sitter previously. In this article, let's go through this feature using Tree-sitter and LSP.
Read more >
How does Semantic Highlighting work in VS Code with ...
I wrote a tool that inputs an Antlr4 grammar and a list of XPaths that specify SH classes, and outputs an LSP server...
Read more >
User Manual - rust-analyzer
At its core, rust-analyzer is a library for semantic analysis of Rust code as it changes over time. This manual focuses on a...
Read more >
Analysis Services tools | Microsoft Learn
Tabular and multidimensional model projects are created by using project templates in Visual Studio with Analysis Services projects ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found