Open clankill3r opened 3 years ago
That seems like a great set of ideas! And I think it's more of a specialised usecase. Like a superpowered grep. I could imagine adding these features to the find command of a text editor
Lets go through all proposals step by step to see what should be done in the 1. lsp (global semantic information) vs what can be done in 2. treesitter (local scoped information) or what has 3. simpler workarounds:
I do assume all stuff should also work with comptime for a given input configuration (later to be extended). I do also assume that the lsp has a query format for exposing the data (which as of today it has not).
What remains are
Personally I think there should also be a program that indicates in the unsaved buffer if and if not incremental compilation will break on changes. This program would likely need to query global semantic information from the lsp via editor, but I am unsure how complex this would be.
I noticed when using zls in VSCode that there was suddenly syntax highlighting. Not sure if zls was responsible or the vscode extension for zls, but I'm hoping it was zls itself cause then the issue I raise up spans a wider dimension.
I readed this article and I founded it very interesting, and before continueing to read my post, I ask you to read this article:
https://buttondown.email/hillelwayne/archive/syntax-highlighting-is-a-waste-of-an-information/
I was thinking, it might be interesting to see what the ideas of the article could mean for zig. I would love to hear others people thoughts on this, and if zls could indeed provide some of the functionality described.