Skip to content

Comments

test(lsp): add simple tests for textDocument/didOpen|didChange|didClose and textDocument/codeAction#16404

Merged
graphite-app[bot] merged 1 commit intomainfrom
12-02-test_lsp_add_simple_tests_for_textdocument_didopen_didchange_didclose_and_textdocument_codeaction_
Dec 2, 2025
Merged

test(lsp): add simple tests for textDocument/didOpen|didChange|didClose and textDocument/codeAction#16404
graphite-app[bot] merged 1 commit intomainfrom
12-02-test_lsp_add_simple_tests_for_textdocument_didopen_didchange_didclose_and_textdocument_codeaction_

Conversation

@Sysix
Copy link
Member

@Sysix Sysix commented Dec 2, 2025

This PR adds comprehensive tests for the LSP (Language Server Protocol) server's text document lifecycle notifications (textDocument/didOpen, textDocument/didChange, textDocument/didClose) and code action functionality (textDocument/codeAction). The changes include both unit-level tests in worker.rs and integration-level tests in tests.rs.

Copy link
Member Author

Sysix commented Dec 2, 2025


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 hot fixes, skip the queue and merge this PR next

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.

Copy link
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 adds comprehensive tests for the LSP (Language Server Protocol) server's text document lifecycle notifications (textDocument/didOpen, textDocument/didChange, textDocument/didClose) and code action functionality (textDocument/codeAction). The changes include both unit-level tests in worker.rs and integration-level tests in tests.rs.

  • Adds test helper functions for creating LSP requests for document lifecycle and code actions
  • Implements get_code_actions_or_commands in FakeTool to support testing
  • Adds unit test test_code_action_collection in worker.rs to test the worker's code action collection
  • Adds integration tests for file notifications and code actions with and without results

Reviewed changes

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

File Description
crates/oxc_language_server/src/worker.rs Adds import for code action types and unit test for code action collection at the worker level
crates/oxc_language_server/src/tests.rs Adds test helper functions (did_open, did_change, did_close, code_action), implements get_code_actions_or_commands in FakeTool, and adds three integration tests for file notifications and code actions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Sysix Sysix marked this pull request as ready for review December 2, 2025 18:13
@Sysix Sysix requested a review from camc314 as a code owner December 2, 2025 18:13
@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Dec 2, 2025
@camc314 camc314 self-assigned this Dec 2, 2025
Copy link
Contributor

camc314 commented Dec 2, 2025

Merge activity

  • Dec 2, 6:18 PM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Dec 2, 6:18 PM UTC: camc314 added this pull request to the Graphite merge queue.
  • Dec 2, 6:28 PM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Dec 2, 6:33 PM UTC: Sysix added this pull request to the Graphite merge queue.
  • Dec 2, 6:33 PM UTC: Merged by the Graphite merge queue.

@graphite-app graphite-app bot force-pushed the 12-01-fix_lsp_respect_null_as_invalid_settings_for_workspace_didchangeconfiguration_ branch from b86e60b to 804144f Compare December 2, 2025 18:21
graphite-app bot pushed a commit that referenced this pull request Dec 2, 2025
…ose` and `textDocument/codeAction` (#16404)

> This PR adds comprehensive tests for the LSP (Language Server Protocol) server's text document lifecycle notifications (textDocument/didOpen, textDocument/didChange, textDocument/didClose) and code action functionality (textDocument/codeAction). The changes include both unit-level tests in worker.rs and integration-level tests in tests.rs.
@graphite-app graphite-app bot force-pushed the 12-02-test_lsp_add_simple_tests_for_textdocument_didopen_didchange_didclose_and_textdocument_codeaction_ branch from efc6e01 to ceaeb54 Compare December 2, 2025 18:22
Base automatically changed from 12-01-fix_lsp_respect_null_as_invalid_settings_for_workspace_didchangeconfiguration_ to main December 2, 2025 18:26
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Dec 2, 2025
…ose` and `textDocument/codeAction` (#16404)

> This PR adds comprehensive tests for the LSP (Language Server Protocol) server's text document lifecycle notifications (textDocument/didOpen, textDocument/didChange, textDocument/didClose) and code action functionality (textDocument/codeAction). The changes include both unit-level tests in worker.rs and integration-level tests in tests.rs.
@Sysix Sysix force-pushed the 12-02-test_lsp_add_simple_tests_for_textdocument_didopen_didchange_didclose_and_textdocument_codeaction_ branch from ceaeb54 to af67e80 Compare December 2, 2025 18:27
@Sysix Sysix added the 0-merge Merge with Graphite Merge Queue label Dec 2, 2025
@graphite-app graphite-app bot merged commit af67e80 into main Dec 2, 2025
21 checks passed
@graphite-app graphite-app bot deleted the 12-02-test_lsp_add_simple_tests_for_textdocument_didopen_didchange_didclose_and_textdocument_codeaction_ branch December 2, 2025 18:33
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Dec 2, 2025
taearls pushed a commit to taearls/oxc that referenced this pull request Dec 11, 2025
…ose` and `textDocument/codeAction` (oxc-project#16404)

> This PR adds comprehensive tests for the LSP (Language Server Protocol) server's text document lifecycle notifications (textDocument/didOpen, textDocument/didChange, textDocument/didClose) and code action functionality (textDocument/codeAction). The changes include both unit-level tests in worker.rs and integration-level tests in tests.rs.
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-test Category - Testing. Code is missing test cases, or a PR is adding them

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants