idanarye / vim-dutyl

Coordinate D tools to work together for you
http://www.vim.org/scripts/script.php?script_id=5003
79 stars 13 forks source link

Style checking #28

Closed ANtlord closed 2 years ago

ANtlord commented 8 years ago

Hello! I've got an issue related to command DUstyleCheck. When I call it I've got this.

fchdir() to previous dir
line 6: sourcing "/home/<myuser>/.vim/plugged/vim-dutyl/autoload/dutyl/configFile.vim"
finished sourcing /home/<myuser>/.vim/plugged/vim-dutyl/autoload/dutyl/configFile.vim
continuing in function dutyl#styleCheck..dutyl#core#requireFunctions..dutyl#core#instance..dutyl#core#create
Calling shell to execute: "('~/.dub/packages/dscanner-0.3.0/dscanner/dscanner' '--styleCheck') >/tmp/v170KY7/5 2>&1"
                                                                                                                                Error detected while processing function dutyl#styleCheck..369..<SNR>99_parseDscannerCheckResults:
line    4:
E684: list index out of range: 1
E116: Invalid arguments for function add
Error detected while processing function dutyl#styleCheck..dutyl#util#setQuickfixOrLocationList:
line    2:
E714: List required

My settings related to vim-dutyl is

let g:dutyl_stdImportPaths=['/usr/include/dmd/druntime/', '/usr/include/dmd/phobos/']
let g:dutyl_neverAddClosingParen=1
let g:dutyl_dontUseVimProc = 1
call dutyl#register#tool('dcd-client', '~/.dub/packages/dcd-0.8.0/dcd/dcd-client')
call dutyl#register#tool('dcd-server', '~/.dub/packages/dcd-0.8.0/dcd/dcd-server')
call dutyl#register#tool('dfmt', '~/.dub/packages/dfmt-0.4.5/dfmt/dfmt')
call dutyl#register#tool('dscanner', '~/.dub/packages/dscanner-0.3.0/dscanner/dscanner')

I searched vimrc files on github with this plugin, hoping for something useful, but it was without any result. Did I miss some option in vimrc?

Thank you!

idanarye commented 8 years ago

What do you get when you pipe your file to dscanner --styleCheck? That is, when you run:

$ ~/.dub/packages/dscanner-0.3.0/dscanner/dscanner --styleCheck < /path/to/your/file.d
ANtlord commented 8 years ago

I've got this

2016-06-23T14:00:38.150:first.d:visit:301 Could not locate object.d or object.di
2016-06-23T14:00:38.150:first.d:visit:379 Could not resolve location of module 'std/stdio'
./test.d(5:6)[warn]: Variable qwe is never modified and could have been declared const or immutable.
./test.d(5:6)[warn]: Variable qwe is never used.
idanarye commented 8 years ago

This is weird... it seems like dscanner is unable to find Phobos(why does it even need it?), but it does not have any command line arguments for setting it...

I've pushed to develop a commit that prints such lines using echoerr, so the problem will be easier to figure. With it, you'll get your quickfix list filled, but you will also get red error messages from dscanner. I don't want to hide those because they indicate that something is off with your dscanner configuration. For that, you should open a ticket in https://github.com/Hackerpilot/Dscanner/issues