Skip to content

Latest commit

 

History

History
269 lines (216 loc) · 13.4 KB

TODO.md

File metadata and controls

269 lines (216 loc) · 13.4 KB

nvim-go original behavior

QuickFix, LocationList

  • Fix windows name, Currently [:setloclist()] [Location List] [-]
    • Reference to neomake, or research neovim core code?

Goroutine

  • Super data racy

Miscellaneous

  • Display the corresponding function(file) to preview window like buffer that current cursor (test)function
    • Follow the cursor position with delay time

Comment Generator

  • Automatically generate and insert the typical Go comment based current cursor or selected words.
    • Parses AST, determine *ast.Ident.Obj.Kind aka *ast.ObjKind type
    • *ast.Pkg:
      • Package *ast.File.Name implements ...
    • *ast.Con:
      • *ast.ValueSpec.Name ??? ...
    • *ast.Typ:
      • (A|The) *ast.TypeSpec.Name represents a ... // (A|The) is optional
    • *ast.Var:
      • *ast.ValueSpec.Name is the ...
    • *ast.Fun:
      • *ast.FuncDecl.Name returns the ...
    • *ast.Lbl:
      • Need?
    • Support interface, like
    • func (f *Foo) String():
      • String implements a fmt.Stringer interface.
    • func (f *Foo) Error():
      • Error implements a error.Error interface.

Compile error

  • Commands
    • GoBuild
    • GoCoverage
    • GoInstall
    • GoTest
    • GoLint
  • Implements highlight sign to error & warning (like YCM, vim-flake8)
    • Use echo error & warning message when move cursor to this line

GoAnalyze

  • Goal is easy to analysis for Go sources
  • Alternative tagbar feature
    • Support jump to child AST with any key-mapping
    • Support tagbar like jump to func, type, var, const source position with <CR> mapping
  • Support display the current cursor <cword> AST

GoWatch

  • Implements GoWatch command
  • Watch the *.go, *.c and other cgo files in the current package and automatically real build
  • Use inotify for Linux, fsevents for OS X
    • Create go-notify package?
  • Show build and watch log in the split buffer

AST based syntax highlighting

Dlv

delve debugging

https://github.com/derekparker/delve
https://blog.gopheracademy.com/advent-2015/debugging-with-delve/

  • Debugging use delve
  • Support debug command
    • Build from current sources
  • Support exec command
    • Execute go binary
  • Support connect command
    • Currently use dlv headless feature and api. connect command should be execute with standalone.
  • Stepping exection(continue, next, step, step-instruction) with pc sign and color highlight
    • If debug a large output command, sometimes freezing the neovim. need state(busy) check
  • lldb.nvim like Debugging UI
  • vs-code and go-debug like UI interface
    • Highlight the current hitting breakpoint with fadeout (but too far)
  • Set breakpoint with sign and key mapping
  • Ref: Microsoft vs-code feature
  • Ref: go-debug - go debugger for atom

Full cgo support

Support useful gotools

Unit Test

  • Use go test feature

vim-go compatible

GoAlternate -> GoTestSwitch

https://github.com/fatih/vim-go/blob/master/autoload/go/alternate.vim

  • Implements GoTestSwitch command
  • Jump to the corresponding (test)function based by parses the AST information
  • Instead of GoAlternate

GoBuild

https://github.com/fatih/vim-go/blob/master/autoload/go/cmd.vim#L16

  • Fix display the wrong file path to the quickfix or location-list
    • Fixed but less than perfect
  • Inline build(no spawn go build) if possible

GoCoverage

https://github.com/fatih/vim-go/blob/master/autoload/go/cmd.vim

GoInfo

https://github.com/fatih/vim-go/blob/master/autoload/go/complete.vim#L99

  • Implements GoInfo command use guru
  • Support timer without vim's updatetime value
  • Do not re-call if same code on current cursor

GoInstall

https://github.com/fatih/vim-go/blob/master/autoload/go/cmd.vim#L145

  • Implements GoInstall command

GoLint and other lint tools

https://github.com/fatih/vim-go/blob/master/autoload/go/lint.vim

  • Goal is full analysis to Go sources and lint, like flake8 tool
    • Will create yet another gometalinter tool from scratch if necessary
    • flake8 is defact standard in Python, Refer to flake8 internal and plugin interface
  • Implements golint only command (GoLint)
  • Implements govet only command (GoVet)
  • Support other linter tools

GoTest

https://github.com/fatih/vim-go/blob/master/autoload/go/cmd.vim#L188

  • Implements GoTest command output to neovim terminal feature
  • Support run=func flag
  • Support GoTestCompile(?)

GoGuru

Command diff list

Done vim-go commands vim-go functions nvim-go async
GoInstallBinaries s:GoInstallBinaries(-1) Not support -
GoUpdateBinaries s:GoInstallBinaries(1) Not support -
GoPath go#path#GoPath(<f-args>) - -
GoRename go#rename#Rename(<bang>0,<f-args>) Gorename Yes
GoGuruScope go#guru#Scope(<f-args>) - -
GoImplements go#guru#Implements(<count>) GoGuruImplements Yes
GoCallees go#guru#Callees(<count>) GoGuruCallees Yes
GoDescribe go#guru#Describe(<count>) GoGuruDescribe Yes
GoCallers go#guru#Callers(<count>) GoGuruCallers Yes
GoCallstack go#guru#Callstack(<count>) GoGuruCallstack Yes
GoFreevars go#guru#Freevars(<count>) GoGuruFreevars Yes
GoChannelPeers go#guru#ChannelPeers(<count>) GoGuruChannelPeers Yes
GoReferrers go#guru#Referrers(<count>) GoGuruReferrers Yes
GoGuruTags go#guru#Tags(<f-args>) - -
GoSameIds go#guru#SameIds(<count>) - -
GoFiles go#tool#Files() - -
GoDeps go#tool#Deps() - -
GoInfo go#complete#Info(0) - -
GoBuild go#cmd#Build(<bang>0,<f-args>) Gobuild Yes
GoGenerate go#cmd#Generate(<bang>0,<f-args>) - -
GoRun go#cmd#Run(<bang>0,<f-args>) Gorun Yes
GoInstall go#cmd#Install(<bang>0, <f-args>) - -
GoTest go#cmd#Test(<bang>0, 0, <f-args>) Gotest Yes
GoTestFunc go#cmd#TestFunc(<bang>0, <f-args>) - -
GoTestCompile go#cmd#Test(<bang>0, 1, <f-args>) - -
GoCoverage go#coverage#Buffer(<bang>0, <f-args>) - -
GoCoverageClear go#coverage#Clear() - -
GoCoverageToggle go#coverage#BufferToggle(<bang>0, <f-args>) - -
GoCoverageBrowser go#coverage#Browser(<bang>0, <f-args>) - -
GoPlay go#play#Share(<count>, <line1>, <line2>) - -
GoDef go#def#Jump('') call GoGuru('definition') Yes
GoDefPop go#def#StackPop(<f-args>) - -
GoDefStack go#def#Stack(<f-args>) - -
GoDefStackClear go#def#StackClear(<f-args>) - -
GoDoc go#doc#Open('new', 'split', <f-args>) - -
GoDocBrowser go#doc#OpenBrowser(<f-args>) - -
GoFmt go#fmt#Format(-1) Gofmt Any
GoImports go#fmt#Format(1) Gofmt Any
GoDrop go#import#SwitchImport(0, '', <f-args>, '') - -
GoImport go#import#SwitchImport(1, '', <f-args>, '<bang>') - -
GoImportAs go#import#SwitchImport(1, <f-args>, '<bang>') - -
GoMetaLinter go#lint#Gometa(0, <f-args>) Gometalinter Yes
GoLint go#lint#Golint(<f-args>) - -
GoVet go#lint#Vet(<bang>0, <f-args>) - -
GoErrCheck go#lint#Errcheck(<f-args>) - -
GoAlternate go#alternate#Switch(<bang>0, '') GoTestSwitch Yes
GoDecls ctrlp#init(ctrlp#decls#cmd(0, <q-args>)) - -
GoDeclsDir ctrlp#init(ctrlp#decls#cmd(1, <q-args>)) - -