Repository navigation
Fix member completion for assigned and collected Polars queries - #785
Merged
renkun-ken merged 3 commits intoOct 8, 2026
Merged
renkun-ken merged 3 commits into
renkun-ken merged 3 commits into
Conversation
eitsupi
approved these changes
Oct 8, 2026
eitsupi
left a comment
Member
There was a problem hiding this comment.
Reviewed with ChatGPT against the latest 9fb65b1.
The fix looks sound to me. In particular, restricting package-selection history to bindings before the cursor is a clear correctness improvement, and the prepared return summaries remain generic rather than adding Polars-specific rules. The regression coverage for reassignment, collected DataFrames, argument-dependent returns, invalid matching, and stale metadata is also reassuring.
Two non-blocking architectural notes:
member_prepare_returns()is really a semantic inference/summary pass rather than extraction. Keeping it inmember-extraction.Rcreates a somewhat circular responsibility between extraction and inference; I think this boundary is worth cleaning up before more summary passes are added.- The per-function inference is bounded, but package-wide return preparation currently has no overall time/node budget. Since this moves work from request time into the metadata worker, a package-level bound may eventually be useful to keep preparation predictable.
Neither point looks like a blocker for this PR. LGTM, approving.
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.
Typing
q1$orq2$after assigning Polars query chains could fall back to document-word completion. This also affected a reassignedq1ending incollect()and an eager aggregation assigned toq2: both should expose DataFrame members instead of the earlier LazyFrame members.Use bindings before the cursor when selecting package metadata, and reduce repeated metadata lookups and clock checks. Prepare compact return-class guarantees for expensive package functions with unknown arguments in the background worker, avoiding costly default and argument traversal during completion. Keep argument matching and ordinary inference for argument-dependent results, and discard prepared returns when loaded definitions change. Document expressions, methods, defaults, and native calls are never executed by inference.
Regression coverage includes the original query assignments, reassignment through
collect(), eagergroup_by()/agg(), and each first LSP dollar trigger after editing without receiver warming or retries. Generic fixtures cover argument-sensitive returns, invalid argument matching, metadata changes, and absence of execution.Validation: installed-package member-completion, member-provider, S4, S7, completion, and completion-typing suites passed with Polars 1.16.0. Three S7 capability-dependent tests were skipped. Changed lines pass lint checks, and
git diff --checkpasses.