vscode-yaml-languageservice
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -19,9 +19,10 @@ (function (factory) { | ||
jsyaml.loadAll(text, doc => documents.push(doc)); | ||
const dumpOptions = { indent: options.tabSize, noCompatMode: true }; | ||
let newText; | ||
if (documents.length == 1) { | ||
const yaml = documents[0]; | ||
newText = jsyaml.safeDump(yaml, { indent: options.tabSize }); | ||
newText = jsyaml.safeDump(yaml, dumpOptions); | ||
} | ||
else { | ||
const formatted = documents.map(d => jsyaml.safeDump(d, { indent: options.tabSize })); | ||
const formatted = documents.map(d => jsyaml.safeDump(d, dumpOptions)); | ||
newText = '%YAML 1.2' + os_1.EOL + '---' + os_1.EOL + formatted.join('...' + os_1.EOL + '---' + os_1.EOL) + '...' + os_1.EOL; | ||
@@ -28,0 +29,0 @@ } |
@@ -18,3 +18,2 @@ import { TextDocument, Position, CompletionItem, CompletionList, Hover, Range, SymbolInformation, Diagnostic, TextEdit, FormattingOptions, MarkedString } from 'vscode-languageserver-types'; | ||
findDocumentSymbols(document: TextDocument, doc: YAMLDocument): SymbolInformation[]; | ||
findColorSymbols(document: TextDocument, doc: YAMLDocument): Thenable<Range[]>; | ||
doHover(document: TextDocument, position: Position, doc: YAMLDocument): Thenable<Hover>; | ||
@@ -21,0 +20,0 @@ format(document: TextDocument, options: FormattingOptions): TextEdit[]; |
@@ -69,3 +69,2 @@ (function (factory) { | ||
findDocumentSymbols: jsonDocumentSymbols.findDocumentSymbols.bind(jsonDocumentSymbols), | ||
findColorSymbols: jsonDocumentSymbols.findColorSymbols.bind(jsonDocumentSymbols), | ||
doHover: jsonHover.doHover.bind(jsonHover), | ||
@@ -72,0 +71,0 @@ format: yamlFormatter_1.format |
{ | ||
"name": "vscode-yaml-languageservice", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "Language service for YAML", | ||
@@ -5,0 +5,0 @@ "main": "./lib/yamlLanguageService.js", |
56598
1058