-
Notifications
You must be signed in to change notification settings - Fork 724
Do not allow client to modify whitespace for auto insert edits #8588
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
base: main
Are you sure you want to change the base?
Conversation
ffb9364
to
c5ab09c
Compare
c854d76
to
11bb070
Compare
// and another to move the close brace to a new line below that). We still want to trigger on auto insert here, so remove | ||
// duplicates before we check if the change matches a trigger character. | ||
if (changeTrimmed.length > 1) { | ||
changeTrimmed = [...new Set(changeTrimmed)].join(''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changeTrimmed
is a string. What is this intending to do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea is to remove duplicate newline characters from the string. Potentially this should instead just check if it the string is only new line characters, and remove duplicates then.
//const editor = vscode.window.activeTextEditor?.insertSnippet(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
//const editor = vscode.window.activeTextEditor?.insertSnippet(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a test to the onAutoInsert integration tests?
Tell the client not to modify the whitespace we provided in auto insert snippets.
Requires dotnet/roslyn#80075