Skip to content

fix: include diagnostic error codes in tooltips#50

Merged
mscolnick merged 1 commit into
mainfrom
ms/lint-rule
May 12, 2026
Merged

fix: include diagnostic error codes in tooltips#50
mscolnick merged 1 commit into
mainfrom
ms/lint-rule

Conversation

@mscolnick
Copy link
Copy Markdown
Contributor

Closes #49

In processDiagnostics() (src/plugin.ts), format the CodeMirror diagnostic's source field as "source(code)" when the LSP diagnostic carries a code. Falls back to the bare source (or languageId) when no code is provided.

Examples:

  • source: "basedpyright", code: "reportUnusedImport""basedpyright(reportUnusedImport)"
  • source: "tsserver", code: 2304"tsserver(2304)"
  • source: "basedpyright", no code → "basedpyright"
  • no source, code: "E001""typescript(E001)" (uses languageId)

Closes #49

In `processDiagnostics()` (`src/plugin.ts`), format the CodeMirror diagnostic's `source` field as `"source(code)"` when the LSP diagnostic carries a `code`. Falls back to the bare source (or `languageId`) when no code is provided.

Examples:
- `source: "basedpyright"`, `code: "reportUnusedImport"` → `"basedpyright(reportUnusedImport)"`
- `source: "tsserver"`, `code: 2304` → `"tsserver(2304)"`
- `source: "basedpyright"`, no code → `"basedpyright"`
- no source, `code: "E001"` → `"typescript(E001)"` (uses `languageId`)
@mscolnick
Copy link
Copy Markdown
Contributor Author

cc @daizutabi

@mscolnick mscolnick merged commit 9cc5def into main May 12, 2026
4 checks passed
@mscolnick mscolnick deleted the ms/lint-rule branch May 12, 2026 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Include diagnostic error codes in tooltips

1 participant