toitware / ide-tools

Tools for working with Toit in different IDEs
MIT License
2 stars 2 forks source link

Improve "word" experience in vscode. #225

Closed floitsch closed 1 year ago

floitsch commented 1 year ago

The model (form language-configuration.json) accepts '-' as long as it is surrounded by '\w'.

However, the editor still uses '-' as word boundary. This combination sounds counter-intuitive, but works okish with highlighting: the model is used to find the initial word, and the editor then finds "whole" words by using the separators. This means that --foo-bar finds other foo-bars (and, more importantly, foo-bar also finds --foo-bar). However, it also means that foo-bar-gee will now also be highlighted for the foo-bar part.

A correct solution will use the LSP, which can provide a good list of the identifiers that are relevant. (Initially maybe just all identifiers that would match).