mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
[html] Format document create tab identities. Fixes #13563
This commit is contained in:
parent
04d334b1db
commit
cf02de829d
|
@ -4,7 +4,7 @@
|
|||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { createConnection, IConnection, TextDocuments, InitializeParams, InitializeResult } from 'vscode-languageserver';
|
||||
import { createConnection, IConnection, TextDocuments, InitializeParams, InitializeResult, FormattingOptions } from 'vscode-languageserver';
|
||||
|
||||
import { HTMLDocument, getLanguageService, CompletionConfiguration, HTMLFormatConfiguration, DocumentContext } from 'vscode-html-languageservice';
|
||||
import { getLanguageModelCache } from './languageModelCache';
|
||||
|
@ -97,7 +97,7 @@ function merge(src: any, dst: any): any {
|
|||
return dst;
|
||||
}
|
||||
|
||||
function getFormattingOptions(formatParams: any) {
|
||||
function getFormattingOptions(formatParams: FormattingOptions) {
|
||||
let formatSettings = languageSettings && languageSettings.format;
|
||||
if (!formatSettings) {
|
||||
return formatParams;
|
||||
|
@ -107,12 +107,12 @@ function getFormattingOptions(formatParams: any) {
|
|||
|
||||
connection.onDocumentFormatting(formatParams => {
|
||||
let document = documents.get(formatParams.textDocument.uri);
|
||||
return languageService.format(document, null, getFormattingOptions(formatParams));
|
||||
return languageService.format(document, null, getFormattingOptions(formatParams.options));
|
||||
});
|
||||
|
||||
connection.onDocumentRangeFormatting(formatParams => {
|
||||
let document = documents.get(formatParams.textDocument.uri);
|
||||
return languageService.format(document, formatParams.range, getFormattingOptions(formatParams));
|
||||
return languageService.format(document, formatParams.range, getFormattingOptions(formatParams.options));
|
||||
});
|
||||
|
||||
connection.onDocumentLinks(documentLinkParam => {
|
||||
|
|
Loading…
Reference in a new issue