Skip to content

fix member expression completions#1758

Merged
connor4312 merged 5 commits into
microsoft:mainfrom
zardoy:fix-member-completions
Jul 14, 2023
Merged

fix member expression completions#1758
connor4312 merged 5 commits into
microsoft:mainfrom
zardoy:fix-member-completions

Conversation

@zardoy

@zardoy zardoy commented Jul 13, 2023

Copy link
Copy Markdown
Contributor

e.g. arr.len|, seems it was broken for years

fixes microsoft/vscode#168021

@zardoy

zardoy commented Jul 13, 2023

Copy link
Copy Markdown
Contributor Author

though there is still no completions for ["|"] (would be useful for number props)

Comment thread src/adapter/completions.ts Outdated

@connor4312 connor4312 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Took me a lil to grok but it looks okay. I think the main thing is just using estraverse's parent since the current implementation could incorrectly pass the parent as the previous sibling node.

@zardoy

zardoy commented Jul 14, 2023

Copy link
Copy Markdown
Contributor Author

I think the main thing is just using estraverse's parent since the current implementation could incorrectly pass the parent as the previous sibling node.

But it is inside of the asAcorn.start < offset && offset <= asAcorn.end check. Anyway, it was easy to change. Btw thank you for the quick reply!

@connor4312 connor4312 added this to the July 2023 milestone Jul 14, 2023
@connor4312 connor4312 enabled auto-merge (squash) July 14, 2023 15:41
@connor4312 connor4312 merged commit 16b9a70 into microsoft:main Jul 14, 2023
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.

Inconsistent completions in debugger

3 participants