Skip to content

Commit

Permalink
add: explain new symbol referencing feature (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
carsakiller authored Jun 10, 2024
1 parent 98505da commit c6c1e08
Showing 1 changed file with 12 additions and 1 deletion.
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

0 comments on commit c6c1e08

Please sign in to comment.