Skip to content

Commit c6c1e08

Browse files
authored
add: explain new symbol referencing feature (#36)
1 parent 98505da commit c6c1e08

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/content/wiki/annotations.mdx

+12-1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,17 @@ The below methods can be added to the end of a line:
4646
- Two trailing spaces (may be removed by formatting tools)
4747
- Markdown backslash `\` ([not recommended](https://www.markdownguide.org/basic-syntax#line-break-best-practices))
4848

49+
## Referring to symbols
50+
51+
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.
52+
53+
```lua
54+
---@alias MyCustomType integer
55+
56+
---Calculate a value using [my custom type](lua://MyCustomType)
57+
function calculate(x) end
58+
```
59+
4960
## Tips
5061

5162
- 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.
@@ -1194,7 +1205,7 @@ local function getNicknames() end
11941205

11951206
### @see
11961207

1197-
Allows you to reference a specific symbol (e.g. `function`, `class`) from the workspace.
1208+
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).
11981209

11991210
**Syntax**
12001211

0 commit comments

Comments
 (0)