Skip to content

Commit

Permalink
Merge pull request #13 from adamvoss/noLegacyFormatting
Browse files Browse the repository at this point in the history
Update vscode-yaml-languageservice and set version to 0.0.9
  • Loading branch information
adamvoss authored Sep 9, 2017
2 parents 6fcb474 + 1a29225 commit 7b6097a
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 20 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## 0.0.9
- Update **vscode-yaml-languageservice** to 0.2.0
- Disables legacy (pre-1.2) YAML compatibility when formatting. This gives cleaner results in some files (like `.travis.yml`) where this extension may have been forcing unnecessary escaping (quoting).
- Removes the (never-working) color symbol support

## 0.0.8
- Update **vscode-json-languageservice** to the current latest version (2.0.14) by updating **vscode-yaml-languageservice**.
- **vscode-yaml-languageservice** dependency is now managed by `npm`. This makes development easier.
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ Schemas are handled exactly [same way they are with JSON in Visual Studio Code](

## Known Issues
- No support has been implemented for include references. ([relevant code](https://github.com/adamvoss/vscode-yaml-languageservice/blob/9199669d241f8fb5fde801399c4cd5abd0bc6d52/src/parser/yamlParser.ts#L243-L247))
- Color decorators (`yaml.colorDecorators.enable`) do not work even when enabled.

## Acknowledgments
This extension would not have been possible without numerous open source projects. Please see [ACKNOWLEDGMENTS.md](ACKNOWLEDGMENTS.md).
Expand Down
2 changes: 1 addition & 1 deletion client/src/yamlMain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export function activate(context: ExtensionContext) {
return client.sendRequest(ColorSymbolRequest.type, uri).then(ranges => ranges.map(client.protocol2CodeConverter.asRange));
};
let isDecoratorEnabled = (languageId: string) => {
return workspace.getConfiguration().get<boolean>(languageId + '.colorDecorators.enable');
return false;
};
disposable = activateColorDecorations(colorRequestor, { yaml: true }, isDecoratorEnabled);
context.subscriptions.push(disposable);
Expand Down
9 changes: 2 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "yaml",
"displayName": "YAML",
"description": "YAML for Visual Studio Code",
"version": "0.0.8",
"version": "0.0.9",
"publisher": "adamvoss",
"license": "MIT",
"repository": {
Expand Down Expand Up @@ -36,11 +36,6 @@
"configuration": {
"title": "YAML",
"properties": {
"yaml.colorDecorators.enable": {
"type": "boolean",
"default": false,
"description": "%yaml.colorDecorators.enable.desc%"
},
"yaml.format.enable": {
"type": "boolean",
"default": true,
Expand All @@ -50,7 +45,7 @@
}
},
"dependencies": {
"vscode-languageclient": "^3.1.0-alpha.1",
"vscode-languageclient": "~3.3",
"vscode-nls": "^2.0.2"
},
"devDependencies": {
Expand Down
1 change: 0 additions & 1 deletion package.nls.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"yaml.colorDecorators.enable.desc": "Enables or disables color decorators",
"yaml.format.enable.desc": "Enable/disable default YAML formatter (requires restart)"
}
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"request-light": "^0.2.1",
"vscode-languageserver": "^3.1.0-alpha.1",
"vscode-nls": "^2.0.2",
"vscode-yaml-languageservice": "^0.1.0"
"vscode-yaml-languageservice": "^0.2.0"
},
"devDependencies": {
"@types/node": "^6.0.51"
Expand Down
9 changes: 0 additions & 9 deletions server/src/yamlServerMain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,14 +322,5 @@ connection.onDocumentFormatting(formatParams => {
return languageService.format(document, formatParams.options);
});

connection.onRequest(ColorSymbolRequest.type, uri => {
let document = documents.get(uri);
if (document) {
let jsonDocument = getJSONDocument(document);
return languageService.findColorSymbols(document, jsonDocument);
}
return [];
});

// Listen on the connection
connection.listen();

0 comments on commit 7b6097a

Please sign in to comment.