microsoft / microsoft/TypeScript

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

オープン
#64,155 コメント 1 件 リアクション 1 件 担当者 2 名 GitHub で見る

@jakebailey がすでに取り組んでいます。

2026年9月3日 から。

  • #64160 @copilot-swe-agent による — オープン
主要言語
Go
スター
111k
フォーク
14.3k
平均マージ
2日 4時間
マージ済み PR(30日)
132

説明

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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。