microsoft / microsoft/multilspy

Dart - request_document_symbols does not return complete range of symbol definitions

Open
#76 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
610
Forks
111
PR merge metrics
No merged PRs in 30d

Description

Today I've been working with the new Dart parser, I really appreciate the community getting this added in just as I encountered a project that required it.

However, it seems like the language server only returns the selection range of each symbol, not the full range of each symbol's definition. Whereas with any other parser I've used (Java, Python, TS/JS), I can get the selection range of the symbol (ie: the name of a function) as well as the range of the complete symbol definition (ie: a function body).

For my own case I have added a very crude workaround where I try to construct the missing range based on the given range of the symbol's definition, however it isn't perfect and definitely isnt ideal when every other language server in multilspy supports this functionality out of the box.

I tried to dig around the code for the Dart implementation, and the Dart parser itself, but haven't been able to identify the source of this discrepancy in functionality, or how to reliably fix it.

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 tracing request_document_symbols through the Dart parser and language-server integration, then compare its returned ranges with the Java, Python, and TypeScript/JavaScript implementations mentioned in the issue. Confirm whether the Dart parser or server omits the full definition range; done means each symbol includes both its selection range and complete definition range.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, python
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.