-
-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Function Parameter/Field Name Virtual Text Inference #29
Comments
Hmm. What would Rust suggest for
|
Is this something that can be handled entirely by the language server? Does the protocol have a standard way for servers to tell editors to show that kind of overlay? |
@jackfirth I would think that its something entirely handled by the language server yes. As for a standard way: According to https://rust-analyzer.github.io/manual.html#inlay-hints , the source file says: microsoft/vscode#16221 (comment) I want to look into implementing this at some point but I don't know much about language server among other things.... |
Oh wow, that's really cool. This definitely seems worth looking into then. |
https://code.visualstudio.com/updates/v1_64#_inlay-hint-api the feature is stable now in vscode! |
@jestarray the method part is merged, the rest is how to collect struct fields information and put them into “inlayHint” method. |
@dannypsnl awesome work! Read your PR, so the main blocker is official support from racket |
Steps
ChallengeThough the above will work, the biggest problem is performance. If you check The core problem of the architecture is, it should prepare a collector for each file in the project open(as IDE) to provide ready information for usage like inlay hints, but we have A redesigned picture would be
However, threading will not help, other solutions also have their own problem
Based on the second solution, I'm thinking of a draft idea, hope these will help |
rust-analyzer provides a very neat feature in that it will print out virtual text of struct field names and function param names when you call said function.
This feature would be a huge productivity gain for racket as structs will be much easier to work with, along with functions. Currently I create a lot of keyword functions for structs that are very large because I don't want to keep guessing what they are by position. (I have looked into the rebellion packages and etc but ehh, I prefer to minimize dependencies)
The text was updated successfully, but these errors were encountered: