microsoft / microsoft/language-server-protocol

Allow offsets relative to the start of the document (and not the start of the line of the range)

Open
#1,518 9 comments 3 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

I have noticed that LSPEclipseUtils.toOffset to recalculate the start and end positions of the diagnostics published by the language server.

This is a performance issue for us because our filesystem implementation is based on remote files, and for the recalculation of these offsets the text of the resource must be fetch from the remote connection.
See https://github.com/eclipse/lsp4e/issues/160. Could we have a new feature so that if the client so prefers, the offset of the ranges are sent relative to the start of the document?

Having such a capability would mean a big performance inprovement for our diagnostics propagation.

I think we could have such a documentPosition instead of the current one, or we could have it as an additional optional property.

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 by reviewing the language-server protocol position and range definitions, then inspect the referenced LSPEclipseUtils.toOffset behavior and issue 160. Define how document-relative offsets would be represented and kept optional, and document the resolved protocol behavior and performance rationale.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.