WIP
This commit is contained in:
parent
7953c47a57
commit
4c5dfe3ea5
6 changed files with 40 additions and 10 deletions
20
README.md
20
README.md
|
|
@ -2,7 +2,7 @@
|
||||||
Nim support for Neovim
|
Nim support for Neovim
|
||||||
|
|
||||||
# TODO
|
# TODO
|
||||||
- [ ] Add global options for user
|
- [x] Add global options for user
|
||||||
- [ ] Doc
|
- [ ] Doc
|
||||||
- [ ] Bindings
|
- [ ] Bindings
|
||||||
- [ ] Options
|
- [ ] Options
|
||||||
|
|
@ -34,6 +34,7 @@ Nim support for Neovim
|
||||||
- [x] NimRenameSymbol
|
- [x] NimRenameSymbol
|
||||||
- [ ] NimRenameSymbolProject
|
- [ ] NimRenameSymbolProject
|
||||||
- [ ] IDE features
|
- [ ] IDE features
|
||||||
|
- [ ] Parse proc parameter types for parameter completion
|
||||||
- [ ] Auto complete modules
|
- [ ] Auto complete modules
|
||||||
- [ ] Outline with unite
|
- [ ] Outline with unite
|
||||||
- [ ] Outline with a proper tagbar
|
- [ ] Outline with a proper tagbar
|
||||||
|
|
@ -43,13 +44,26 @@ Nim support for Neovim
|
||||||
- [ ] REPL interaction
|
- [ ] REPL interaction
|
||||||
- [ ] Add tests
|
- [ ] Add tests
|
||||||
- [x] CI integration
|
- [x] CI integration
|
||||||
- [ ] Test nimsuggest for surprises
|
- [x] Test nimsuggest for surprises
|
||||||
- [ ] Unit tests
|
- [ ] Unit tests
|
||||||
|
- [ ] Suggest module
|
||||||
|
- [ ] Async
|
||||||
|
- [ ] Sync
|
||||||
|
- [ ] Integration tests
|
||||||
|
- [ ] NimDefinition
|
||||||
|
- [ ] NimOutline
|
||||||
|
- [ ] NimInfo
|
||||||
|
- [ ] NimUsages
|
||||||
|
- [ ] NimUsagesProject
|
||||||
|
- [ ] NimRenameSymbol
|
||||||
|
- [ ] NimRenameSymbolProject
|
||||||
|
|
||||||
|
|
||||||
# TASKS
|
# TASKS
|
||||||
- [ ] Sync version communicating with nimsuggest
|
- [x] Sync version communicating with nimsuggest
|
||||||
- [ ] Test the user's versions
|
- [ ] Test the user's versions
|
||||||
- [ ] Add roadmap
|
- [ ] Add roadmap
|
||||||
|
|
||||||
|
|
||||||
# BUGS
|
# BUGS
|
||||||
- [ ] Not all lines are read from stdin for some reason with job-control
|
- [ ] Not all lines are read from stdin for some reason with job-control
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,6 @@ endfunction
|
||||||
|
|
||||||
|
|
||||||
function! features#definition#run()
|
function! features#definition#run()
|
||||||
call util#StartQuery()
|
|
||||||
call suggest#New("def", 0, s:DefinitionImpl)
|
call suggest#New("def", 0, s:DefinitionImpl)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,5 @@ endfunction
|
||||||
|
|
||||||
|
|
||||||
function! features#info#run()
|
function! features#info#run()
|
||||||
call util#StartQuery()
|
|
||||||
call suggest#New("def", 0, s:InfoImpl)
|
call suggest#New("def", 0, s:InfoImpl)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,6 @@ function! s:UsagesDefinitionImpl.run(data)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! features#usages#run(findInProject)
|
function! features#usages#run(findInProject)
|
||||||
call util#StartQuery()
|
|
||||||
cclose
|
cclose
|
||||||
call setqflist([])
|
call setqflist([])
|
||||||
let s:findInProject = a:findInProject
|
let s:findInProject = a:findInProject
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,8 @@ function! s:NimSuggest.on_exit()
|
||||||
if len(self.lines) > 0
|
if len(self.lines) > 0
|
||||||
call self.handler.run(self)
|
call self.handler.run(self)
|
||||||
else
|
else
|
||||||
echo ""
|
" Clear cli
|
||||||
|
echo ""
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
@ -38,8 +39,20 @@ function! suggest#NewKnown(command, useV2, file, line, col, handler)
|
||||||
" call writefile(getline(1, '$'), result.tempfile)
|
" call writefile(getline(1, '$'), result.tempfile)
|
||||||
" endif
|
" endif
|
||||||
" let nimcom = completion . " " . file . (a:useTempFile ? (";" . result.tempfile) : "") . ":" . line . ":" . col
|
" let nimcom = completion . " " . file . (a:useTempFile ? (";" . result.tempfile) : "") . ":" . line . ":" . col
|
||||||
let result.job = jobstart([g:nvim_nim_exec_nimsuggest, (a:useV2 ? '--v2' : ''), '--stdin', result.file], result)
|
|
||||||
call jobsend(result.job, a:command . " " . result.file . ":" . result.line . ":" . result.col . "\nquit\n")
|
let jobcmd = [g:nvim_nim_exec_nimsuggest, (a:useV2 ? '--v2' : ''), '--stdin', result.file]
|
||||||
|
let jobcmdstr = g:nvim_nim_exec_nimsuggest . " " . (a:useV2 ? '--v2' : '') . " " . '--stdin' . " " . result.file
|
||||||
|
let jobstdin = a:command . " " . result.file . ":" . result.line . ":" . result.col
|
||||||
|
|
||||||
|
if !g:nvim_nim_enable_async || !has("nvim")
|
||||||
|
let fullcmd = 'echo -e ' . shellescape(jobstdin, 1) . '|' . jobcmdstr
|
||||||
|
let result.lines = split(system(fullcmd), "\n")[4:-2]
|
||||||
|
call a:handler.run(result)
|
||||||
|
else
|
||||||
|
call util#StartQuery()
|
||||||
|
let result.job = jobstart([g:nvim_nim_exec_nimsuggest, (a:useV2 ? '--v2' : ''), '--stdin', result.file], result)
|
||||||
|
call jobsend(result.job, jobcmd)
|
||||||
|
endif
|
||||||
return result
|
return result
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,4 +6,9 @@ let s:loaded = 1
|
||||||
au BufNewFile,BufRead *.nim set filetype=nim
|
au BufNewFile,BufRead *.nim set filetype=nim
|
||||||
au BufNewFile,BufRead *.nims set filetype=nims
|
au BufNewFile,BufRead *.nims set filetype=nims
|
||||||
|
|
||||||
let g:nvim_nim_enable_highlighter = 0
|
let g:nvim_nim_enable_highlighter = 0
|
||||||
|
let g:nvim_nim_enable_async = 0
|
||||||
|
let g:nvim_nim_highlight_builtin = 1
|
||||||
|
let g:nvim_nim_highlight_use_unite = 0
|
||||||
|
let g:nvim_nim_autocomplete = "omni" " omni, deoplete, ycm
|
||||||
|
let g:nvim_nim_outline = "quickfix" " quickfix, outline
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue