Skip to content

refactor(language-server): pass LanguageId to Tool::run_diagnostic and variants#19983

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/refactor-oxc-language-server
Draft

refactor(language-server): pass LanguageId to Tool::run_diagnostic and variants#19983
Copilot wants to merge 3 commits intomainfrom
copilot/refactor-oxc-language-server

Conversation

Copy link
Contributor

Copilot AI commented Mar 3, 2026

Threads LanguageId through the Tool trait's diagnostic methods so tools can eventually use it for language-aware behavior. The language ID is currently ignored in all implementations — this is a pure refactor with no behavioral changes.

Changes

  • Tool trait (tool.rs): Add language_id: &LanguageId parameter to run_diagnostic, run_diagnostic_on_save, run_diagnostic_on_change
  • WorkspaceWorker (worker.rs): Thread language_id through collect_diagnostics_with and the three public run_diagnostic* methods
  • Backend (backend.rs): Extract LanguageId from the in-memory file system (or request params in did_open) at each call site; restructured did_open to avoid an unnecessary language_id.clone()
  • ServerLinter (server_linter.rs): Accept _language_id parameter (ignored for now)
  • FakeTool / tests (tests.rs, worker.rs, tester.rs): Updated to match new signatures
// Before
fn run_diagnostic(&self, _uri: &Uri, _content: Option<&str>) -> DiagnosticResult;

// After
fn run_diagnostic(&self, _uri: &Uri, _language_id: &LanguageId, _content: Option<&str>) -> DiagnosticResult;

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Refactor oxc_language_server crate and Tool trait refactor(language-server): pass LanguageId to Tool::run_diagnostic and variants Mar 3, 2026
Copilot finished work on behalf of Sysix March 3, 2026 22:24
@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI A-editor Area - Editor and Language Server C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-editor Area - Editor and Language Server A-linter Area - Linter C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants