Skip to content

Commit

Permalink
Add full support for Diagnostic.code
Browse files Browse the repository at this point in the history
Updated the framework to have full support according to the VS Code API
  • Loading branch information
Estelle Foisy committed Oct 13, 2022
1 parent 3794302 commit 76d6d1a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions packages/plugin-ext/src/plugin/type-converters.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -449,12 +449,12 @@ describe('Type converters:', () => {
assert.strictEqual(Converter.convertCode(undefined), undefined);
});
it('should convert a "code" of type "{ value: number, target: Uri }"', () => {
const Uri = types.URI.parse('foo://example.com:8042/over/there?name=ferret#nose');
assert.strictEqual(Converter.convertCode({ value: 4, target: Uri }), '4');
const uri = types.URI.parse('foo://example.com:8042/over/there?name=ferret#nose');
assert.strictEqual(Converter.convertCode({ value: 4, target: uri }), '4');
});
it('should convert a "code" of type "{ value: number, target: Uri }"', () => {
const Uri = types.URI.parse('foo://example.com:8042/over/there?name=ferret#nose');
assert.strictEqual(Converter.convertCode({ value: 'string', target: Uri }), 'string');
const uri = types.URI.parse('foo://example.com:8042/over/there?name=ferret#nose');
assert.strictEqual(Converter.convertCode({ value: 'string', target: uri }), 'string');
});
});
});
2 changes: 1 addition & 1 deletion packages/plugin-ext/src/plugin/type-converters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ export function convertCode(code: string | number | { value: string | number; ta
if (typeof code === 'string' || typeof code === 'undefined') {
return code;
} else {
return code = String(code.value);
return String(code.value);
};
}

Expand Down

0 comments on commit 76d6d1a

Please sign in to comment.