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

Fix Auto Insert XML Comment Issue #6130

Merged
merged 2 commits into from
Aug 14, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/lsptoolshost/roslynLanguageServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -861,9 +861,11 @@ async function applyAutoInsertEdit(
token: vscode.CancellationToken
) {
const change = e.contentChanges[0];

// Need to add 1 since the server expects the position to be where the caret is after the last token has been inserted.
const position = new vscode.Position(change.range.start.line, change.range.start.character + 1);
// Need to add a modifier since the server expects the position to be where the caret is after the last token has been inserted.
const position = new vscode.Position(
change.range.start.line,
change.range.start.character + (change.text.length - change.rangeLength)
);
const uri = UriConverter.serialize(e.document.uri);
const textDocument = TextDocumentIdentifier.create(uri);
const formattingOptions = getFormattingOptions();
Expand Down