提交 8178df7a 编写于 作者: M Matt Bierner 提交者: Dirk Baeumer

Fix ts/js code lens for trailing special character. Fixes #27211

上级 ed9cdf55
......@@ -108,7 +108,7 @@ export abstract class TypeScriptBaseCodeLensProvider implements CodeLensProvider
const text = document.getText(range);
const identifierMatch = new RegExp(`^(.*?(\\b|\\W))${(item.text || '').replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')}\\b`, 'gm');
const identifierMatch = new RegExp(`^(.*?(\\b|\\W))${(item.text || '').replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')}(\\b|\\W)`, 'gm');
const match = identifierMatch.exec(text);
const prefixLength = match ? match.index + match[1].length : 0;
const startOffset = document.offsetAt(new Position(range.start.line, range.start.character)) + prefixLength;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册