提交 b2a424bf 编写于 作者: J Johannes Rieken

deprecate old ctor but keep it working

上级 de5800af
...@@ -1748,6 +1748,8 @@ declare namespace vscode { ...@@ -1748,6 +1748,8 @@ declare namespace vscode {
constructor(name: string, kind: SymbolKind, containerName: string, location: Location); constructor(name: string, kind: SymbolKind, containerName: string, location: Location);
/** /**
* @deprecated Please use the constructor taking a [location](#Location) object.
*
* Creates a new symbol information object. * Creates a new symbol information object.
* *
* @param name The name of the symbol. * @param name The name of the symbol.
......
...@@ -641,8 +641,8 @@ export class SymbolInformation { ...@@ -641,8 +641,8 @@ export class SymbolInformation {
if (locationOrUri instanceof Location) { if (locationOrUri instanceof Location) {
this.location = locationOrUri; this.location = locationOrUri;
} else if(locationOrUri instanceof URI && rangeOrContainer instanceof Range) { } else if (rangeOrContainer instanceof Range) {
this.location = new Location(locationOrUri, rangeOrContainer); this.location = new Location(<URI> locationOrUri, rangeOrContainer);
} }
} }
......
...@@ -409,4 +409,11 @@ suite('ExtHostTypes', function () { ...@@ -409,4 +409,11 @@ suite('ExtHostTypes', function () {
assertToJSON(item, { label: 'complete', kind: 'Interface' }); assertToJSON(item, { label: 'complete', kind: 'Interface' });
}); });
test('SymbolInformation, old ctor', function () {
let info = new types.SymbolInformation('foo', types.SymbolKind.Array, new types.Range(1, 1, 2, 3));
assert.ok(info.location instanceof types.Location);
assert.equal(info.location.uri, undefined);
});
}); });
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册