Skip to content

Commit

Permalink
Fixes #1430: Unspecified client behavior: textDocument/onTypeFormatting
Browse files Browse the repository at this point in the history
  • Loading branch information
dbaeumer committed Mar 31, 2022
1 parent f4c158e commit 1e19ebf
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions _specifications/lsp/3.17/language/onTypeFormatting.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ _Server Capability_:
```typescript
export interface DocumentOnTypeFormattingOptions {
/**
* A character on which formatting should be triggered, like `}`.
* A character on which formatting should be triggered, like `{`.
*/
firstTriggerCharacter: string;

Expand Down Expand Up @@ -54,14 +54,30 @@ _Request_:
<div class="anchorHolder"><a href="#documentOnTypeFormattingParams" name="documentOnTypeFormattingParams" class="linkableAnchor"></a></div>

```typescript
interface DocumentOnTypeFormattingParams extends TextDocumentPositionParams {
interface DocumentOnTypeFormattingParams {

/**
* The document to format.
*/
textDocument: TextDocumentIdentifier;

/**
* The position around which the on type formatting should happen.
* This is not necessarily the exact position where the character denoted
* by the property `ch` got typed.
*/
position: Position;

/**
* The character that has been typed.
* The character that has been typed that triggered the formatting
* on type request. That is not necessarily the last character that
* got inserted into the document since the client could auto insert
* characters as well (e.g. like automatic brace completion).
*/
ch: string;

/**
* The format options.
* The formatting options.
*/
options: FormattingOptions;
}
Expand Down

0 comments on commit 1e19ebf

Please sign in to comment.