microsoft / microsoft/language-server-protocol

Specify location without range

Open
#660 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Hello,
In my server I would like to use "go to definition" to open included files.
It works, my problem is when I go to an opened file it returns to first line, instead I would like to keep the cursor position.
I tried setting range to 0,0,00 and to 0,0,10000,10000 without no luck.
I tried also specifying undefined as range, and the location is ignored.
I am trying with Visual Studio Code, I tried Location and LocationLink.
What is the correct way to do it? is it a VSCode issue?

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

Review the Language Server Protocol definitions for Location and LocationLink, then compare their range behavior with Visual Studio Code's go-to-definition handling. Check whether either representation supports preserving the cursor position; done would be a clarified protocol or editor behavior and documented guidance for this case.

Written by the indexing model from the issue text.

Assessment

Tech stack
vscode
Domain
api, developer-experience
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.