microsoft / microsoft/TypeScript

Should the native TypeScript LSP include top-level imports in its `textDocument/documentSymbol` response?

Aperta
#64,155 1 commento 1 reazione 2 assegnatari Vedi su GitHub

@jakebailey ci sta già lavorando.

Dal 3/9/2026.

  • #64160 di @copilot-swe-agent — aperta
Lingua principale
Go
Stelle
111k
Fork
14.3k
Merge medio
2g 4h
PR unite (30g)
132

Descrizione

### Acknowledgement

- [x] I acknowledge that issues using this template may be closed without further explanation at the maintainer's discretion.

### Comment

## Question

The existing VS Code TypeScript extension intentionally filters imports from
the Outline view. This behavior was introduced in:

- https://github.com/microsoft/vscode/issues/50829
- https://github.com/microsoft/vscode/commit/f1efd11c2a6da4533f65d66bf7921c552270ca4e

The native TypeScript LSP currently appears to include imports instead. For
example:

```ts
import DefaultComponent from './component';
import * as utils from './utils';
import { value, original as renamed } from './values';
import type { Options } from './types';
```

## Expected Behavior

I am not certain which behavior is intended. I would appreciate clarification
on whether:

1. The difference from the existing VS Code TypeScript extension is intentional.
2. The native LSP should preserve the established Outline behavior.

The LSP specification does not appear to describe whether imports should be
reported as document symbols, so this seems to be a language-server policy
decision.

## Motivation

Including imports can substantially clutter the Outline without providing much value in return. Knowing the intended behavior would help determine whether downstream servers and users should expect that behavior to cease when adopting TS 7.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.