diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index 6b6c9479ecf503634e8c4f586f0faf00eb5c131b..a4686e55d873283b301a6cf777bc17d5dcba7ddb 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -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. diff --git a/src/vs/workbench/api/node/extHostTypes.ts b/src/vs/workbench/api/node/extHostTypes.ts index 2089e4cc862af11788c5e86c06185655df65c359..8a4b6d205989f58ae9a65629258cdc7a2b82ed0a 100644 --- a/src/vs/workbench/api/node/extHostTypes.ts +++ b/src/vs/workbench/api/node/extHostTypes.ts @@ -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( locationOrUri, rangeOrContainer); } } diff --git a/src/vs/workbench/test/node/api/extHostTypes.test.ts b/src/vs/workbench/test/node/api/extHostTypes.test.ts index 652f5ef1fb41da5f258ee40477b9162d03707603..1c4e8856f0ceb143cfa5788e043fdc268c72f713 100644 --- a/src/vs/workbench/test/node/api/extHostTypes.test.ts +++ b/src/vs/workbench/test/node/api/extHostTypes.test.ts @@ -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); + }); }); \ No newline at end of file