mirror of
				https://github.com/amix/vimrc
				synced 2025-10-31 14:43:35 +08:00 
			
		
		
		
	Updated plugins
This commit is contained in:
		| @ -11,10 +11,18 @@ function! ale_linters#elixir#credo#Handle(buffer, lines) abort | ||||
|         let l:type = l:match[3] | ||||
|         let l:text = l:match[4] | ||||
|  | ||||
|         if l:type is# 'C' | ||||
|             let l:type = 'E' | ||||
|         elseif l:type is# 'R' | ||||
|         " Refactoring opportunities | ||||
|         if l:type is# 'F' | ||||
|             let l:type = 'W' | ||||
|         " Consistency | ||||
|         elseif l:type is# 'C' | ||||
|             let l:type = 'W' | ||||
|         " Software Design | ||||
|         elseif l:type is# 'D' | ||||
|             let l:type = 'I' | ||||
|         " Code Readability | ||||
|         elseif l:type is# 'R' | ||||
|             let l:type = 'I' | ||||
|         endif | ||||
|  | ||||
|         call add(l:output, { | ||||
| @ -29,9 +37,16 @@ function! ale_linters#elixir#credo#Handle(buffer, lines) abort | ||||
|     return l:output | ||||
| endfunction | ||||
|  | ||||
| function! ale_linters#elixir#credo#GetCommand(buffer) abort | ||||
|     let l:project_root = ale#handlers#elixir#FindMixProjectRoot(a:buffer) | ||||
|  | ||||
|     return ale#path#CdString(l:project_root) | ||||
|     \ . ' mix help credo && mix credo suggest --format=flycheck --read-from-stdin %s' | ||||
| endfunction | ||||
|  | ||||
| call ale#linter#Define('elixir', { | ||||
| \   'name': 'credo', | ||||
| \   'executable': 'mix', | ||||
| \   'command': 'mix help credo && mix credo suggest --format=flycheck --read-from-stdin %s', | ||||
| \   'command_callback': 'ale_linters#elixir#credo#GetCommand', | ||||
| \   'callback': 'ale_linters#elixir#credo#Handle', | ||||
| \}) | ||||
|  | ||||
| @ -25,10 +25,17 @@ function! ale_linters#elixir#dialyxir#Handle(buffer, lines) abort | ||||
|     return l:output | ||||
| endfunction | ||||
|  | ||||
| function! ale_linters#elixir#dialyxir#GetCommand(buffer) abort | ||||
|     let l:project_root = ale#handlers#elixir#FindMixProjectRoot(a:buffer) | ||||
|  | ||||
|     return ale#path#CdString(l:project_root) | ||||
|     \ . ' mix help dialyzer && mix dialyzer' | ||||
| endfunction | ||||
|  | ||||
| call ale#linter#Define('elixir', { | ||||
| \   'name': 'dialyxir', | ||||
| \   'executable': 'mix', | ||||
| \   'command': 'mix help dialyzer && mix dialyzer', | ||||
| \   'command_callback': 'ale_linters#elixir#dialyxir#GetCommand', | ||||
| \   'callback': 'ale_linters#elixir#dialyxir#Handle', | ||||
| \}) | ||||
|  | ||||
|  | ||||
| @ -29,10 +29,17 @@ function! ale_linters#elixir#dogma#Handle(buffer, lines) abort | ||||
|     return l:output | ||||
| endfunction | ||||
|  | ||||
| function! ale_linters#elixir#dogma#GetCommand(buffer) abort | ||||
|     let l:project_root = ale#handlers#elixir#FindMixProjectRoot(a:buffer) | ||||
|  | ||||
|     return ale#path#CdString(l:project_root) | ||||
|     \ . ' mix help dogma && mix dogma %s --format=flycheck' | ||||
| endfunction | ||||
|  | ||||
| call ale#linter#Define('elixir', { | ||||
| \   'name': 'dogma', | ||||
| \   'executable': 'mix', | ||||
| \   'command': 'mix help dogma && mix dogma %s --format=flycheck', | ||||
| \   'command_callback': 'ale_linters#elixir#dogma#GetCommand', | ||||
| \   'lint_file': 1, | ||||
| \   'callback': 'ale_linters#elixir#dogma#Handle', | ||||
| \}) | ||||
|  | ||||
							
								
								
									
										19
									
								
								sources_non_forked/ale/ale_linters/elixir/elixir_ls.vim
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								sources_non_forked/ale/ale_linters/elixir/elixir_ls.vim
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,19 @@ | ||||
| " Author: Jon Parise <jon@indelible.org> | ||||
| " Description: elixir-ls integration (https://github.com/JakeBecker/elixir-ls) | ||||
|  | ||||
| call ale#Set('elixir_elixir_ls_release', 'elixir-ls') | ||||
|  | ||||
| function! ale_linters#elixir#elixir_ls#GetExecutable(buffer) abort | ||||
|     let l:dir = ale#path#Simplify(ale#Var(a:buffer, 'elixir_elixir_ls_release')) | ||||
|     let l:cmd = ale#Has('win32') ? '\language_server.bat' : '/language_server.sh' | ||||
|  | ||||
|     return l:dir . l:cmd | ||||
| endfunction | ||||
|  | ||||
| call ale#linter#Define('elixir', { | ||||
| \   'name': 'elixir-ls', | ||||
| \   'lsp': 'stdio', | ||||
| \   'executable_callback': 'ale_linters#elixir#elixir_ls#GetExecutable', | ||||
| \   'command_callback': 'ale_linters#elixir#elixir_ls#GetExecutable', | ||||
| \   'project_root_callback': 'ale#handlers#elixir#FindMixProjectRoot', | ||||
| \}) | ||||
| @ -29,18 +29,8 @@ function! ale_linters#elixir#mix#Handle(buffer, lines) abort | ||||
|     return l:output | ||||
| endfunction | ||||
|  | ||||
| function! ale_linters#elixir#mix#FindProjectRoot(buffer) abort | ||||
|     let l:mix_file = ale#path#FindNearestFile(a:buffer, 'mix.exs') | ||||
|  | ||||
|     if !empty(l:mix_file) | ||||
|       return fnamemodify(l:mix_file, ':p:h') | ||||
|     endif | ||||
|  | ||||
|     return '.' | ||||
| endfunction | ||||
|  | ||||
| function! ale_linters#elixir#mix#GetCommand(buffer) abort | ||||
|     let l:project_root = ale_linters#elixir#mix#FindProjectRoot(a:buffer) | ||||
|     let l:project_root = ale#handlers#elixir#FindMixProjectRoot(a:buffer) | ||||
|  | ||||
|     let l:temp_dir = ale#engine#CreateDirectory(a:buffer) | ||||
|  | ||||
| @ -49,8 +39,8 @@ function! ale_linters#elixir#mix#GetCommand(buffer) abort | ||||
|     \   : 'MIX_BUILD_PATH=' . ale#Escape(l:temp_dir) | ||||
|  | ||||
|     return ale#path#CdString(l:project_root) | ||||
|           \ . l:mix_build_path | ||||
|           \ . ' mix compile %s' | ||||
|     \ . l:mix_build_path | ||||
|     \ . ' mix compile %s' | ||||
| endfunction | ||||
|  | ||||
| call ale#linter#Define('elixir', { | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Amir Salihefendic
					Amir Salihefendic