mirror of
https://github.com/dense-analysis/ale.git
synced 2026-11-19 02:01:03 +08:00
Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3d68ec7857 | ||
|
|
e670c9781c | ||
|
|
0d1d0a9f81 | ||
|
|
c8890af8d4 | ||
|
|
9abe393961 |
No files matched your search
@@ -1,6 +1,7 @@
|
||||
call ale#Set('ruby_sorbet_executable', 'srb')
|
||||
call ale#Set('ruby_sorbet_options', '')
|
||||
call ale#Set('ruby_sorbet_enable_watchman', 0)
|
||||
call ale#Set('ruby_sorbet_initialization_options', { 'highlightUntyped': v:false })
|
||||
|
||||
function! ale_linters#ruby#sorbet#GetCommand(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'ruby_sorbet_executable')
|
||||
@@ -21,6 +22,6 @@ call ale#linter#Define('ruby', {
|
||||
\ 'language': 'ruby',
|
||||
\ 'executable': {b -> ale#Var(b, 'ruby_sorbet_executable')},
|
||||
\ 'command': function('ale_linters#ruby#sorbet#GetCommand'),
|
||||
\ 'project_root': function('ale#ruby#FindProjectRoot')
|
||||
\ 'project_root': function('ale#ruby#FindProjectRoot'),
|
||||
\ 'initialization_options': {b -> ale#Var(b, 'ruby_sorbet_initialization_options')}
|
||||
\})
|
||||
|
||||
@@ -9,7 +9,9 @@ endif
|
||||
" --lint-only
|
||||
function! ale_linters#verilog#slang#GetCommand(buffer) abort
|
||||
return 'slang -Weverything '
|
||||
\ . '--diag-abs-paths '
|
||||
\ . '-I%s:h '
|
||||
\ . '-y%s:h '
|
||||
\ . ale#Var(a:buffer, 'verilog_slang_options') .' '
|
||||
\ . '%t'
|
||||
endfunction
|
||||
@@ -28,6 +30,7 @@ function! ale_linters#verilog#slang#Handle(buffer, lines) abort
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
let l:item = {
|
||||
\ 'filename': l:match[1],
|
||||
\ 'lnum': str2nr(l:match[2]),
|
||||
\ 'type': (l:match[4] is# 'error') ? 'E' : 'W',
|
||||
\ 'text': s:RemoveUnicodeQuotes(l:match[5]),
|
||||
|
||||
@@ -10,6 +10,7 @@ function! ale_linters#verilog#verilator#GetCommand(buffer) abort
|
||||
" the path to the current file is systematically added to the search path
|
||||
return 'verilator --lint-only -Wall -Wno-DECLFILENAME '
|
||||
\ . '-I%s:h '
|
||||
\ . '-y %s:h '
|
||||
\ . ale#Var(a:buffer, 'verilog_verilator_options') .' '
|
||||
\ . '%t'
|
||||
endfunction
|
||||
|
||||
@@ -12,6 +12,8 @@ let g:__ale_c_project_filenames = ['.git/HEAD', 'configure', 'Makefile', 'CMakeL
|
||||
|
||||
let g:ale_c_build_dir_names = get(g:, 'ale_c_build_dir_names', [
|
||||
\ 'build',
|
||||
\ 'build/Debug',
|
||||
\ 'build/Release',
|
||||
\ 'bin',
|
||||
\])
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ function! ale#cursor#TruncatedEcho(original_message) abort
|
||||
" Change tabs to spaces.
|
||||
let l:message = substitute(l:message, "\t", ' ', 'g')
|
||||
" Remove any newlines in the message.
|
||||
let l:message = substitute(l:message, "\n", '', 'g')
|
||||
let l:message = substitute(l:message, "\n", ' ', 'g')
|
||||
" Convert indentation groups into single spaces for better legibility when
|
||||
" put on a single line
|
||||
let l:message = substitute(l:message, ' \+', ' ', 'g')
|
||||
@@ -93,6 +93,7 @@ function! ale#cursor#EchoCursorWarning(...) abort
|
||||
if !empty(l:loc)
|
||||
let l:format = ale#Var(l:buffer, 'echo_msg_format')
|
||||
let l:msg = ale#GetLocItemMessage(l:loc, l:format)
|
||||
|
||||
call ale#cursor#TruncatedEcho(l:msg)
|
||||
let l:info.echoed = 1
|
||||
elseif get(l:info, 'echoed')
|
||||
|
||||
@@ -28,7 +28,7 @@ function! ale#lsp#response#ReadDiagnostics(diagnostics) abort
|
||||
for l:diagnostic in a:diagnostics
|
||||
let l:severity = get(l:diagnostic, 'severity', 0)
|
||||
let l:loclist_item = {
|
||||
\ 'text': substitute(l:diagnostic.message, '\(\r\n\|\n\|\r\)', ' ', 'g'),
|
||||
\ 'text': l:diagnostic.message,
|
||||
\ 'type': 'E',
|
||||
\ 'lnum': l:diagnostic.range.start.line + 1,
|
||||
\ 'col': l:diagnostic.range.start.character + 1,
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ g:ale_c_always_make
|
||||
c_build_dir_names
|
||||
g:ale_c_build_dir_names
|
||||
Type: |List|
|
||||
Default: `['build', 'bin']`
|
||||
Default: `['build', 'build/Debug', 'build/Release', 'bin']`
|
||||
|
||||
A list of directory names to be used when searching upwards from C files
|
||||
to discover compilation databases with. For directory named `'foo'`, ALE
|
||||
|
||||
@@ -267,6 +267,23 @@ g:ale_ruby_sorbet_enable_watchman
|
||||
to files from outside of vim. Defaults to disable watchman because it
|
||||
requires watchman to be installed separately from sorbet.
|
||||
|
||||
*ale-options.ruby_sorbet_initialization_options*
|
||||
*g:ale_ruby_sorbet_initialization_options*
|
||||
*b:ale_ruby_sorbet_initialization_options*
|
||||
ruby_sorbet_initialization_options
|
||||
g:ale_ruby_sorbet_initialization_options
|
||||
Type: |Dictionary|
|
||||
Default: `{ 'highlightUntyped': v:false }`
|
||||
|
||||
This variable can be changed to modify initialization options provided to
|
||||
the Sorbet language server. By default, a minimal object with defaults is
|
||||
provided to ensure proper LSP initialization.
|
||||
|
||||
Setting this variable to a an empty object will cause sorbet LSP to
|
||||
fail during initialization.
|
||||
|
||||
See https://sorbet.org/docs/lsp#initialize-request for available options.
|
||||
|
||||
|
||||
===============================================================================
|
||||
standardrb *ale-ruby-standardrb*
|
||||
|
||||
@@ -8,12 +8,14 @@ Execute(The slang handler should parse lines correctly):
|
||||
AssertEqual
|
||||
\ [
|
||||
\ {
|
||||
\ 'filename' : 'foo.sv',
|
||||
\ 'lnum': 11,
|
||||
\ 'col': 1,
|
||||
\ 'type': 'W',
|
||||
\ 'text': 'extra '';'' has no effect [-Wempty-member]',
|
||||
\ },
|
||||
\ {
|
||||
\ 'filename' : 'bar.sv',
|
||||
\ 'lnum': 24,
|
||||
\ 'col': 12,
|
||||
\ 'type': 'E',
|
||||
@@ -22,5 +24,5 @@ Execute(The slang handler should parse lines correctly):
|
||||
\ ],
|
||||
\ ale_linters#verilog#slang#Handle(bufnr(''), [
|
||||
\ 'foo.sv:11:1: warning: extra '';'' has no effect [-Wempty-member]',
|
||||
\ 'foo.sv:24:12: error: cannot mix continuous and procedural assignments to variable ''data_o''',
|
||||
\ 'bar.sv:24:12: error: cannot mix continuous and procedural assignments to variable ''data_o''',
|
||||
\ ])
|
||||
@@ -5,10 +5,10 @@ After:
|
||||
call ale#assert#TearDownLinterTest()
|
||||
|
||||
Execute(The default slang command should be correct):
|
||||
AssertLinter 'slang', 'slang -Weverything -I%s:h %t'
|
||||
AssertLinter 'slang', 'slang -Weverything --diag-abs-paths -I%s:h -y%s:h %t'
|
||||
|
||||
Execute(slang options should be configurable):
|
||||
" Additional args for the linter
|
||||
let g:ale_verilog_slang_options = '--define-macro DWIDTH=12'
|
||||
|
||||
AssertLinter 'slang', 'slang -Weverything -I%s:h --define-macro DWIDTH=12 %t'
|
||||
AssertLinter 'slang', 'slang -Weverything --diag-abs-paths -I%s:h -y%s:h --define-macro DWIDTH=12 %t'
|
||||
@@ -6,6 +6,7 @@ Before:
|
||||
let g:ale_ruby_sorbet_executable = 'srb'
|
||||
let g:ale_ruby_sorbet_options = ''
|
||||
let g:ale_ruby_sorbet_enable_watchman = 0
|
||||
let g:ale_ruby_sorbet_initialization_options = { 'highlightUntyped': v:false }
|
||||
|
||||
After:
|
||||
call ale#assert#TearDownLinterTest()
|
||||
@@ -32,3 +33,11 @@ Execute(Setting bundle appends 'exec srb tc'):
|
||||
AssertLinter 'path to/bundle', ale#Escape('path to/bundle')
|
||||
\ . ' exec srb'
|
||||
\ . ' tc --lsp --disable-watchman'
|
||||
|
||||
Execute(Should use predetermined initialization_options by default):
|
||||
AssertLSPOptions { 'highlightUntyped': v:false }
|
||||
|
||||
Execute(Should be able to set custom initialization_options):
|
||||
let g:ale_ruby_sorbet_initialization_options = {'enableTypedFalse': v:true}
|
||||
|
||||
AssertLSPOptions {'enableTypedFalse': v:true}
|
||||
@@ -5,10 +5,10 @@ After:
|
||||
call ale#assert#TearDownLinterTest()
|
||||
|
||||
Execute(The default verilator command should be correct):
|
||||
AssertLinter 'verilator', 'verilator --lint-only -Wall -Wno-DECLFILENAME -I%s:h %t'
|
||||
AssertLinter 'verilator', 'verilator --lint-only -Wall -Wno-DECLFILENAME -I%s:h -y %s:h %t'
|
||||
|
||||
Execute(verilator options should be configurable):
|
||||
" Additional args for the linter
|
||||
let g:ale_verilog_verilator_options = '-sv --default-language "1800-2012"'
|
||||
|
||||
AssertLinter 'verilator', 'verilator --lint-only -Wall -Wno-DECLFILENAME -I%s:h -sv --default-language "1800-2012" %t'
|
||||
AssertLinter 'verilator', 'verilator --lint-only -Wall -Wno-DECLFILENAME -I%s:h -y %s:h -sv --default-language "1800-2012" %t'
|
||||
@@ -109,11 +109,11 @@ Execute(ale#lsp#response#ReadDiagnostics() should include sources in detail):
|
||||
\ }
|
||||
\ ])
|
||||
|
||||
Execute(ale#lsp#response#ReadDiagnostics() should keep detail with line breaks but replace with spaces in text):
|
||||
Execute(ale#lsp#response#ReadDiagnostics() should keep line breaks in text):
|
||||
AssertEqual [
|
||||
\ {
|
||||
\ 'type': 'E',
|
||||
\ 'text': 'cannot borrow `cap` as mutable more than once at a time mutable borrow starts here in previous iteration of loop',
|
||||
\ 'text': "cannot borrow `cap` as mutable\r\nmore than once at a time\n\nmutable borrow starts here\rin previous iteration of loop",
|
||||
\ 'detail': "[rustc] cannot borrow `cap` as mutable\r\nmore than once at a time\n\nmutable borrow starts here\rin previous iteration of loop",
|
||||
\ 'lnum': 10,
|
||||
\ 'col': 15,
|
||||
|
||||
@@ -30,7 +30,7 @@ Before:
|
||||
\ 'nr': -1,
|
||||
\ 'type': 'E',
|
||||
\ 'code': 'semi',
|
||||
\ 'text': "Missing semicolon.\r",
|
||||
\ 'text': "Missing\nsemicolon.\r",
|
||||
\ 'detail': "Every statement should end with a semicolon\nsecond line",
|
||||
\ },
|
||||
\ {
|
||||
|
||||
Reference in new issue
Block a user