Skip to content

add: explain new symbol referencing feature #36

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

Merged
merged 1 commit into from
Jun 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/content/wiki/annotations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ The below methods can be added to the end of a line:
- Two trailing spaces (may be removed by formatting tools)
- Markdown backslash `\` ([not recommended](https://www.markdownguide.org/basic-syntax#line-break-best-practices))

## Referring to symbols

As of [`v3.9.2`](https://github.com/LuaLS/lua-language-server/releases/tag/3.9.2) you can refer to symbols from your workspace in markdown descriptions using markdown links. Hovering the described value will show a hyperlink that, when clicked, will take you to where the symbol is defined.

```lua
---@alias MyCustomType integer

---Calculate a value using [my custom type](lua://MyCustomType)
function calculate(x) end
```

## Tips

- If you type `---` one line above a function, you will receive a suggested snippet that includes [`@param`](#param) and [`@return`](#return) annotations for each parameter and return value found in the function.
Expand Down Expand Up @@ -1194,7 +1205,7 @@ local function getNicknames() end

### @see

Allows you to reference a specific symbol (e.g. `function`, `class`) from the workspace.
Allows you to reference a specific symbol (e.g. `function`, `class`) from the workspace. You can also reference symbols using [markdown links instead](#referring-to-symbols).

**Syntax**

Expand Down