aboutsummaryrefslogtreecommitdiffstats
path: root/lsp/robotcode.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lsp/robotcode.lua')
-rw-r--r--lsp/robotcode.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/lsp/robotcode.lua b/lsp/robotcode.lua
index a30722e0..7e78a342 100644
--- a/lsp/robotcode.lua
+++ b/lsp/robotcode.lua
@@ -4,11 +4,14 @@
---
--- RobotCode - Language Server Protocol implementation for Robot Framework.
+local venv = os.getenv('VIRTUAL_ENV')
+
---@type vim.lsp.Config
return {
cmd = { 'robotcode', 'language-server' },
filetypes = { 'robot', 'resource' },
root_markers = { 'robot.toml', 'pyproject.toml', 'Pipfile', '.git' },
+ cmd_env = venv and { PYTHONPATH = string.gsub(vim.fn.glob(venv .. '/lib/python*/site-packages'), '\n', ':') } or nil,
get_language_id = function(_, _)
return 'robotframework'
end,