To change a setting for one editor, send it in that client's R language server configuration. For example, this LSP configuration asks for inline signatures and value previews in the completion list.
Details
These tables describe the workspace server started by run(). For the diagnostics
controls supported by run_embedded() and its host-supplied package context, see
the embedded host guide.
Clients use different configuration files. In VS Code's settings.json, the
corresponding key is "r.lsp.completion_label_details". To set the same value in R, put
the following in an .Rprofile read by the server's R process, then restart the
language server.
options(languageserver.completion_label_details = TRUE)An explicit languageserver.* R option takes precedence over the corresponding workspace
setting. The entries below give the key after r.lsp. or languageserver., its default
as an R value, and its effect.
Completion, help, and the outline
member_completionTRUE. Infer members such asobj$fieldand S4 slots such asobj@slot. Also supplies member arguments, signatures, hover help, and definitions where the source is known.s3_dispatchTRUE. Use inferred S3 methods for argument suggestions, signature help, and hover. Can be set independently of member completion.roxygen_type_hintsTRUE. Use leading type markers in source roxygen comments to infer members and S3 dispatch. Changing this setting leaves ordinary inference from code available.roxygen_advisory_type_hintsFALSE. When roxygen type hints are enabled, also use verified Markdown class links and recognized class descriptions to suggest members. S3 dispatch and annotation Rename require explicit markers. See the roxygen type hints guide.snippet_supportTRUE. Insert supported completions as snippets in clients that accept them.completion_label_detailsFALSE. Show signatures and type or value previews alongside suggestions in clients that display label details. Selected-item details also work with the default.max_completions200. Maximum number of suggestions to return.rich_documentationTRUE. Render installed-package help as rich Markdown whenrmarkdownand Pandoc are available. Otherwise the server uses text help.inlay_hints_minimum_arguments2L. Minimum number of supplied arguments for a call to show parameter-name hints.inlay_hints_minimum_argument_length2L. Minimum number of characters in a parameter name for a hint. An initial dot is excluded.nline_to_break_succession2L. Number of consecutive blank lines that separate section groups in the outline and folding ranges.glue_highlightingTRUE. Use semantic tokens to color embedded R in recognized glue templates.glue_highlight_functionslist(). Customize highlighting by exact call spelling. Set its value to the position of an unnamed template argument (starting at 1), a named argument, orFALSEto disable highlighting for that spelling.link_file_size_limit16777216. Maximum size in bytes (16 MiB) of the target file when resolving a document link.
Diagnostics and formatting
diagnosticsTRUE. Publish diagnostics from the selected linter.diagnostics_backend"lintr". Selectlintrorjarlfor diagnostics.formatting_backend"styler". Selectstylerorairfor formatting.backend_optionslist(). Per-backend overrides for the executable, timeout in seconds (10 by default), and named environment variables.lint_cacheFALSE. Allow lintr to cache results for files on disk.diagnostics_cache_ttl5. Seconds the server can reuse matching diagnostics in memory. Set to0to disable reuse.diagnostics_delay0.75. Seconds to wait before linting after a parse.parse_delay0.15. Seconds to wait before parsing after a text change.diagnostics_cache_max_mb16. Memory budget in MiB for a workspace's diagnostics cache.parse_cache_max_mb64. Memory budget in MiB for a workspace's cached document parses.
The server creates the two memory budgets when it opens a workspace. Set them in the server's R profile before opening the project. For installation commands and the formatting modes available with each backend, see Diagnose and format code. To supply an R function as the formatting style or a custom backend, see Custom styles and adapters.
Workspace indexing
index_mode"auto".autoselectsfullin a package andlazyin a script folder.fulldiscovers files across the workspace.lazystarts with open files and their static source dependencies.offdisables workspace indexing and uses the legacy package-loading behavior.project_helperslist(). Map caller globs to workspace-relative helper filenames for Go to Definition. Requires an active workspace index.index_include"**/*.R". Workspace-relative glob or list of globs to include. Matching ignores case.index_excludec("**/.git/**", "**/.svn/**", "**/.hg/**", "**/renv/**", "**/packrat/**", "**/.Rproj.user/**", "**/.cache/**", "**/node_modules/**", "**/build/**", "**/dist/**"). Workspace-relative glob or list of globs to exclude.index_max_files10000L. Maximum number of eligible R files discovered per workspace.index_max_file_size_mb2. Maximum size in MiB of each file included in the index.index_batch_size20L. Maximum number of shallow file summaries to build in one idle batch.index_time_budget_ms25. Approximate time budget in milliseconds for each batch.index_persistent_cacheTRUE. Save validated summaries from a full index on disk. Lazy indexes live in memory.
Package metadata and rendered help use a separate disk cache rooted at
tools::R_user_dir("languageserver", "cache"). Set the R option
languageserver.package_cache_dir to a directory or to FALSE to disable this cache.
The environment variable R_LANGSVR_PACKAGE_CACHE_DIR can set the directory when the R
option is absent. If metadata workers time out on a slow machine, set
R_LANGSVR_TIMEOUT_SCALE to a multiplier such as 3 to give them more time.
Logging and client capabilities
debugFALSE. Log details about startup and server activity.traceFALSE. Include protocol trace output. A client can also change tracing during a session.log_fileNULL. Write logs to standard error by default. Supply a path to append to a file.server_capabilitieslist(). Override individual entries in the capabilities advertised to the client. See Client capabilities.