【发布时间】:2021-04-10 12:14:42
【问题描述】:
我已经 fork 了一个 VSCode 扩展,并想对其进行修改以获得一些经验。
我想做的改变包括从this script(#1) 访问104 行的变量word 并在this script(#2) 中使用它。
我相信这可能涉及将 #1 导入到 #2 中,这就是我目前所拥有的......
import { ConfigKey, Global } from '../common/global';
import { Process } from '../common/processWrapper';
import { AhkHoverProvider } from '../providers/ahkHoverProvider';
export class HelpService {
public static open(): void {
var command = word; // access 'word' from AhkHoverProvider
const helpPath = Global.getConfig(ConfigKey.helpPath);
const commandPath = command ? '::/docs/commands/' + command + '.htm' : '';
// Process.exec(`C:/Windows/hh.exe ${helpPath}`);
Process.exec(`C:/Windows/hh.exe ms-its:` + helpPath + commandPath);
}
}
我尝试阅读 TypeScript 类和导出/导入的示例,但不知道如何进行。
【问题讨论】:
标签: typescript vscode-extensions