trying to add python virtualenv

pull/285/head
ray-x 7 months ago
parent 3c9398b599
commit d6ff1ed594

@ -12,11 +12,7 @@ local empty = util.empty
local api = vim.api
_NG_VT_DIAG_NS = api.nvim_create_namespace('navigator_lua_diag')
if not util.nvim_0_6_1() then
util.warn(
'Navigator 0.4+ only support nvim-0.6+, please use Navigator 0.3.x or a newer version of neovim'
)
end
util.nvim_0_8()
local diag_map = {}
if vim.diagnostic then

@ -159,13 +159,15 @@ M.defaults = function()
require('navigator.lspclient.python').on_init(client)
end,
on_new_config = function(new_config, new_root_dir)
-- require('navigator.lspclient.python').pyenv_path( new_root_dir)
local python_path = require('navigator.lspclient.python').pyenv_path(new_root_dir)
new_config.settings.python.pythonPath = python_path
end,
cmd = { 'pyright-langserver', '--stdio' },
filetypes = { 'python' },
flags = { allow_incremental_sync = true, debounce_text_changes = 500 },
settings = {
python = {
venvPath = '.',
formatting = { provider = 'black' },
analysis = {
autoSearchPaths = true,

@ -28,9 +28,6 @@ local log = require('navigator.util').log
local lerr = require('navigator.util').error
local trace = function(...) end
trace = log
if vim.fn.has('nvim-0.7') == 1 then
local trace = require('navigator.util').trace
end
local get_icon = function(kind)
if kind == nil or _NgConfigValues.icons.match_kinds[kind] == nil then

@ -4,7 +4,6 @@
local M = { log_path = vim.lsp.get_log_path() }
-- local is_windows = uv.os_uname().version:match("Windows")
local guihua = require('guihua.util')
local nvim_0_6_1
local nvim_0_8
local vfn = vim.fn
local api = vim.api
@ -386,17 +385,6 @@ function M.get_current_winid()
return api.nvim_get_current_win()
end
function M.nvim_0_6_1()
if nvim_0_6_1 ~= nil then
return nvim_0_6_1
end
nvim_0_6_1 = vfn.has('nvim-0.6.1') == 1
if nvim_0_6_1 == false then
M.warn('Please use navigator 0.3 version for neovim version < 0.6.1')
end
return nvim_0_6_1
end
function M.nvim_0_8()
if nvim_0_8 ~= nil then
return nvim_0_8
@ -404,6 +392,7 @@ function M.nvim_0_8()
nvim_0_8 = vfn.has('nvim-0.8') == 1
if nvim_0_8 == false then
M.log('Please use navigator 0.4 version for neovim version < 0.8')
vim.notify('Please use navigator 0.4 version for neovim version < 0.8', vim.log.levels.ERROR)
end
return nvim_0_8
end

Loading…
Cancel
Save