Skip to content
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

@see does not display on a new line #2099

Closed
carsakiller opened this issue May 8, 2023 · 2 comments
Closed

@see does not display on a new line #2099

carsakiller opened this issue May 8, 2023 · 2 comments
Labels
bug Something isn't working feat/LuaCats Annotations Related to Lua Language Server Annotations (LuaCats)

Comments

@carsakiller
Copy link
Collaborator

How are you using the lua-language-server?

Visual Studio Code Extension (sumneko.lua)

Which OS are you using?

Windows

What is the issue affecting?

Annotations, Hover, Libraries

Expected Behaviour

It would be much easier to read if @see appeared on a new line:

image

Also, it only says "See:" instead of "@see". I think it makes sense for it to say so to match @param, @return, etc.

Actual Behaviour

The @see annotation appears on the same line as the previous annotation:

image

Reproduction steps

  1. Use the following code:
server = {}

---Does something
function onCustomCommand() end

---Sends a message to all running scripts.
---@param message string message
---@see onCustomCommand
function server.command(message) end
  1. Hover over server.command
  2. Note "See:" displayed on the same line as @param

Additional Notes

No response

Log File

No response

@carsakiller carsakiller added bug Something isn't working feat/LuaCats Annotations Related to Lua Language Server Annotations (LuaCats) labels May 8, 2023
@carsakiller
Copy link
Collaborator Author

carsakiller commented May 10, 2023

It may actually be best to just rethink how we can link to symbols in the workspace.

Typescript handles this using an “inline tag”, but I think we can do one better.

We can instead use normal Markdown links, allowing users to use them any way they like – no worrying about how the language server formats it. It also allows us to fit the link in to our paragraph anywhere we like, rather than just at the bottom. We could look for a character like @ or $ in a markdown URL and replace it with the URI for the actual referenced symbol.

Something like this:

---Is linked to
---@class Object

---Is linked to
local function getID() end

---This function does something really cool. To get the ID, see [getID]($getID).
---
---Example of referencing some core Lua stuff, like [table.insert]($table.insert).
---@param id integer The ID to use for this function
---@return Object obj The [`Object`]($Object) retrieved
---You can even still do the current style:
---See:
---- [Object]($Object)
local function getObject(id) end

If this is something that is possible, I think this is a much better long-term solution. I can close this issue and open a new one for this feature if needed.

@carsakiller
Copy link
Collaborator Author

Closing this in favour of #2175

@carsakiller carsakiller closed this as not planned Won't fix, can't repro, duplicate, stale Jul 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feat/LuaCats Annotations Related to Lua Language Server Annotations (LuaCats)
Projects
None yet
Development

No branches or pull requests

1 participant