fwcd / fwcd/kotlin-language-server
Definition not working on some declaration sites
- Dominant language
- Kotlin
- Stars
- 2k
- Forks
- 252
- PR merge metrics
- No merged PRs in 30d
Description
While I was working on https://github.com/fwcd/kotlin-language-server/pull/319 I noticed that requesting a definition on the declaration site of a property, a method or a method argument doesn't work. Note that this works for classes, for example.
When you "Ctrl + Click" on a symbol in VSCode, a definition request is made. If the definition returned is the exact same symbol we requested a definition for, it means we are already at the definition of the symbol. When this happens, VSCode immediately requests references of that same symbol. This allows "Ctrl + click" to work with definition and references. This is currently working fine with classes, because the definition request on the declaration site of a class works. But for other symbols, it's broken.
The rename is also affected by this issue.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the language server's definition-request handling and compare how declaration sites are handled for classes versus properties, methods, and method arguments. Verify the behavior through VSCode Ctrl+Click: definitions at those declaration sites should return the same symbol, allowing references and rename to work there as they do for classes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100