Allow formatting service to ignore the OnTypeFormatting option #8372
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This was a lot more complicated than I thought, so after chatting with @ryzngard this is taking the easy way out, since the hard way would require big changes to formatting.
With this change the actual formatting service doesn't check the on type formatting setting, just the LSP endpoints do, with this PR specifically adding that check to the auto insert endpoint. This means the setting will also turn off XML doc comment completion, but I think thats a reasonable compromise for now. It also means the setting has no effect if Single Server is turned off, but we have no reason to think anyone has done that anyway.
There is a comment explaining that, and a bit more, in the code.
Closes #4336
@phil-allen-msft I think we should take this for M2