ソースを参照

✨ Python analysis options (pyright) (#352)

Francisco Suárez 4 年 前
コミット
3adcfdc034
3 ファイル変更14 行追加2 行削除
  1. 9 1
      lua/lsp/python-ls.lua
  2. 2 1
      lua/lv-globals.lua
  3. 3 0
      lv-settings.lua

+ 9 - 1
lua/lsp/python-ls.lua

@@ -8,7 +8,15 @@ require'lspconfig'.pyright.setup {
             signs = O.python.diagnostics.signs,
             underline = O.python.diagnostics.underline,
             update_in_insert = true
-
         })
+    },
+	 settings = {
+      python = {
+        analysis = {
+		  typeCheckingMode = O.python.analysis.type_checking,
+		  autoSearchPaths = O.python.analysis.auto_search_paths,
+          useLibraryCodeForTypes = O.python.analysis.use_library_code_types
+        }
+      }
     }
 }

+ 2 - 1
lua/lv-globals.lua

@@ -24,7 +24,8 @@ O = {
         formatter = '',
         autoformat = false,
         isort = false,
-        diagnostics = {virtual_text = true, signs = true, underline = true}
+        diagnostics = {virtual_text = true, signs = true, underline = true},
+		analysis = {type_checking = "basic", auto_search_paths = true, use_library_code_types = true}
     },
     dart = {sdk_path = '/usr/lib/dart/bin/snapshots/analysis_server.dart.snapshot'},
     lua = {

+ 3 - 0
lv-settings.lua

@@ -34,6 +34,9 @@ O.python.autoformat = true
 O.python.diagnostics.virtual_text = true
 O.python.diagnostics.signs = true
 O.python.diagnostics.underline = true
+O.python.analysis.type_checking = "off"
+O.python.analysis.auto_search_paths = true
+O.python.analysis.use_library_code_types = true
 
 -- lua
 -- TODO look into stylua