mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 19:44:25 +01:00
fix #12688
This commit is contained in:
@@ -113,22 +113,12 @@ class DefinitionAdapter {
|
||||
let pos = TypeConverters.toPosition(position);
|
||||
return asWinJsPromise(token => this._provider.provideDefinition(doc, pos, token)).then(value => {
|
||||
if (Array.isArray(value)) {
|
||||
return value.map(DefinitionAdapter._convertLocation);
|
||||
return value.map(TypeConverters.location.from);
|
||||
} else if (value) {
|
||||
return DefinitionAdapter._convertLocation(value);
|
||||
return TypeConverters.location.from(value);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static _convertLocation(location: vscode.Location): modes.Location {
|
||||
if (!location) {
|
||||
return;
|
||||
}
|
||||
return <modes.Location>{
|
||||
uri: location.uri,
|
||||
range: TypeConverters.fromRange(location.range)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
class HoverAdapter {
|
||||
@@ -208,17 +198,10 @@ class ReferenceAdapter {
|
||||
|
||||
return asWinJsPromise(token => this._provider.provideReferences(doc, pos, context, token)).then(value => {
|
||||
if (Array.isArray(value)) {
|
||||
return value.map(ReferenceAdapter._convertLocation);
|
||||
return value.map(TypeConverters.location.from);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static _convertLocation(location: vscode.Location): modes.Location {
|
||||
return <modes.Location>{
|
||||
uri: location.uri,
|
||||
range: TypeConverters.fromRange(location.range)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
class QuickFixAdapter {
|
||||
|
||||
Reference in New Issue
Block a user