Visual Studio代码- R语言服务器

7y4bm7vi  于 8个月前  发布在  R语言
关注(0)|答案(1)|浏览(96)

我最近开始使用Visual Studio Code,并成功地将其安装在我的PC上。我按照Kun Ren的文章的所有描述:
https://renkun.me/2019/12/11/writing-r-in-vscode-a-fresh-start/
然而,当我启动VS Code时,我得到以下错误消息:
R语言服务器(5016)启动错误:在字符串中使用了“\U”,但没有十六进制数字,以“”C:\U”开头执行已停止R语言服务器(5016)已退出,退出代码为1
我的settings.json看起来像这样:

{
    "r.bracketedPaste": true,
    "r.rterm.windows": "C:\\Users\\AppData\\Roaming\\Python\\Python39\\Scripts\\radian.exe",
    "r.rpath.windows": "C:\\Program Files\\R\\R-4.0.5\\bin\\x64\\R.exe",
    "r.lsp.debug": true,
    "r.lsp.diagnostics": true,
    "r.sessionWatcher": true,
    "r.rterm.option": [
        "--no-save",
        "--no-restore",
        "--r-binary=C:\\Program Files\\R\\R-4.0.5\\bin\\x64\\R.exe"
    ],
}
mcdcgff0

mcdcgff01#

找到您的.Rprofile文件。里面应该有一行写着:

options(langserver_library = '<path to>\languageserver-library')

将反斜杠改为正斜杠,然后重新启动VS Code和R。

相关问题