microsoft / microsoft/TypeScript

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

Ouverte
#64,155 1 commentaire 1 réaction 2 personnes assignées Voir sur GitHub

@jakebailey y travaille déjà.

Depuis le 3/9/2026.

  • #64160 par @copilot-swe-agent — ouverte
Langage dominant
Go
Étoiles
111k
Forks
14.3k
Merge moyen
2 j 4 h
PR mergées (30 j)
132

Description

### 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.

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.