You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These features are the ones I desired for a long time. Today I finally sit down to implement a prototype for them.
The code still needs a bit clean up, but it's working locally. The development branch is https://github.com/utensil/vscode-forester/tree/dev . There is a long holiday coming, so I might not be able to polish it for a PR very soon, but let's log the issue here.
Some screenshots for a preview:
Hover
Implemented as a HoverProvider.
Go to definition
Implemented as a DefinitionProvider.
There is a caveat that although I got the right range for matching, but when cmd/ctrl+hover, it shows an underline only for the current word range matching /\w+/ not including digits and - etc. that often appear in tree ids. The screenshot shows such issue.
Search by title
Implemented as a WorkspaceSymbolProvider.
One could bind cmd/ctrl+K to it so that it works the same as on forester web page.
One caveat is that it's not fuzzy search yet.
user-defined patterns for triggering completion
I've defined a lot of macros such as for references and definitions, they would need the same completion as the official macros. The current code hard-coded some of my patterns in it, but it could be some user regex configuration, ideally, one can specify which taxon is the pattern for.
There is a bug I'm still trying to figure out why: \citet{fig. 1}{ can not match (but the same one matches in dev console!)
The text was updated successfully, but these errors were encountered:
Nice! I didn't do this because there's no way to reuse the range computed with the textmate grammar in hover range selection. We really want to use that because it takes care of escapes and comments etc. So \\ref{} wouldn't trigger anything. My plan was to use a library like this to re-compute the textmate ranges because vscode doesn't want to provide this in the API. Or we could just use treesitter and rewrite the entire thing.
These features are the ones I desired for a long time. Today I finally sit down to implement a prototype for them.
The code still needs a bit clean up, but it's working locally. The development branch is https://github.com/utensil/vscode-forester/tree/dev . There is a long holiday coming, so I might not be able to polish it for a PR very soon, but let's log the issue here.
Some screenshots for a preview:
Hover
Implemented as a
HoverProvider
.Go to definition
Implemented as a
DefinitionProvider
.There is a caveat that although I got the right range for matching, but when cmd/ctrl+hover, it shows an underline only for the current word range matching
/\w+/
not including digits and-
etc. that often appear in tree ids. The screenshot shows such issue.Search by title
Implemented as a
WorkspaceSymbolProvider
.One could bind cmd/ctrl+K to it so that it works the same as on forester web page.
One caveat is that it's not fuzzy search yet.
user-defined patterns for triggering completion
I've defined a lot of macros such as for references and definitions, they would need the same completion as the official macros. The current code hard-coded some of my patterns in it, but it could be some user regex configuration, ideally, one can specify which taxon is the pattern for.
There is a bug I'm still trying to figure out why:
\citet{fig. 1}{
can not match (but the same one matches in dev console!)The text was updated successfully, but these errors were encountered: