Skip to content

Commit

Permalink
Changed snippits casings and changed colour of some error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
JPinkney committed Jun 21, 2017
1 parent f9926c0 commit ab9560f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 97 deletions.
Empty file modified client/.vscode/settings.json
100755 → 100644
Empty file.
84 changes: 0 additions & 84 deletions client/.vscode/snippets.json

This file was deleted.

22 changes: 11 additions & 11 deletions server/.vscode/snippits.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export let snippits = {
"Deployment": {
"prefix": "Deployment",
"deployment": {
"prefix": "deployment",
"body": [
"kind: Deployment",
"metadata:",
Expand All @@ -17,11 +17,11 @@ export let snippits = {
],
"description": "Generate deployment"
},
"Deployment Config": {
"prefix": "Deployment Config",
"deployment config": {
"prefix": "deployment config",
"body": [
"kind: DeploymentConfig",
"apiVersion: v1",
"kind: DeploymentConfig",
"metadata:",
" name: ${TM_FILENAME}",
"spec:",
Expand All @@ -39,8 +39,8 @@ export let snippits = {
],
"description": "Generate deployment config"
},
"Route": {
"prefix": "Route",
"route": {
"prefix": "route",
"body": [
"apiVersion: v1",
"kind: Route",
Expand All @@ -54,8 +54,8 @@ export let snippits = {
],
"description": "Generate route"
},
"Config Map": {
"prefix": "Config Map",
"config map": {
"prefix": "config map",
"body": [
"kind: ConfigMap",
"metadata:",
Expand All @@ -65,8 +65,8 @@ export let snippits = {
],
"description": "Generate config map"
},
"Persistent Volume Claim": {
"prefix": "Persistent Volume Claim",
"persistent volume claim": {
"prefix": "persistent volume claim",
"body": [
"kind: PersistentVolumeClaim",
"metadata:",
Expand Down
2 changes: 2 additions & 0 deletions server/src/SnippitSupport/snippit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export class snippitAutocompletor {
item.kind = CompletionItemKind.Snippet;
item.insertText = snippits[snip]["body"].join("\n").replace(/\$\{TM_FILENAME\}/g, this.uriToName(this.textDocument.uri));
item.detail = "vscode-k8s";
item.sortText = snippits[snip]["prefix"].substring(0, 5);
item.filterText = snippits[snip]["prefix"].substring(0, 5);
item.documentation = snippits[snip]["description"];
items.push(item);
});
Expand Down
4 changes: 2 additions & 2 deletions server/src/languageService/services/schemaValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class YAMLSChemaValidator extends ASTVisitor {
}else if(this.kuberSchema["childrenNodes"][element.key.value]){
this.errorHandler.addErrorResult(element, "Command \'" + element.key.value + "\' is not a root node", DiagnosticSeverity.Warning);
}else{
this.errorHandler.addErrorResult(element, "Command \'" + element.key.value + "\' is not found", DiagnosticSeverity.Warning);
this.errorHandler.addErrorResult(element, "Command \'" + element.key.value + "\' is not found", DiagnosticSeverity.Error);
}
});

Expand All @@ -55,7 +55,7 @@ export class YAMLSChemaValidator extends ASTVisitor {

//Error: If key not found
if(!this.kuberSchema["childrenNodes"][currentNode.key.value]){
this.errorHandler.addErrorResult(currentNode.key, "Command \'" + currentNode.key.value + "\' is not found", DiagnosticSeverity.Warning);
this.errorHandler.addErrorResult(currentNode.key, "Command \'" + currentNode.key.value + "\' is not found", DiagnosticSeverity.Error);
}

//Error: It did not validate correctly
Expand Down

0 comments on commit ab9560f

Please sign in to comment.