Skip to content

Commit

Permalink
Merge pull request #35 from redhat-developer/include-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
JPinkney authored Jan 15, 2018
2 parents a6cfe46 + 0aa3a5b commit 04d79d5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
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

0 comments on commit 04d79d5

Please sign in to comment.