Skip to content

fix extra whitespace insertion for text edits#77071

Merged
dibarbet merged 1 commit intodotnet:mainfrom
dibarbet:completion_whitespace
Feb 6, 2025
Merged

fix extra whitespace insertion for text edits#77071
dibarbet merged 1 commit intodotnet:mainfrom
dibarbet:completion_whitespace

Conversation

@dibarbet
Copy link
Copy Markdown
Member

@dibarbet dibarbet commented Feb 5, 2025

fixes issue where whitespace gets added twice for completion items that have upfront text edits.

@dibarbet dibarbet requested a review from a team as a code owner February 5, 2025 23:12
@ghost ghost added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Feb 5, 2025
Data = capabilityHelper.SupportCompletionListData ? resolveData : null
Data = capabilityHelper.SupportCompletionListData ? resolveData : null,
// By default, all text edits we create include the appropriate whitespace, so tell the client to leave it as-is.
InsertTextMode = LSP.InsertTextMode.AsIs,
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.

InsertTextMode

Would it make sense to conditionally set this based on whether the capabilityHelper indicated insertTextModeSupport is supported?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

accidentally force pushed, but fixed

Data = capabilityHelper.SupportCompletionListData ? resolveData : null
Data = capabilityHelper.SupportCompletionListData ? resolveData : null,
// By default, all text edits we create include the appropriate whitespace, so tell the client to leave it as-is.
InsertTextMode = LSP.InsertTextMode.AsIs,
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.

InsertTextMode = LSP.InsertTextMode.AsIs,

could consider adding a test validating this is set

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

accidentally force pushed, but fixed

@dibarbet dibarbet force-pushed the completion_whitespace branch from 6072e58 to bd44932 Compare February 5, 2025 23:59
Copy link
Copy Markdown
Contributor

@ToddGrun ToddGrun left a comment

Choose a reason for hiding this comment

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

:shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead VSCode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants