我一直在我的MacBook Pro上使用VSC,但最近当我在VSC中打开.ml文件时,我已经开始在窗口的右下角收到一条消息,上面写着"无法在'ocamlmerlin'找到梅林二进制文件"。此外,在Output中,我得到以下内容:
Error: spawn ocamlmerlin ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
at onErrorNT (internal/child_process.js:465:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn ocamlmerlin',
path: 'ocamlmerlin',
spawnargs: []
}
[Error - 4:35:35 PM] Connection to server got closed. Server will not be restarted.
我还注意到标识编码错误的红色弯弯曲曲的线条已经不再出现了。还有人在VSC中见过这种错误吗?
- 根据您的平台,vs code的用户设置文件位于这里:
Windows%APPDATA%CodeUsersettings.json
.
macOS/Users/<YOUR-HOME-DIRECTORY>/Library/Application Support/Code/User/settings.json
.
Linux$HOME/.config/Code/User/settings.json
.
- 打开
settings.json
文件并粘贴以下内容:
{
"ocaml.merlinPath": "/Users/nick/.opam/system/bin/ocamlmerlin",
"reason.path.ocamlmerlin": "/Users/<YOUR-HOME-DIRECTORY>/.opam/system/bin/ocamlmerlin"
}