This repository was archived by the owner on Apr 14, 2022. It is now read-only.
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
Implement auto indentation when pressing the :
or Enter
keys #671
Closed
Description
- Today indentation of code is implemented within the extension (and buggy, as we do not have the token/AST information, etc)
- The C# extension supports similar features (indentation changes) when you type the character
}
.- The C# extension is TS code, that sends requests to a .NET process over a protocol.
- I.e. .NET is performing the necessary formatting, and sending back the formatted code (asynchronously) back to the TS code.
- We need the same thing, when users type the character
:
.- I.e. TS can send a custom request to language server, get the response back and send formatted code to VSC.
I.e. if C# extension (using the .NET code, async communication via a protocol) can do this, then how about we do the same thing (using LSP over custom request).
export async function formatAfterKeystroke(server: OmniSharpServer, request: protocol.FormatAfterKeystrokeRequest, token: vscode.CancellationToken) {
https://github.com/OmniSharp/omnisharp-vscode/blob/f0a0336ced8cb44f78bdee88120bfe9d62a596c0/src/omnisharp/utils.ts#L42
Related to microsoft/vscode-python#481
Metadata
Metadata
Assignees
Labels
No labels