dense-analysis / ale

Check syntax in Vim/Neovim asynchronously and fix files, with Language Server Protocol (LSP) support
BSD 2-Clause "Simplified" License
13.49k stars 1.43k forks source link

Automatically detect class path for Java (Eclipse) #1175

Open bmedicke opened 6 years ago

bmedicke commented 6 years ago

Relevant to #417.

I'm using ALE with eclim and the default Eclipse project structure (Java source files directly in src/). By default ALE won't find my .java files.

For now I have solved it by changing line 43 in ale_linters/java/javac.vim to: let l:src_dir = ale#path#FindNearestDirectory(a:buffer, 'src/')

This probably won't play well with the Maven project structure though. Eclipse uses an xml file (.classpath) in the root of the project to store the paths, maybe that can be used.

w0rp commented 6 years ago

It looks for Maven and Gradle files at the moment. Maybe it could parse .classpath files too. Is there a command line tool you can run for converting the XML into lines of paths?

grundic commented 6 years ago

Probably eclipse-to-maven project can help in this case?

w0rp commented 6 years ago

It would be nice if there is a command that can be run for reading .classpath which people are more than likely to have installed already.

Axioplase commented 5 years ago

Hi! Is there a plan to support .classpath files somewhere in the file's path?

w0rp commented 5 years ago

There's no plan, but it would be nice.

ipkiss42 commented 4 years ago

It might not have been true at the time this issue was opened, but nowadays you could use the eclipselsp linter (which relies on a .classpath file) instead of javac. It works fine for me, I simply disabled javac.