admin管理员组文章数量:1400749
Describe the bug:
I use the R extension in VS Code and have been using the outline view for years (REdditorSupport). Now, the outline view when I use R in VS Code initially displays symbols (functions, sections) correctly when an R file is opened. However, once I add a new section header (e.g., # Testing ----), or add new code, the outline view disappears and shows "No symbols found in document". In the log, I see "[2025-03-24 10:24:21.630] document definitions found: 0".
This makes it difficult to navigate larger R scripts as the document structure is lost whenever I edit the file.
To Reproduce:
Open an R script that contains some functions and section headers (# Section name ----)
Observe that the outline view correctly shows these symbols
Add a new section header (e.g., type # Testing ----)
Observe that the outline view now shows "No symbols found in document"
The only way to temporarily restore the outline is to close and reopen the file
Can you fix this issue by yourself?
No
settings.json:
{
"files.autoSave": "off",
"terminal.integrated.inheritEnv": false,
"explorer.autoReveal": false,
"git.autofetch": true,
"r.plot.useHttpgd": false,
// "r.rterm.mac": "/opt/homebrew/bin/R",
"r.rterm.mac": "/my/radian/path", // note that this is different than r.rterm.mac
"r.bracketedPaste": true,
"r.rterm.option": ["--no-save", "--no-restore"],
"terminal.integrated.env.osx": {
"R_HOME": "/opt/homebrew/Cellar/r/4.4.3/lib/R"
},
"r.rpath.mac": "/opt/homebrew/bin/R",
"files.exclude": {
"**/.gitattributes": true,
"**/.gitignore": true,
"**/.vscode": true
},
"settingsSync.ignoredExtensions": [],
"workbench.editor.openSideBySideDirection": "right",
"git.enableSmartCommit": true,
"git.confirmSync": false,
"editor.minimap.showSlider": "always",
"editor.find.autoFindInSelection": "always",
"git.postCommitCommand": "sync",
"git.showPushSuccessNotification": true,
"outline.collapseItems": "alwaysCollapse",
"r.alwaysUseActiveTerminal": true,
"notebook.editorOptionsCustomizations": {},
"notebook.output.scrolling": "force inline",
"terminal.integrated.shellIntegration.suggestEnabled": true,
"github.copilot.editor.enableAutoCompletions": true,
"terminal.integrated.profiles.osx": {
"bash": {
"path": "bash",
"args": ["-l"],
"icon": "terminal-bash"
},
"zsh": {
"path": "zsh",
"args": ["-l"]
},
"fish": {
"path": "fish",
"args": ["-l"]
},
"tmux": {
"path": "tmux",
"icon": "terminal-tmux"
},
"pwsh": {
"path": "pwsh",
"icon": "terminal-powershell"
}
},
"terminal.integrated.defaultProfile.osx": "zsh",
"interactiveWindow.executeWithShiftEnter": true,
"jupyter.interactiveWindow.textEditor.executeSelection": true,
"python.terminal.executeInFileDir": true,
"python.dataScience.sendSelectionToInteractiveWindow": true,
"python.dataScience.showCellInputCode": false,
"python.dataScience.textOutputLimit": 500,
"python.dataScience.notebookFileRoot": "${workspaceFolder}",
"macros": {
"runAndMoveCursor": [
"python.execSelectionInInteractiveWindow",
"cursorMove"
]
},
"workbench.editor.splitInGroupLayout": "vertical",
"r.session.viewers.viewColumn": {
"view": "Active",
"plot": "Active",
"viewer": "Active"
},
"workbench.editorAssociations": {
"*.csv": "gc-excelviewer-csv-editor"
},
"editor.codeActionsOnSave": {
"source.fixAll": "never"
},
"editor.formatOnSave": false,
"editor.formatOnType": false,
"r.linting.enabled": false,
"python.linting.enabled": false,
"eslint.enable": false,
"r.lsp.enabled": true,
"r.lsp.diagnostics": true,
"r.lsp.debug": true,
"r.sessionWatcher": true,
"files.associations": {
"*.rmd": "markdown"
},
"workbench.secondarySideBar.showLabels": false
}
Expected behavior:
The outline view should remain functional and continue to display all symbols even after editing the file or adding new section headers.
Environment:
OS: macOS
VSCode Version: 1.98.2
R Version: 4.4.3
vscode-R version: 2.8.4
Additional context:
I've tried reinstalling the R extension, the languageserver package, and configuring the language server settings, but the issue persists. The outline view works correctly with other file types (e.g., Python) but consistently breaks when editing R files.
I've tried reinstalling the R extension, the languageserver package, and configuring the language server settings, but the issue persists. The outline view works correctly with other file types (e.g., Python) but consistently breaks when editing R files.
Expected behavior:
The outline view should remain functional and continue to display all symbols even after editing the file or adding new section headers.
本文标签:
版权声明:本文标题:visual studio code - VSCode R: Outline view disappears after adding new section headers in R scripts - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744251833a2597288.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论