Diagnostics published for `git:` documents in the diff editor: project usings faded as unnecessary (IDE0005)

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

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
42/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
csharp, typescript, vscode

調査の方向性

Start with the repro in FreHu/csharp-diff-usings-repro and its README, then open a C# file in a working-tree diff to compare the file: and git: sides. Read the earlier fix in dotnet/roslyn#85886 and the related issue #9831 to see how git: documents are currently analysed. Done when git: documents publish no diagnostics, the file: side still does, and hover and colouring still work on the historical side.

索引モデルが issue の本文から書いたものです。

説明

untriaged

Issue Description

When a C# file is opened in the diff editor, the historical side (a git: document) is analysed as a miscellaneous file: framework references only, no project. Every using of a project namespace then fails to resolve and is faded as Using directive is unnecessary. (IDE0005). In a real codebase, where most usings are project namespaces, nearly every using on the historical side of every diff is faded.

The working-tree (file:) side of the same diff is analysed correctly.

Same root cause as #9831. Its fix (dotnet/roslyn#85886) stopped the Razor syntax errors on these documents but diagnostics are still published for them.

Steps to Reproduce

Repro: https://github.com/FreHu/csharp-diff-usings-repro. Steps are in its README.

I originally noticed this with C# Dev Kit installed; the repro uses a profile with only the C# extension to rule it out.

Expected Behavior

No diagnostics on git: documents. They are past, read-only versions: nothing reported on them can be acted on, and without project context the analysis is wrong. The file: side of a working-tree diff keeps normal diagnostics. Hover, navigation and semantic colouring on the historical side are welcome to stay.

Actual Behavior

  • using Repro.Models; (project namespace) is faded with IDE0005 on every git: side; using System.Text; (framework) is not.
  • The file: side of a working-tree diff is correct. Invoice gets type colouring only there.

Environment

  • VS Code: 1.144.1
  • C#: 2.160.4
  • .NET SDK: 10.0.203
  • OS: Windows 10 Pro 10.0.19045
主要言語
TypeScript
スター
3.1k
フォーク
742
平均マージ
1日 3時間
マージ済み PR(30日)
53

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

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

dotnet/vscode-csharp のほかの issue

dotnet/vscode-csharp の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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