Use match-try instead of case-try to avoid a where clause.

Add changelog entry.
This commit is contained in:
Phil Hagelberg 2025-03-02 08:58:30 -08:00
parent 0b979f1e78
commit 1c2f5364be
2 changed files with 3 additions and 2 deletions

View File

@ -4,6 +4,7 @@
### Features
* Support highlighting references to the symbol under the cursor in the current scope.
* Support loading external docsets from disk.
* Extract TIC-80 docs to external docset.
* Support `:lua-version` settings like `"lua5.4"` rather than requiring `"lua54"`.

View File

@ -103,10 +103,10 @@ Every time the client sends a message, it gets handled by a function in the corr
:textDocument {: uri}}]
(let [this-file (files.get-by-uri server uri)
byte (utils.position->byte this-file.text position server.position-encoding)]
(case-try (analyzer.find-symbol this-file.ast byte)
(match-try (analyzer.find-symbol this-file.ast byte)
symbol
(analyzer.find-nearest-definition server this-file symbol byte)
(where {: referenced-by : file : binding} (= file.uri uri))
{: referenced-by :file {:uri this-file.uri &as file} : binding}
(let [result (icollect [_ {:symbol reference} (ipairs referenced-by)]
{:range (message.ast->range server file reference)
:kind documentHighlightKind.Read})]