Skip to content

Commit

Permalink
feat(yaml): implement onTypeFormattingEdits (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
remcohaszing authored Jun 11, 2024
1 parent f6c96ba commit 00e620d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/yaml/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ export function create({
},
definitionProvider: true,
diagnosticProvider: {},
documentOnTypeFormattingProvider: {
triggerCharacters: ['\n']
},
documentSymbolProvider: true,
hoverProvider: true,
documentLinkProvider: {},
Expand Down Expand Up @@ -149,6 +152,12 @@ export function create({
});
},

provideOnTypeFormattingEdits(document, position, key, options) {
return worker(document, () => {
return ls.doDocumentOnTypeFormatting(document, { ch: key, options, position, textDocument: document });
});
},

provideSelectionRanges(document, positions) {
return worker(document, () => {
return ls.getSelectionRanges(document, positions);
Expand Down

0 comments on commit 00e620d

Please sign in to comment.