Compare commits
No commits in common. '551db07d8a1abb72ec232edbb6f51fbc9d3becb5' and '0125349dafdc895dadf621c2c2aebb9c46769990' have entirely different histories.
551db07d8a
...
0125349daf
@ -1,4 +1 @@
|
||||
vim.opt_local.tabstop = 2
|
||||
vim.opt_local.softtabstop = 2
|
||||
vim.opt_local.shiftwidth = 2
|
||||
vim.opt_local.expandtab = true
|
||||
print("You are in lua")
|
||||
|
@ -1,37 +1 @@
|
||||
local has_pyright = nil
|
||||
|
||||
-- These are files that are typically located in the root directory of a Python
|
||||
-- project
|
||||
local root_files = {
|
||||
'pyproject.toml',
|
||||
'setup.py',
|
||||
'setup.cfg',
|
||||
'requirements.txt',
|
||||
'Pipfile',
|
||||
'pyrightconfig.json',
|
||||
'.git',
|
||||
}
|
||||
|
||||
local buf = vim.api.nvim_get_current_buf()
|
||||
|
||||
local root_dir = vim.fs.root(buf, root_files)
|
||||
local git_dir = vim.fs.root(buf, {'.git'})
|
||||
|
||||
local lsp_server = vim.lsp.start({
|
||||
name = 'pyright',
|
||||
cmd = {'pyright-langserver', '--stdio'},
|
||||
filetypes = { 'python' },
|
||||
root_dir = root_dir,
|
||||
single_file_support = false,
|
||||
settings = {
|
||||
python = {
|
||||
analysis = {
|
||||
autoSearchPaths = true,
|
||||
useLibraryCodeForTypes = true,
|
||||
diagnosticMode = 'openFilesOnly',
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.lsp.buf_attach_client(buf, lsp_server)
|
||||
print("You are in Python")
|
||||
|
@ -0,0 +1 @@
|
||||
print("LSP setting up")
|
@ -1,14 +0,0 @@
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
callback = function(args)
|
||||
-- this code is run every time we attach an LSP
|
||||
print("LSP Attached")
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("LspDetach", {
|
||||
callback = function(args)
|
||||
-- this code runs every time a buffer detaches from an LSP
|
||||
end,
|
||||
})
|
||||
|
||||
-- vim.lsp.set_log_level(“DEBUG”)
|
Loading…
Reference in New Issue