mirror of
				https://github.com/amix/vimrc
				synced 2025-10-31 14:43:35 +08:00 
			
		
		
		
	Updated plugins
This commit is contained in:
		| @ -44,7 +44,7 @@ endif | ||||
| call ale#linter#Define('java', { | ||||
| \   'name': 'checkstyle', | ||||
| \   'executable': 'checkstyle', | ||||
| \   'command_callback': 'ale_linters#java#checkstyle#GetCommand', | ||||
| \   'command': function('ale_linters#java#checkstyle#GetCommand'), | ||||
| \   'callback': 'ale_linters#java#checkstyle#Handle', | ||||
| \   'lint_file': 1, | ||||
| \}) | ||||
|  | ||||
| @ -55,15 +55,14 @@ function! ale_linters#java#javac#GetCommand(buffer, import_paths) abort | ||||
|         if isdirectory(l:jaxb_dir) | ||||
|             call add(l:sp_dirs, l:jaxb_dir) | ||||
|         endif | ||||
|     endif | ||||
|  | ||||
|         " Automatically include the test directory, but only for test code. | ||||
|         if expand('#' . a:buffer . ':p') =~? '\vsrc[/\\]test[/\\]java' | ||||
|             let l:test_dir = fnamemodify(l:src_dir, ':h:h:h') | ||||
|             \   . (has('win32') ? '\test\java\' : '/test/java/') | ||||
|     " Automatically include the test directory, but only for test code. | ||||
|     if expand('#' . a:buffer . ':p') =~? '\vsrc[/\\]test[/\\]java' | ||||
|         let l:test_dir = ale#path#FindNearestDirectory(a:buffer, 'src/test/java') | ||||
|  | ||||
|             if isdirectory(l:test_dir) | ||||
|                 call add(l:sp_dirs, l:test_dir) | ||||
|             endif | ||||
|         if isdirectory(l:test_dir) | ||||
|             call add(l:sp_dirs, l:test_dir) | ||||
|         endif | ||||
|     endif | ||||
|  | ||||
| @ -73,7 +72,7 @@ function! ale_linters#java#javac#GetCommand(buffer, import_paths) abort | ||||
|     endif | ||||
|  | ||||
|     " Create .class files in a temporary directory, which we will delete later. | ||||
|     let l:class_file_directory = ale#engine#CreateDirectory(a:buffer) | ||||
|     let l:class_file_directory = ale#command#CreateDirectory(a:buffer) | ||||
|  | ||||
|     " Always run javac from the directory the file is in, so we can resolve | ||||
|     " relative paths correctly. | ||||
| @ -120,7 +119,7 @@ endfunction | ||||
|  | ||||
| call ale#linter#Define('java', { | ||||
| \   'name': 'javac', | ||||
| \   'executable_callback': ale#VarFunc('java_javac_executable'), | ||||
| \   'executable': {b -> ale#Var(b, 'java_javac_executable')}, | ||||
| \   'command_chain': [ | ||||
| \       {'callback': 'ale_linters#java#javac#GetImportPaths', 'output_stream': 'stdout'}, | ||||
| \       {'callback': 'ale_linters#java#javac#GetCommand', 'output_stream': 'stderr'}, | ||||
|  | ||||
| @ -1,7 +1,6 @@ | ||||
| " Author: Horacio Sanson <https://github.com/hsanson> | ||||
| " Description: Support for the Java language server https://github.com/georgewfraser/vscode-javac | ||||
|  | ||||
| call ale#Set('java_javalsp_jar', 'javacs.jar') | ||||
| call ale#Set('java_javalsp_executable', 'java') | ||||
|  | ||||
| function! ale_linters#java#javalsp#Executable(buffer) abort | ||||
| @ -9,17 +8,16 @@ function! ale_linters#java#javalsp#Executable(buffer) abort | ||||
| endfunction | ||||
|  | ||||
| function! ale_linters#java#javalsp#Command(buffer) abort | ||||
|     let l:jar = ale#Var(a:buffer, 'java_javalsp_jar') | ||||
|     let l:executable = ale_linters#java#javalsp#Executable(a:buffer) | ||||
|  | ||||
|     return ale#Escape(l:executable) . ' -cp ' . l:jar . ' -Xverify:none org.javacs.Main' | ||||
|     return ale#Escape(l:executable) . ' -Xverify:none -m javacs/org.javacs.Main' | ||||
| endfunction | ||||
|  | ||||
| call ale#linter#Define('java', { | ||||
| \   'name': 'javalsp', | ||||
| \   'lsp': 'stdio', | ||||
| \   'executable_callback': 'ale_linters#java#javalsp#Executable', | ||||
| \   'command_callback': 'ale_linters#java#javalsp#Command', | ||||
| \   'executable': function('ale_linters#java#javalsp#Executable'), | ||||
| \   'command': function('ale_linters#java#javalsp#Command'), | ||||
| \   'language': 'java', | ||||
| \   'project_root_callback': 'ale#java#FindProjectRoot', | ||||
| \   'project_root': function('ale#java#FindProjectRoot'), | ||||
| \}) | ||||
|  | ||||
| @ -31,6 +31,6 @@ endif | ||||
| call ale#linter#Define('java', { | ||||
| \   'name': 'pmd', | ||||
| \   'executable': 'pmd', | ||||
| \   'command_callback': 'ale_linters#java#pmd#GetCommand', | ||||
| \   'command': function('ale_linters#java#pmd#GetCommand'), | ||||
| \   'callback': 'ale_linters#java#pmd#Handle', | ||||
| \}) | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Amir Salihefendic
					Amir Salihefendic