-
-
Notifications
You must be signed in to change notification settings - Fork 331
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
Improvements to @see
and @source
#1344
Comments
Just saw the new |
Another feature for this that I could see being very useful is linking to an actual function within a file. ---@see http.get
function get(url) end This would require the text after Clicking on the link in the hover window would then go to the definition of the selected class/function/etc. This is probably the better way to implement it seeing as there is also I want to link to the function I am wrappingUse ---@see class.function
function myWrapper() end I want to link to a website where I got this code fromUse ---@source https://example.com
function fromTheInternet() end So |
|
Now I am really confused as to what I think a better name would just be |
It is used for jumping to another language, for example: ---@source lmathlib.c:220:11
function math.max(...) end
math.max(1, 2) When requesting goto definition for This is a private feature for |
The Problem
In its current state,
@see
is relatively useless. It does not actually show up on hover and is currently only really useful if you actually go to the definition of whatever is being defined. Even thoughhttp
is highlighted in the below image, hovering it does nothing and it has no function. This is okay for referring to a function within the same file but is severely lacking when it comes to libraries.Besides it not really being visible, it is lacking in usability as it is only good for plain text as far as I can tell. I think it would be super useful if it could be used to link to other files in the workspace (relative to the definition file).
Proposal
EDIT: View my comment below for a more complete solution.
Note that the file extension is not included in the path, I think it would be helpful if the
.lua
file extension were assumed as a default soworkspace/path/to/http.lua
could be linked to throughworkspace/path/to/http
. Should there be multiple@see
tags, I think it should display one per line:As a bonus, it would be useful if while typing out the path to another file in the workspace, autocompletions were provided as seen below while using the TypeScript extension. This is a nice quality of life feature as it would make it easier to get the path right but is not necessary.
The text was updated successfully, but these errors were encountered: