开发vscode插件,怎么实现选中编辑中某个变量呢?

比例想编辑中let name = 'Tom'中的name选中飘红,应该咋做呢?
网上只查到这个代码~~

let decorationType = vscode.window.createTextEditorDecorationType({
            outline: '#00FF00 dotted'
        });
        let editor = vscode.window.activeTextEditor;
        editor.setDecorations(decorationType, [new vscode.Range(5, 1, 1, 4)]);
阅读 1.4k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题