]> Sergey Matveev's repositories - dotfiles.git/blobdiff - vim/.vim/pack/stargrave/start/py-importcompl/autoload/python/importcompl.vim
Move to vim-lsc from vim-lsp
[dotfiles.git] / vim / .vim / pack / stargrave / start / py-importcompl / autoload / python / importcompl.vim
index aa9a1685df669c28aac1952af2ebbc3ecf9b64a3..e516ad662bc5ce2794fa247d82e8b8b6407e382d 100644 (file)
@@ -56,10 +56,13 @@ function! python#importcompl#all() abort
             let imports[m[2]] = m[1]
         endfor
     endfor
+
+    let lines = getloclist(winnr())
+    if len(lines) == 0 | let lines = getqflist() | endif
     let result = []
-    for diag in lsp#ui#vim#diagnostics#get_all_buffer_diagnostics()
-        if diag["message"] !~ "^undefined name" | continue | endif
-        let m = diag["message"][strridx(diag["message"][:-2], "'")+1:-2]
+    for line in lines
+        if line.text !~ "^undefined name" | continue | endif
+        let m = line.text[strridx(line.text[:-2], "'")+1:-2]
         if len(m) == 0 || !has_key(imports, m) | continue | endif
         call insert(result, imports[m])
     endfor