Repository navigation
Conversation
Removes AnnotationStore, the unused ast of hover's parameters with WithCSTandASTMapper, HoveredNode::Trigger, Snapshot::find_types, the client information and workspace folders that the LSP session stored without reading them, and the pgls_console dependency of pgls_lsp.
This was referenced Oct 26, 2026
Closed
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.
Stacked on #988.
Removes code that nothing uses. I grepped for every item first. Clippy on the whole workspace is clean.
Removed
AnnotationStore(pgls_workspace/src/workspace/server/annotation.rs). EveryDocumentbuilt one and pruned 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.ClientInformationinpgls_lsp:initializestored the client's name and version in the session, and nothing read them. They are still logged by thetracing::instrumentoninitialize.InitializeParams::workspace_foldersinpgls_lsp's session (#[allow(unused)]). The session keeps the workspace folders in a field of its own, which is what everything reads.pgls_consoledependency ofpgls_lsp, which nothing in the crate uses any more.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::counthad an#[allow]but is used (completions). Only the attribute is 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 the schema-only structs 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.Update: This is #977 again, rebuilt on #988 for the rebuild of the document caches and the walk. Since #977 was opened,
print_markupwas already removed onmain, andInitializeParams::workspace_foldersbecame unused because the session now keeps the folders separately, so it is removed here instead of kept.SQLFunctionSignatureno longer exists onmain.