Skip to content

Commit

Permalink
Merge pull request #179 from redhat-developer/fixDocumentFormattingOn…
Browse files Browse the repository at this point in the history
…Paste

Remove document formatting range registration and make formatting wor…
  • Loading branch information
JPinkney authored Sep 13, 2019
2 parents 576241a + ca40f01 commit 03af2f8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import {
createConnection, IConnection, TextDocuments, TextDocument, InitializeParams, InitializeResult,
Disposable, ProposedFeatures, CompletionList, DocumentRangeFormattingRequest, ClientCapabilities, WorkspaceFolder
Disposable, ProposedFeatures, CompletionList, ClientCapabilities, WorkspaceFolder, DocumentFormattingRequest
} from 'vscode-languageserver';

import { xhr, XHRResponse, configure as configureHttpRequests } from 'request-light';
Expand Down Expand Up @@ -355,7 +355,7 @@ connection.onInitialize((params: InitializeParams): InitializeResult => {
completionProvider: { resolveProvider: true },
hoverProvider: true,
documentSymbolProvider: true,
documentFormattingProvider: true,
documentFormattingProvider: false,
documentRangeFormattingProvider: false
}
};
Expand Down Expand Up @@ -443,10 +443,9 @@ connection.onDidChangeConfiguration(change => {

if (enableFormatter) {
if (!formatterRegistration) {
formatterRegistration = connection.client.register(DocumentRangeFormattingRequest.type, {
formatterRegistration = connection.client.register(DocumentFormattingRequest.type, {
documentSelector: [
{ language: 'yaml', scheme: 'file' },
{ language: 'yaml', scheme: 'untitled' }
{ language: 'yaml' }
]
});
}
Expand Down

0 comments on commit 03af2f8

Please sign in to comment.