Skip to content

Conversation

@BoyanLu1008
Copy link

Context

Issue #811 reports that autocomplete is "flaky" when filling function parameters in Evaluate nodes. Two main problems - optional parameters showing up before required ones in suggestions, and caret jumping to random positions after inserting parameters.

Related issues

  • Related Issue #
  • Closes 811#

Verification

Added filtering logic to prioritize required parameters in autocomplete. When there are unfilled required params, optional ones get filtered out. Did this in three places - Evaluate.getPossibleEvaluations(), Autocomplete.getRelativeFieldEdits(), and Autocomplete.getPossibleNodes().
Also fixed the caret position issue in Assign.ts - now it stays at the insertion point instead of jumping to placeholders unless it's explicitly a completion operation.
Tested on Chrome with basic function calls that have required and optional parameters. Required params show up first, optional ones stay hidden until all required are filled. Caret stays where you're typing.
Haven't fully tested variable-length params or nested Evaluate nodes yet.

Checklist

  • Implemented parameter filtering logic in Evaluate.ts and Autocomplete.ts
  • Fixed caret position behavior in Assign.ts
  • Tested basic function calls with mixed required/optional parameters
  • Need feedback on the three-layer filtering approach
  • Test edge cases (variable-length params, nested evaluates)

@amyjko amyjko self-assigned this Nov 17, 2025
@amyjko amyjko self-requested a review November 17, 2025 06:30
Copy link
Collaborator

@amyjko amyjko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! This resolves many of the cases and the implementation looks reasonable and robust, following established patterns. Here are a few things I noticed in my initial review before we merge this:

  • This doesn't resolve the case in the issue where the cursor is at the end Phrase('' name: '' *). It should suggest additional named inputs, but it doesn't suggest anything). (If this turns out to be a harder or separate issue, feel free to open a new issue for this specific case).
  • There are two TypeScript errors. Please run npm run check and resolve them.
  • Remove the edit to package-lock.json

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please resolve this conflict. There shouldn't be a change to package-lock.json.

@amyjko
Copy link
Collaborator

amyjko commented Dec 19, 2025

@BoyanLu1008, do you intend to finish this pull request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants