安装VS Code拓展LTeX – LanguageTool grammar/spell checking后,
报错:
Could not run ltex-ls with Java, please see the output panel 'LTeX Language Client' for details. You might want to try offline installation.
解决方法:
- 打开文件
C:\Users\%USERPROFILE%\.vscode\extensions\valentjn.vscode-ltex-13.1.0\dist\extension.js
- 通过关键词搜索定位,进行如下4处改动
const executable = yield this.getLtexLsExecutable();
if (executable.args == null)
executable.args = [];
executable.args.push('--version');
const executableOptions = {
encoding: 'utf-8',
timeout: 15000,
+ shell: true
};
static getDebugServerOptions() {
const executableOptions = {
encoding: 'utf-8',
timeout: 15000,
+ shell: true
};
- const execOptions = Object.create(null);
+ const execOptions = {
+ shell: true
+ };
elseif (Executable.is(json) && json.command) {
let command = json;
let args = command.args || [];
let options = Object.assign({}, command.options);
options.cwd = options.cwd || serverWorkingDir;
+ options.shell = true;
参考链接: https://github.com/valentjn/vscode-ltex/issues/884#issuecomment-2263630384