Repository navigation
Conversation
- `AnnotationStore`: every document built one and pruned it with the other caches, but nothing read it. - `pgls_hover::OnHoverParams::ast`: hover never read it, and the workspace looked the tree up for it. Hover now uses `WithCSTMapper`, and `WithCSTandASTMapper` is gone. - `HoveredNode::Trigger`, which was never constructed. The table and type branches of hover passed the optional schema through two arms each; they take `schema.as_deref()` now. - `Snapshot::find_types`, `SQLFunctionSignature::schema` and the client information that the language server stored at `initialize` (it is still logged), none of which were read. - `print_markup` in `pgls_lsp`, and with it the `pgls_console` dependency. - Stale `#[allow]`s on `Document::count` and `InitializeParams::workspace_folders`, which are used.
This was referenced Oct 26, 2026
Collaborator
Author
|
Superseded by #989 (rebuild of the document caches and walk). |
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.
Stacked on #975.
Removes code that nothing uses. I grepped for every item first. Clippy on the whole workspace is clean.
pgls_workspacewithout thedbfeature has the same six warnings as before:ExecuteStatementMapper,TypecheckDiagnosticsMapper,IdFilterandDocument::findare only used withdb. Those are cfg-dependent, not dead, and this PR doesn't touch them.Removed
AnnotationStore(pgls_workspace/src/workspace/server/annotation.rs). EveryDocumentbuilt one and pruned and cleared it with the parse and tree caches, but nothing read it. The field had#[allow(dead_code)], andget_annotationshad#[allow(unused)]. Its only test tested the store itself.pgls_hover::OnHoverParams::ast. Hover never read it, but the workspace looked up the statement's tree to pass it.on_hovernow maps the statement withWithCSTMapper, andWithCSTandASTMapper, which had no other user, is gone.HoveredNode::Trigger, which was never constructed (#[allow(unused)]).Snapshot::find_typesinpgls_catalog, which had no callers.SQLFunctionSignature::schema, which was set but never read (#[allow(dead_code)]).ClientInformationinpgls_lsp:initializestored the client's name and version in the session, and nothing read them. They are still logged by thetracing::instrumentoninitialize.print_markupinpgls_lsp/src/utils.rs(#[allow(unused)]). It was the last use ofpgls_consoleinpgls_lsp, so that dependency goes too.Simplified
In
pgls_hover::on_hover, the table and type branches each had an arm for "no schema" and one for "schema" that only differed in passingNoneorSome(&s). They passschema.as_deref()now, which is the same. The column branches really differ (alias resolution) and stay as they are.Kept
Document::countandInitializeParams::workspace_foldershad#[allow]s but are used (completions, workspace folder resolution). Only the attributes are removed.Migration::nameis only read by tests,HoveredNode::Policy's payload is never read, but the variant stops policy names from being hovered as other objects, the#[allow(unused_variables)]on theexecute_statementwithoutdband theMapHoldertest struct are cfg- or test-only. They are not dead.Tests
pgls_workspace,pgls_lsp,pgls_hoverandpgls_catalogpass, and so does clippy on the whole workspace.