尝试适配Windows

This commit is contained in:
zhbaor 2025-02-07 22:24:11 +08:00
parent 9335308973
commit 5199bada00

View file

@ -29,13 +29,6 @@ function activate(context) {
if (!type_list.includes("Res")) return;
const code_line = document.lineAt(position).text;
const res_range = document.getWordRangeAtPosition(position, /".*?"/);
// let start, end;
// for (start = position.character; start >= 0; --start)
// if (code_line.charAt(start) == '"') break;
// for (end = position.character; end < code_line.length; ++end)
// if (code_line.charAt(end) == '"') break;
// let res = code_line.substring(start + 1, end);
// console.log(document.getWordRangeAtPosition(position, /".*?"/));
let res = code_line.substring(
res_range.start.character + 1,
res_range.end.character - 1
@ -46,7 +39,7 @@ function activate(context) {
vscode.workspace.workspaceFolders[0].uri.path,
"mower",
"resources",
res
...res.split("/")
);
const md = new vscode.MarkdownString(`![](file://${img_path})`);
return new vscode.Hover(md);