Repository navigation
Conversation
This was referenced Nov 2, 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.
Stacked on #1130.
Completions inside MERGE (#1130) offered the columns of the target and the source in every
WHENclause. Postgres restricts what each branch sees (setNamespaceForMergeWhen), and so does the resolver since #1122.NOT MATCHED ... VALUES (|)offered target columns that Postgres rejects there, andNOT MATCHED BY SOURCEoffered source columns.What changed
TreesitterContextworks out which MERGE relation theWHENclause under the cursor can't see.NOT MATCHED [BY TARGET]hides the target andNOT MATCHED BY SOURCEhides the source. The column lists ofINSERT (...)and the targets ofUPDATE SEThide the source, because they are always target columns.MATCHEDhides nothing. If the target and the source are the same table, nothing is hidden, since the columns can't be told apart.t.for a hidden target offers nothing.Tests
completes_the_columns_each_merge_branch_sees: the columns offered inMATCHEDconditions and values,NOT MATCHED [BY TARGET]values and conditions,NOT MATCHED BY SOURCEconditions and values, the hidden alias, INSERT column lists,UPDATE SETtargets, and a MERGE of a table into itself. It fails without the filter.completes_in_mergesnapshot changes in six places:update set |andinsert (|lose the source columns, andvalues (|loses the target columns.cargo test -p pgls_completions -p pgls_treesitter -p pgls_hover,cargo clippy --workspace --all-targets -- -D warnings.Not covered