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

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

Acknowledgement
  • 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:

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

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.

Lingua principale
Go
Stelle
111k
Fork
14.4k
Merge medio
1g 15h
PR unite (30g)
106

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.

Altre issue di microsoft/TypeScript

Tutte le issue di microsoft/TypeScript

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.