mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 03:54:24 +01:00
Fix a few more edge cases for references code lens
This commit is contained in:
@@ -148,11 +148,11 @@ export default class TypeScriptReferencesCodeLensProvider implements CodeLensPro
|
||||
case PConst.Kind.enum:
|
||||
const identifierMatch = new RegExp(`^(.*?(\\b|\\W))${item.text}\\b`, 'gm');
|
||||
const match = identifierMatch.exec(text);
|
||||
const start = match ? match.index + match[1].length : 0;
|
||||
const startPosition = new Position(range.start.line, range.start.character + start);
|
||||
const prefixLength = match ? match.index + match[1].length : 0;
|
||||
const startOffset = document.offsetAt(new Position(range.start.line, range.start.character)) + prefixLength;
|
||||
results.push(new Range(
|
||||
startPosition,
|
||||
document.positionAt(document.offsetAt(startPosition) + item.text.length)));
|
||||
document.positionAt(startOffset),
|
||||
document.positionAt(startOffset + item.text.length)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user