mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-03 15:01:57 +01:00
@@ -109,16 +109,17 @@ export abstract class TypeScriptBaseCodeLensProvider implements CodeLensProvider
|
||||
|
||||
(item.childItems || []).forEach(child => this.walkNavTree(document, child, item, results));
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: TS currently requires the position for 'references 'to be inside of the identifer
|
||||
* Massage the range to make sure this is the case
|
||||
*/
|
||||
protected getSymbolRange(document: TextDocument, item: Proto.NavigationTree): Range | null {
|
||||
if (!item) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// TS 3.0+ provides a span for just the symbol
|
||||
if ((item as any).nameSpan) {
|
||||
return typeConverters.Range.fromTextSpan((item as any).nameSpan);
|
||||
}
|
||||
|
||||
// In older versions, we have to calculate this manually. See #23924
|
||||
const span = item.spans && item.spans[0];
|
||||
if (!span) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user