nimlsp icon indicating copy to clipboard operation
nimlsp copied to clipboard

[fix] Allow nimlsp to understand pre-existing variables defined by nimble in `.nimble` files

Open heysokam opened this issue 2 years ago • 1 comments

image Simple as the title. Basically, allow nimlsp to understand that some variables are pre-defined by nimble, and they should not be hinted as errors in the code.

heysokam avatar Aug 22 '23 13:08 heysokam

I designed this feature but never got around to implement it. Basically my idea was that you could define a preamble for certain file extensions. When nimlsp opens a file it would have a look at the installed preambles and see that it has a .nimble preamble. Then for each .nimble file it would append the preamble before processing the file. This would require some trickery to get line numbers correct, but apart from that it shouldn't be too hard to implement if someone wants to give it a whirl. Bonus points of course if there is some way a Nimble file can define their own templates so that if a program uses NimScript as a configuration language NimLSP would just automatically discover the template amongst your installed packages and provide support for that format.

PMunch avatar Aug 22 '23 14:08 PMunch