Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(editor): Capture indexed access expressions when building completions #8331

Merged

Conversation

ivov
Copy link
Contributor

@ivov ivov commented Jan 15, 2024

When building completions, we currently capture indexed access expressions as the index at the end, causing array completions to be offered. This PR accounts for this case.

Follow-up to: #5695

if (dollarSignIndex === -1) {
userInput = userInput.replace(/^.+(\(|\[|{)/, '');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Went through the referenced PR, but I cannot quite tell why we needed to strip parens here. Since parens are needed for indexed access expressions and since all tests still pass, it looks safe to remove. Else let me know.

/cc @MiloradFilipovic

@n8n-assistant n8n-assistant bot added n8n team Authored by the n8n team ui Enhancement in /editor-ui or /design-system labels Jan 15, 2024
Copy link
Member

@alexgrozav alexgrozav left a comment

Choose a reason for hiding this comment

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

Works as expected.

Copy link

cypress bot commented Jan 17, 2024

2 flaky tests on run #3793 ↗︎

0 331 5 0 Flakiness 2

Details:

🌳 🖥️ browsers:node18.12.0-chrome107 🤖 ivov 🗃️ e2e/*
Project: n8n Commit: 38018b9735
Status: Passed Duration: 03:22 💡
Started: Jan 17, 2024 9:58 AM Ended: Jan 17, 2024 10:01 AM
Flakiness  28-debug.cy.ts • 1 flaky test

View Output Video

Test Artifacts
Debug > should be able to debug executions Test Replay Screenshots Video
Flakiness  29-templates.cy.ts • 1 flaky test

View Output Video

Test Artifacts
Templates > should save template id with the workflow Test Replay Screenshots Video

Review all test suite changes for PR #8331 ↗︎

Copy link
Contributor

✅ All Cypress E2E specs passed

@ivov ivov merged commit 159b328 into master Jan 17, 2024
30 checks passed
@ivov ivov deleted the pay-1140-expressions-autocomplete-shows-array-methods-for-string branch January 17, 2024 10:02
@github-actions github-actions bot mentioned this pull request Jan 17, 2024
@janober
Copy link
Member

janober commented Jan 17, 2024

Got released with n8n@1.25.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
n8n team Authored by the n8n team Released ui Enhancement in /editor-ui or /design-system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants