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

WIP: Update syntax checker layer #933

Merged
merged 11 commits into from Oct 25, 2017

Conversation

Projects
None yet
3 participants
@wsdjeg
Member

wsdjeg commented Oct 25, 2017

Ref: #200

pick up #931

close #547
close #200
close #931

Layers > checkers

This layer provides syntax checking feature.

Install

checkers layer is loaded by default.

options

Name default value description
g:spacevim_enable_neomake 1 Use neomake as default checking tools
g:spacevim_enable_ale 0 Use ale as default checking tools
g:spacevim_lint_on_the_fly 0 Syntax checking on the fly feature, disabled by default.

NOTE: if you want to use ale, you need:

let g:spacevim_enable_neomake = 0
let g:spacevim_enable_ale = 1

and if you want to use syntastic, set this two options to 0.

Mappings

Key mode description
SPC e c Normal clear errors
SPC e h Normal describe current checker
SPC e n Normal jump to the position of next error
SPC e N Normal jump to the position of previous error
SPC e p Normal jump to the position of previous error
SPC e l Normal display a list of all the errors
SPC e L Normal display a list of all the errors and focus the errors buffer
SPC e e Normal explain the error at point
SPC e s Normal set syntax checker
SPC e S Normal set syntax checker executable
SPC e v Normal verify syntax setup
SPC t s Normal toggle syntax

wsdjeg and others added some commits Oct 22, 2017

@wafflebot wafflebot bot added the WIP label Oct 25, 2017

@codecov

This comment has been minimized.

Show comment
Hide comment
@codecov

codecov bot Oct 25, 2017

Codecov Report

Merging #933 into dev will increase coverage by <.01%.
The diff coverage is 23.63%.

@@            Coverage Diff             @@
##              dev     #933      +/-   ##
==========================================
+ Coverage   34.49%   34.49%   +<.01%     
==========================================
  Files         209      209              
  Lines        8860     8871      +11     
==========================================
+ Hits         3056     3060       +4     
- Misses       5804     5811       +7

codecov bot commented Oct 25, 2017

Codecov Report

Merging #933 into dev will increase coverage by <.01%.
The diff coverage is 23.63%.

@@            Coverage Diff             @@
##              dev     #933      +/-   ##
==========================================
+ Coverage   34.49%   34.49%   +<.01%     
==========================================
  Files         209      209              
  Lines        8860     8871      +11     
==========================================
+ Hits         3056     3060       +4     
- Misses       5804     5811       +7
@wsdjeg

This comment has been minimized.

Show comment
Hide comment
@wsdjeg

wsdjeg Oct 25, 2017

Member

@blueyed It is not necessary to install neomake and ale and syntastic together, this will increase the number of plugins in a layer. I will add a new option g:spacevim_enable_ale for ale, just like g:spacevim_enable_neomake. but neomake will still be the default checker.

Member

wsdjeg commented Oct 25, 2017

@blueyed It is not necessary to install neomake and ale and syntastic together, this will increase the number of plugins in a layer. I will add a new option g:spacevim_enable_ale for ale, just like g:spacevim_enable_neomake. but neomake will still be the default checker.

@wsdjeg wsdjeg changed the title from WIP: improve Neomake integration to WIP: Update syntax checker layer Oct 25, 2017

wsdjeg added some commits Oct 25, 2017

@wsdjeg

This comment has been minimized.

Show comment
Hide comment
@wsdjeg

wsdjeg Oct 25, 2017

Member

@blueyed I get this error with neomake's java maker

let s:neomake_automake_events['TextChangedI'] = {'delay': 750}
Foo.java|1 error| class Foo is public, should be declared in a file named Foo.java

I think it is due to neomake's lint on the fly use tmp file, so the file name is not same as current file.

EDIT: this issue does not happened in ale, I think the ale use a tmp name same as current file name.

Member

wsdjeg commented Oct 25, 2017

@blueyed I get this error with neomake's java maker

let s:neomake_automake_events['TextChangedI'] = {'delay': 750}
Foo.java|1 error| class Foo is public, should be declared in a file named Foo.java

I think it is due to neomake's lint on the fly use tmp file, so the file name is not same as current file.

EDIT: this issue does not happened in ale, I think the ale use a tmp name same as current file name.

wsdjeg added some commits Oct 25, 2017

@crisidev

This comment has been minimized.

Show comment
Hide comment
@crisidev

crisidev Oct 25, 2017

Contributor

@wsdjeg Another nice thing to have with ale is the number of warnings / errors in the status line.

This snippet applied to autoload/SpaceVim/layers/core/statusline.vim will do the trick:

if g:spacevim_enable_neomake
...
elseif g:spacevim_enable_ale
  function! s:syntax_checking()
    if !exists('g:ale_enabled')
      return ''
    endif
    let counts = ale#statusline#Count(bufnr(''))
    let warnings = counts.warning + counts.style_warning
    let errors = counts.error + counts.style_error
    let l =  warnings ? ' %#SpaceVim_statusline_warn#●' . warnings . ' ' : ''
    let l .=  errors ? (warnings ? '' : ' ') . '%#SpaceVim_statusline_error#●' . errors  . ' ' : ''
    return l
  endfunction
Contributor

crisidev commented Oct 25, 2017

@wsdjeg Another nice thing to have with ale is the number of warnings / errors in the status line.

This snippet applied to autoload/SpaceVim/layers/core/statusline.vim will do the trick:

if g:spacevim_enable_neomake
...
elseif g:spacevim_enable_ale
  function! s:syntax_checking()
    if !exists('g:ale_enabled')
      return ''
    endif
    let counts = ale#statusline#Count(bufnr(''))
    let warnings = counts.warning + counts.style_warning
    let errors = counts.error + counts.style_error
    let l =  warnings ? ' %#SpaceVim_statusline_warn#●' . warnings . ' ' : ''
    let l .=  errors ? (warnings ? '' : ' ') . '%#SpaceVim_statusline_error#●' . errors  . ' ' : ''
    return l
  endfunction

@wsdjeg wsdjeg merged commit 62c3402 into dev Oct 25, 2017

1 of 5 checks passed

continuous-integration/appveyor/branch Waiting for AppVeyor build to complete
Details
continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/travis-ci/push The Travis CI build is in progress
Details
license/cla Contributor License Agreement is signed.
Details

@wafflebot wafflebot bot removed the WIP label Oct 25, 2017

@crisidev

This comment has been minimized.

Show comment
Hide comment
@crisidev

crisidev Oct 25, 2017

Contributor

I can open a PR for this specific function.

Contributor

crisidev commented Oct 25, 2017

I can open a PR for this specific function.

@wsdjeg

This comment has been minimized.

Show comment
Hide comment
@wsdjeg

wsdjeg Oct 25, 2017

Member

@crisidev PR is welcome :smaile:

Member

wsdjeg commented Oct 25, 2017

@crisidev PR is welcome :smaile:

@blueyed

This comment has been minimized.

Show comment
Hide comment
@blueyed

blueyed Oct 25, 2017

Contributor

Another nice thing to have with ale is the number of warnings / errors in the status line.

Same for Neomake. See :h neomake-statusline.

Contributor

blueyed commented Oct 25, 2017

Another nice thing to have with ale is the number of warnings / errors in the status line.

Same for Neomake. See :h neomake-statusline.

@wsdjeg wsdjeg deleted the check-layer branch Oct 31, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment