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

Snippet edit feature #1343

Merged
merged 2 commits into from
Jan 17, 2024
Merged

Snippet edit feature #1343

merged 2 commits into from
Jan 17, 2024

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.

protocol/src/common/protocol.ts Show resolved Hide resolved
types/src/main.ts Outdated Show resolved Hide resolved
@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

types/src/main.ts Outdated Show resolved Hide resolved
@vscodenpa vscodenpa added this to the December / January 2024 milestone Jan 17, 2024
@dbaeumer dbaeumer merged commit 2c7e623 into microsoft:main Jan 17, 2024
6 checks passed
@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