Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for redhat-developer/vscode-yaml#52 #35

Merged
merged 1 commit into from
Jan 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/languageService/parser/yamlParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,9 @@ function recursivelyBuildAst(parent: ASTNode, node: Yaml.YAMLNode): ASTNode {
new NullASTNode(parent, null, node.startPosition, node.endPosition);
}
case Yaml.Kind.INCLUDE_REF: {
// Issue Warning
console.log("Unsupported feature, node kind: " + node.kind);
break;
const result = new StringASTNode(parent, null, false, node.startPosition, node.endPosition);
result.value = node.value;
return result;
}
}
}
Expand Down
16 changes: 16 additions & 0 deletions test/schemaValidation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ suite("Validation Tests", () => {
}).then(done, done);
});

it('Include with value should not error', (done) => {
let content = `customize: !include customize.yaml`;
let validator = parseSetup(content);
validator.then(function(result){
assert.equal(result.length, 0);
}).then(done, done);
});

describe('Type tests', function(){

it('Type String does not error on valid node', (done) => {
Expand Down Expand Up @@ -204,6 +212,14 @@ suite("Validation Tests", () => {
}).then(done, done);
});

it('Include without value should error', (done) => {
let content = `customize: !include`;
let validator = parseSetup(content);
validator.then(function(result){
assert.equal(result.length, 1);
}).then(done, done);
});

});

});
Expand Down