biomejs / biome-vscode

Biome extension for Visual Studio Code and VSCodium
https://marketplace.visualstudio.com/items?itemName=biomejs.biome
Apache License 2.0
237 stars 32 forks source link

πŸ› Extension reports diagnostics that CLI does not #338

Open mbaroukhcw opened 2 months ago

mbaroukhcw commented 2 months ago

VS Code version

1.93.0

Extension version

2.3.0

Biome version

1.8.3

Operating system

Description

The vscode extension reports errors that the cli version of biome does not report

Steps to reproduce

I made a minimal reproduction case here : https://github.com/mbaroukhcw/biomeunused

when running

$ ./node_modules/.bin/biome lint
Checked 5 files in 1405Β΅s. No fixes applied.

there is no error.

But in vscode, I have an false error in the types.d.ts file image

Expected behavior

no error in the IDE.

Does this issue occur when using the CLI directly?

No

Link to a minimal reproduction

https://github.com/mbaroukhcw/biomeunused

Logs

└─┐biome_lsp::handlers::analysis::code_actions{uri=file:///home/mbaroukh/Documents/projets/sandbox/issuebiome/src/types.d.ts, range=Range { start: Position { line: 2, character: 1 }, end: Position { line: 2, character: 1 } }, only=None, diagnostics=[]}
  β”œβ”€  0ms DEBUG biome_service::workspace::server File capabilities: Js(JsFileSource { language: TypeScript { definition_file: false }, variant: Standard, module_kind: Module, version: ES2022, embedding_kind: None }) BiomePath { path: "/home/mbaroukh/Documents/projets/sandbox/issuebiome/src/types.d.ts" }
  β”œβ”€  0ms DEBUG biome_service::workspace The file has the following feature sets: 
  β”‚ {Format: Supported, OrganizeImports: Supported, Search: FileNotSupported, Lint: Supported}
  β”œβ”€  0ms DEBUG biome_lsp::handlers::analysis Cursor range 33..33
  β”œβ”€  0ms DEBUG biome_service::workspace::server File capabilities: Js(JsFileSource { language: TypeScript { definition_file: false }, variant: Standard, module_kind: Module, version: ES2022, embedding_kind: None }) BiomePath { path: "/home/mbaroukh/Documents/projets/sandbox/issuebiome/src/types.d.ts" }
  └─┐biome_service::file_handlers::javascript::code_actions{}
    └─┐biome_service::file_handlers::javascript::Code actions JavaScript{range=33..33, path=BiomePath { path: "/home/mbaroukh/Documents/projets/sandbox/issuebiome/src/types.d.ts" }}
    β”Œβ”€β”˜
  β”Œβ”€β”˜
  β”œβ”€  0ms DEBUG biome_lsp::handlers::analysis Pull actions result: PullActionsResult { actions: [] }
  β”œβ”€  0ms DEBUG biome_lsp::handlers::analysis Suggested actions: 
  β”‚ []
β”Œβ”€β”˜
└─┐biome_lsp::handlers::analysis::code_actions{uri=file:///home/mbaroukh/Documents/projets/sandbox/issuebiome/src/types.d.ts, range=Range { start: Position { line: 0, character: 5 }, end: Position { line: 0, character: 9 } }, only=Some([CodeActionKind("quickfix")]), diagnostics=[Diagnostic { range: Range { start: Position { line: 0, character: 5 }, end: Position { line: 0, character: 9 } }, severity: Some(Error), code: Some(String("lint/correctness/noUnusedVariables")), code_description: Some(CodeDescription { href: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("biomejs.dev")), port: None, path: "/linter/rules/no-unused-variables", query: None, fragment: None } }), source: Some("biome"), message: "This type alias is unused.", related_information: None, tags: None, data: None }]}
  β”œβ”€  0ms DEBUG biome_service::workspace::server File capabilities: Js(JsFileSource { language: TypeScript { definition_file: false }, variant: Standard, module_kind: Module, version: ES2022, embedding_kind: None }) BiomePath { path: "/home/mbaroukh/Documents/projets/sandbox/issuebiome/src/types.d.ts" }
  β”œβ”€  0ms DEBUG biome_service::workspace The file has the following feature sets: 
  β”‚ {Lint: Supported, OrganizeImports: Supported, Format: Supported, Search: FileNotSupported}
  β”œβ”€  0ms DEBUG biome_lsp::handlers::analysis Cursor range 5..9
  β”œβ”€  0ms DEBUG biome_service::workspace::server File capabilities: Js(JsFileSource { language: TypeScript { definition_file: false }, variant: Standard, module_kind: Module, version: ES2022, embedding_kind: None }) BiomePath { path: "/home/mbaroukh/Documents/projets/sandbox/issuebiome/src/types.d.ts" }
  └─┐biome_service::file_handlers::javascript::code_actions{}
    └─┐biome_service::file_handlers::javascript::Code actions JavaScript{range=5..9, path=BiomePath { path: "/home/mbaroukh/Documents/projets/sandbox/issuebiome/src/types.d.ts" }}
      β”œβ”€  0ms DEBUG biome_rowan::ast::batch pushing change...
    β”Œβ”€β”˜
  β”Œβ”€β”˜
  β”œβ”€  0ms DEBUG biome_lsp::handlers::analysis Pull actions result: PullActionsResult { actions: [CodeAction { category: Other("quickfix.suppressRule"), rule_name: Some(("correctness", "noUnusedVariables")), suggestion: CodeSuggestion { span: 0..5, applicability: Always, msg: "Suppress rule lint/correctness/noUnusedVariables", suggestion: TextEdit { dictionary: "// biome-ignore lint/correctness/noUnusedVariables: <explanation>\ntype User = {\n    email: string\n}", ops: [DiffOp(Insert { range: 0..66 }), DiffOp(Equal { range: 66..71 }), DiffOp(Equal { range: 71..99 })] }, labels: [] } }] }
  β”œβ”€  0ms DEBUG biome_lsp::handlers::analysis Suggested actions: 
  β”‚ [CodeAction(CodeAction { title: "Suppress rule lint/correctness/noUnusedVariables", kind: Some(CodeActionKind("quickfix.suppressRule.biome.correctness.noUnusedVariables")), diagnostics: Some([Diagnostic { range: Range { start: Position { line: 0, character: 5 }, end: Position { line: 0, character: 9 } }, severity: Some(Error), code: Some(String("lint/correctness/noUnusedVariables")), code_description: Some(CodeDescription { href: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("biomejs.dev")), port: None, path: "/linter/rules/no-unused-variables", query: None, fragment: None } }), source: Some("biome"), message: "This type alias is unused.", related_information: None, tags: None, data: None }]), edit: Some(WorkspaceEdit { changes: Some({Url { scheme: "file", cannot_be_a_base: false, username: "", password: None, host: None, port: None, path: "/home/mbaroukh/Documents/projets/sandbox/issuebiome/src/types.d.ts", query: None, fragment: None }: [TextEdit { range: Range { start: Position { line: 0, character: 0 }, end: Position { line: 0, character: 0 } }, new_text: "// biome-ignore lint/correctness/noUnusedVariables: <explanation>\n" }]}), document_changes: None, change_annotations: None }), command: None, is_preferred: None, disabled: None, data: None })]
β”Œβ”€β”˜
β”œβ”€1183m  INFO biome_lsp::server Starting Biome Language Server...
└─┐biome_lsp::server::biome/rage{params=RageParams}
β”Œβ”€β”˜