Skip to content

fix(oxlint/lsp): remove uri cache on document change#21039

Merged
graphite-app[bot] merged 1 commit intomainfrom
04-04-fix_oxlint_lsp_remove_uri_cache_on_document_change
Apr 5, 2026
Merged

fix(oxlint/lsp): remove uri cache on document change#21039
graphite-app[bot] merged 1 commit intomainfrom
04-04-fix_oxlint_lsp_remove_uri_cache_on_document_change

Conversation

@Sysix
Copy link
Copy Markdown
Member

@Sysix Sysix commented Apr 4, 2026

This does not fix the stale diagnostics, but we now have at least a clean state on the linter side, when the document changed, but code actions are requested without a diagnostic request before.

Was originally found by #19793 and moved into an own PR for here.
Thank you, @wagenet

Copy link
Copy Markdown
Member Author

Sysix commented Apr 4, 2026


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent changes, fast-track this PR to the front of the merge queue

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions bot added A-editor Area - Editor and Language Server C-bug Category - Bug labels Apr 4, 2026
@Sysix Sysix requested a review from Copilot April 4, 2026 12:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the oxlint language server to clear per-URI tool caches when a document changes, ensuring code actions aren’t generated from stale cached state when editors request textDocument/codeAction without refreshing diagnostics first.

Changes:

  • Clear the tool’s per-URI cache on textDocument/didChange via worker.remove_uri_cache(&uri).
  • Add an explanatory comment describing why the cache clear is needed for some client behaviors.

@Sysix Sysix requested a review from Copilot April 4, 2026 20:03
@Sysix Sysix force-pushed the 04-04-fix_oxlint_lsp_remove_uri_cache_on_document_change branch from 7cc919d to 37c5e43 Compare April 4, 2026 20:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@Sysix Sysix force-pushed the 04-04-fix_oxlint_lsp_remove_uri_cache_on_document_change branch from 37c5e43 to 33c5b05 Compare April 4, 2026 21:39
@Sysix Sysix marked this pull request as ready for review April 5, 2026 00:00
@Sysix Sysix requested a review from camc314 as a code owner April 5, 2026 00:00
@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Apr 5, 2026
Copy link
Copy Markdown
Contributor

camc314 commented Apr 5, 2026

Merge activity

This does not fix the stale diagnostics, but we now have at least a clean state on the linter side, when the document changed, but code actions are requested without a diagnostic request before.

Was originally found by #19793 and moved into an own PR for here.
Thank you, @wagenet
@graphite-app graphite-app bot force-pushed the 04-04-fix_oxlint_lsp_remove_uri_cache_on_document_change branch from 33c5b05 to 1550561 Compare April 5, 2026 12:22
@graphite-app graphite-app bot merged commit 1550561 into main Apr 5, 2026
26 checks passed
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Apr 5, 2026
@graphite-app graphite-app bot deleted the 04-04-fix_oxlint_lsp_remove_uri_cache_on_document_change branch April 5, 2026 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-editor Area - Editor and Language Server C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants