Skip to content

Conversation

@MariaSolOs
Copy link
Contributor

@MariaSolOs MariaSolOs commented Oct 26, 2023

Adding support for snippet workspace edits.

Closes #724

@MariaSolOs
Copy link
Contributor Author

@dbaeumer while working on this I realized that it would be quite convenient to use StringValues in TextEdits to achieve this instead of introducing a new SnippetTextEdit type. That is, changing the type of textEdit.newText to string | StringValue.

The problem with that is that StringValue is still part of the the proposed inline completion feature, and I'm not sure about adding the dependence between the features.

@dbaeumer
Copy link
Member

@MariaSolOs I think we should stay away from changing TextEdit. TextEdit is used in many places and not all of them might support snippets. And it will be a big breaking change if clients use TextEdits as results with structural typing. The TS compiler will then emit errors since a StringValue will not be assignable to a string.

@MariaSolOs MariaSolOs marked this pull request as ready for review December 15, 2023 21:11
@MariaSolOs MariaSolOs force-pushed the snippet-edits branch 3 times, most recently from 1b2004f to ca399ea Compare December 15, 2023 22:13
@dbaeumer
Copy link
Member

As always great work.

@MariaSolOs
Copy link
Contributor Author

@dbaeumer I've addressed your comments. Please let me know if I'm missing anything else :)

Copy link
Member

@dbaeumer dbaeumer left a comment

Choose a reason for hiding this comment

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

As always very good work

@vscodenpa vscodenpa added this to the December / January 2024 milestone Jan 17, 2024
@dbaeumer dbaeumer merged commit 2c7e623 into microsoft:main Jan 17, 2024
@dbaeumer
Copy link
Member

@MariaSolOs will you provide a PR for the spec as well?

@MariaSolOs
Copy link
Contributor Author

MariaSolOs commented Jan 17, 2024

@MariaSolOs will you provide a PR for the spec as well?

Yep, working on it.

EDIT: I will wait for the resolution of #1343 (comment) before updating the specs.

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.

Allow CodeActions to specify cursor position

6 participants