Skip to content
This repository has been archived by the owner on Oct 13, 2021. It is now read-only.

Support completionItem/resolve for additional text edits #342

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

CalinLeafshade
Copy link

A small change to allow additional text changes from completionItem/resolve.

@NickHu
Copy link

NickHu commented Mar 30, 2021

I think you also want to change

if item.additionalTextEdits then
to

if next(item.additionalTextEdits) then

This handles the subtle case when item.additionalTextEdits is {}, because if {} then x else y end evaluates to x in lua (rust-analyzer does this when I do a completion and expect to receive an auto-import - it needs to hit the else case added by this PR to get the additionalTextEdit but doesn't because of this). Note that it is not sufficient to compare item.additionalTextEdits ~= {} because it's not true that {} == {} (lua compares these by pointers).

Copy link

@NickHu NickHu left a comment

Choose a reason for hiding this comment

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

See my comment above

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants