Repository navigation
Conversation
The formatting of a document moves to server/formatting.rs as it was, and the lint and splinter rule selection visitors become one RuleSelection. No behaviour changes.
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.
Two moves in the workspace server that change no behaviour.
Formatting moves to
server/formatting.rspull_file_formattinghad about 200 lines of formatting inline: it built theFormatConfig, formatted the bodies of SQL functions, and rebuilt the file from the formatted statements and the text between them.collapse_blank_linesandrestore_named_parameterssat at the end ofserver.rs. These now live inserver/formatting.rsasformat_configandformat_document(doc, settings, range, path), together with the two helpers.pull_file_formattingreads the settings and the document and callsformat_document. The code moved as it was. It readssettings.formatter.xassettings.xandparams.rangeasrange, and nothing else changed.server.rsgoes from 2,296 to 2,021 lines.One visitor for the lint and splinter rule selection
LintVisitorandSplinterVisitorinserver/analyser.rswere copies of each other with two differences:only(as_linter_rulesoras_splinter_rules);linter.enabledis off, and the typecheck rules whentypecheck.enabledis off.They are now one
RuleSelectionthat collects whatonlyandskipselect.AnalyserVisitorBuilder::finishpasses in the configured rules and applies theenabledcheck to the lint rules. The splinter visitor recorded every category, while the lint visitor only recorded the categories of the lint kind. The splinter registry has one category, anddeclare_category!declares it withkind: Lint, so the shared filter visits the same rules.Tests
The existing tests cover both: the formatting tests in
pgls_workspace(ranges, SQL function bodies, named parameters, blank lines) andrecognizes_disabled_linter_rulesplus the diagnostics tests withonly/skip.cargo test -p pgls_workspaceand clippy on the whole workspace pass.Update: This is #975 again, rebuilt on
mainas the first PR of the rebuild of the document caches and the walk (#918/#929 and their stacks are closed in favour of it).mainhas gained the rule that a SQL function body with several statements is left as written (#947) since #975 was opened; that code moved along unchanged. It no longer charges the document caches, which don't exist onmain.