Repository navigation
Conversation
features/code_actions.rs only held the request and result types, while the logic of each action lived in workspace/server.rs, server/expand_star.rs and server/statement_execution.rs. Each action now has a submodule: - lint: the fixes and suppressions of lint diagnostics, and fix_file - expand_star: moved from workspace/server - execute_statement: its types, the "Execute Statement" actions, and the execution against the database (moved from server/statement_execution) - schema_cache: the "Invalidate Schema Cache" action The server keeps gathering the inputs (documents, settings, snapshot, connection) and calls into the module. The types are re-exported from features::code_actions, so the public API is unchanged. No behaviour change.
This was referenced Oct 26, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to the review of #920 ("maybe we should split code actions into their own module now that we have expand star and execute statement") and #932 ("Shouldn't this be in server/features/expand_star?").
features/code_actions.rsonly held the request and result types. The logic of the actions was spread overworkspace/server.rs(lint fixes, suppressions,fix_file, the execute and invalidate actions),workspace/server/expand_star.rsandworkspace/server/statement_execution.rs. This moves it into one module, with a file per action:features/code_actions.rs: the types shared by all actions (CodeActionsParams,CodeAction,CodeActionKind,EditAction,TextEdit, ...), and re-exports of the types below, sofeatures::code_actions::ExecuteStatementParamsetc. keep working.code_actions/lint.rs:FixFileParams/FixFileMode/FixFileResult, the quick fixes and suppressions at the cursor,suppression_edit, and the fix loop offix_file.code_actions/expand_star.rs: moved unchanged fromworkspace/server/.code_actions/execute_statement.rs: the execute statement types, the "Execute Statement" actions, andexecute_statement/execution.rs, the execution against the database (moved unchanged fromworkspace/server/statement_execution.rs).code_actions/schema_cache.rs: the "Invalidate Schema Cache" action.WorkspaceServerstill gathers the inputs, i.e. the document, settings, snapshot and connection, which are private to the server, and calls the functions of the module with them.pull_code_actionsnow reads as a list: lint actions, refactors, execute statement, invalidate schema cache, in the same order as before.This is a move only. No behaviour changes, and the TS bindings and
docs/schema.jsonstay the same (just gen-lintleaves the tree clean).Tests
cargo test -p pgls_workspace(195 passed, including the code action, expand star and fix-file tests) andcargo test -p pgls_lsppass unchanged.cargo clippy --workspace --all-targets -- -D warningsis clean.