deprecate old ctor but keep it working
This commit is contained in:
parent
de5800af31
commit
b2a424bf31
2
src/vs/vscode.d.ts
vendored
2
src/vs/vscode.d.ts
vendored
|
@ -1748,6 +1748,8 @@ declare namespace vscode {
|
|||
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.
|
||||
*
|
||||
* @param name The name of the symbol.
|
||||
|
|
|
@ -641,8 +641,8 @@ export class SymbolInformation {
|
|||
|
||||
if (locationOrUri instanceof Location) {
|
||||
this.location = locationOrUri;
|
||||
} else if(locationOrUri instanceof URI && rangeOrContainer instanceof Range) {
|
||||
this.location = new Location(locationOrUri, rangeOrContainer);
|
||||
} else if (rangeOrContainer instanceof Range) {
|
||||
this.location = new Location(<URI> locationOrUri, rangeOrContainer);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -409,4 +409,11 @@ suite('ExtHostTypes', function () {
|
|||
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);
|
||||
});
|
||||
});
|
Loading…
Reference in a new issue