microsoft / microsoft/language-server-protocol

Result ordering of `textDocument/definition`

Open
#1,999 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request
Dominant language
TypeScript
Stars
13k
Forks
1k
Avg merge
6d 1h
Merged PRs (30d)
10

Description

Currently in Neovim, the "go to definition" implementation favours the first result returned by the server. However, we have found at least one server (lua-language-server) that returns this list with the worst match first.

Should the spec be more explicit in how these results can be ordered, or is it up to the client to order the results?

Issue that raised this question: https://github.com/neovim/neovim/pull/30025

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the textDocument/definition specification and the linked Neovim pull request to compare how result ordering is currently handled. Resolve whether ordering belongs to the language server or client, then update the specification so that responsibility is explicit.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, neovim, typescript
Domain
api, developer-experience, tooling
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.