microsoft / microsoft/TypeScript
[navtree] Only a single nameSpan listed for multiple declarations of interface
Open
Nobody has claimed this yet.
Domain: LS: TSServer
In Discussion
Suggestion
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
TypeScript Version: 3.7.2
Search Terms:
- navtree
- tsserver
Code
For the TypeScript:
interface IFoo2 {
foo: any;
}
interface IFoo2 {
foo2: any;
}
- Run a
navTreerequest
Bug:
Two spans for IFoo2 are returned but there is only a single nameSpan
{
"text": "<global>",
"kind": "script",
"kindModifiers": "",
"spans": [
{
"start": {
"line": 1,
"offset": 1
},
"end": {
"line": 8,
"offset": 2
}
}
],
"childItems": [
{
"text": "IFoo2",
"kind": "interface",
"kindModifiers": "",
"spans": [
{
"start": {
"line": 1,
"offset": 1
},
"end": {
"line": 3,
"offset": 2
}
},
{
"start": {
"line": 5,
"offset": 1
},
"end": {
"line": 7,
"offset": 2
}
}
],
"nameSpan": {
"start": {
"line": 1,
"offset": 11
},
"end": {
"line": 1,
"offset": 16
}
},
...
}
]
}
For VS Code's tooling, we'd like to have a list of all namespans
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the TypeScript 3.7.2 navTree request using the two merged IFoo2 declarations shown in the report. Trace the navTree response generation and update it so each declaration's nameSpan is represented; done means the response contains both name spans and the existing spans remain correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- developer-experience
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100