New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add gometalinter #312
add gometalinter #312
Conversation
cc6ed83
to
b0e9207
Compare
|
||
if a:left['type'] > a:right['type'] | ||
return 1 | ||
endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change will sort the items in the wrong order, which is important for the movement commands, etc. Instead of getting items in column order 1, 2, 3, 4, 5
, you can see items in order E3, E4, W1, W2, W5
, etc.
You should move these lines down below the column sorting, so it's the third key items are sorted on. Then E
will take priority over W
if there are both warnings and errors for the same column, if that's the problem. The way the items are sorted, the cursor is supposed to show information for a problem near the cursor. It doesn't matter what the severity is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're going to sort on the error type, you should take issue #149 into account. Eventually, I would like to support error types in some way beyond "warning" and "error". 'E' seems to be the first single character which could appear in lexicographic order, but 'I' comes before 'W' in lexicographic order, and 'W' is more severe than 'I', so that wouldn't be right.
\ {'callback': 'ale_linters#go#gobuild#GoList', 'output_stream': 'stdout'}, | ||
\ {'callback': 'ale_linters#go#gobuild#CopyFiles', 'output_stream': 'stdout'}, | ||
\ {'callback': 'ale_linters#go#gobuild#WriteBuffers', 'output_stream': 'stdout'}, | ||
\ {'callback': 'ale_linters#go#gometalinter#GetCommand', 'output_stream': 'stdout'}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of these output_stream
options are also the default value. I'll document this eventually, if I haven't already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be an idea to move functions shared between two linter definitions into the autoload/ale/handlers
directory. At the moment, ALE loads the defnitions for a given filetype like so:
execute 'silent! runtime! ale_linters/' . a:filetype . '/*.vim'
If anyone ever changes the way linters are loaded so only the list of enabled linters are loaded, which has tried before, then this code will break when only this linter is enabled for go
.
if !get(g:, 'ale_experimental_multibuffer', 0) && l:buffer != a:buffer | ||
" strip lines from other buffers | ||
continue | ||
endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could perhaps start implementing this flag in the function which fixes problems with the loclist items. If the flag isn't on, you could automatically remove items for other buffers in that function.
I'll close this one, as it's out of date. A simpler implementation might now be possible, as #333 has been implemented. |
It would be nice to find a way to put this combine several lint commands within the
gobuild
linter so that files are only copied once. This linter has a different handler pattern though.