Skip to content

Add CompletionItem conversion for additionalTextEdits - #87648

Merged
Johannes Rieken (jrieken) merged 1 commit into
microsoft:masterfrom
jzyrobert:87346-additionalTextEdits
Dec 31, 2019
Merged

Johannes Rieken (jrieken) merged 1 commit into
microsoft:masterfrom
jzyrobert:87346-additionalTextEdits

Conversation

@jzyrobert

Copy link
Copy Markdown
Contributor

This PR fixes #87346
Running the sample repo,
Before:

dantup
undefined

After:
Code_-_OSS_2019-12-24_00-00-09

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For commands, use

fromInternal(command: modes.Command): vscode.Command | undefined {
(which you somehow need to get here)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why the if-defence? Shouldn't the type always be correct?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The edits.text of type ISingleEditOperation are possibly null, while modes.TextEdit requires a non-null string.

Is casting it to the type is sufficient?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah - cast it. It's TextEdit-objects that have sourced them, so they should be well defined.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Renove the range check as well? Or keep it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nuke it

@jzyrobert

Copy link
Copy Markdown
Contributor Author

☢ Johannes Rieken (@jrieken) ☢

@jrieken

Copy link
Copy Markdown
Contributor

looking good now. thanks!

@jrieken
Johannes Rieken (jrieken) merged commit d506ebe into microsoft:master Dec 31, 2019
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 27, 2020
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.

vscode.executeCompletionItemProvider results are missing additionalTextEdits

2 participants