Browse Source

updates for LSP

Chris 4 years ago
parent
commit
795cfed772
3 changed files with 10 additions and 3 deletions
  1. 5 0
      README.md
  2. 3 3
      lua/nv-whichkey/init.vim
  3. 2 0
      lua/utils.lua

+ 5 - 0
README.md

@@ -48,6 +48,11 @@ $HOME/.config/nvim/lua/nv-vscode/init.vim
 - toggle virtual text diagnostics
 
 **LOW PRIORITY**
+- wrap all whichkey lsp in functions
+- make java code actions prettier
+- figure out how to format java
+- formatting using efm server for python
+- setup junit tests for java
 - add git signs to whichkey (This will require wrapping in Lua commands)
 - add lots of lsp
 - neovim lightbulb config

+ 3 - 3
lua/nv-whichkey/init.vim

@@ -181,14 +181,14 @@ let g:which_key_map.G = {
 " l is for language server protocol
 let g:which_key_map.l = {
       \ 'name' : '+lsp' ,
-      \ 'a' : [':Lspsaga code_action'                , 'quickfix'],
+      \ 'a' : [':Lspsaga code_action'                , 'code action'],
       \ 'A' : [':Lspsaga range_code_action'          , 'selected action'],
       \ 'd' : [':Telescope lsp_document_diagnostics' , 'document diagnostics'],
       \ 'D' : [':Telescope lsp_workspace_diagnostics', 'workspace diagnostics'],
       \ 'f' : [':LspFormatting'                      , 'format'],
       \ 'H' : [':Lspsaga signature_help'             , 'signature_help'],
-      \ 'I' : [':LspInfo'                            , 'lsp_info'],
-      \ 'l' : [':Lspsaga lsp_finder'                 , 'lsp_finder'],
+      \ 'I' : [':LspInfo'                            , 'lsp info'],
+      \ 'l' : [':Lspsaga lsp_finder'                 , 'lsp finder'],
       \ 'L' : [':Lspsaga show_line_diagnostics'      , 'line_diagnostics'],
       \ 'o' : [':Vista!!'                            , 'outline'],
       \ 'p' : [':Lspsaga preview_definition'         , 'preview definition'],

+ 2 - 0
lua/utils.lua

@@ -27,9 +27,11 @@ define_augroups(
             {'BufRead', '*', 'setlocal formatoptions-=c formatoptions-=r formatoptions-=o'},
             {'BufNewFile', '*', 'setlocal formatoptions-=c formatoptions-=r formatoptions-=o'},
             {'FileType', 'java', 'luafile ~/.config/nvim/lua/lsp/java-ls.lua'},
+            {'FileType', 'java', 'nnoremap ca <Cmd>lua require(\'jdtls\').code_action()<CR>'},
         },
     }
 )
 
+
 -- Add this to lightbulb, java makes this annoying tho
 -- autocmd CursorHold,CursorHoldI * lua require'nvim-lightbulb'.update_lightbulb()