Skip to content

Commit e6eb630

Browse files
authored
feat(robotcode): support virtual env #4367
1 parent 433267f commit e6eb630

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

lsp/robotcode.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44
---
55
--- RobotCode - Language Server Protocol implementation for Robot Framework.
66

7+
local venv = os.getenv('VIRTUAL_ENV')
8+
79
---@type vim.lsp.Config
810
return {
911
cmd = { 'robotcode', 'language-server' },
1012
filetypes = { 'robot', 'resource' },
1113
root_markers = { 'robot.toml', 'pyproject.toml', 'Pipfile', '.git' },
14+
cmd_env = venv and { PYTHONPATH = string.gsub(vim.fn.glob(venv .. '/lib/python*/site-packages'), '\n', ':') } or nil,
1215
get_language_id = function(_, _)
1316
return 'robotframework'
1417
end,

0 commit comments

Comments
 (0)