Is there a way to output all classes available for import with gradle/maven












-1















I'm a vim/neovim user and I'm wondering whether I can simplify the task of adding imports to a file java without resorting to use intellij or language server.
So my idea was to get a list of all classes and then use this list in some way to insert an import statement.



To illustrate my idea. Say my cursor is here.



var a = List.of(1);
^


I'm invoking some vimscript and it gives me filterable list of imports that include List



Maybe something similar to hoogle?










share|improve this question




















  • 1





    Sorry but using vim as an IDE for Java does not make sense. Use an real IDE like Eclipse, IDEA IntelliJ or Netbeans which offers much more than simply adding imports etc....

    – khmarbaise
    Jan 1 at 14:24











  • It makes as much sense as using vim for any other language. Especially since language servers came up. All IDE's have a lot of bloat in the interface and don't provide efficient window navigation for example. Intellij has decent vim emulator, but it misses some important features like functionality provided by commentary, exchange and other plugins.

    – user1685095
    Jan 1 at 16:31











  • Maybe It would make sense for other languages than Java but I have my doubts cause I've worked with several languages like Go, Ruby etc. and and IDE helps and makes many things fast and easy. The windows navigation is a part which you need to learn in an IDE (learn the keyboard shortcuts) and maybe you need to map some keystrokes different to fit more your own needs. And what kind of feature you mean about commentary exchanges and what other plugins are you talking about? Apart from that for your imports: IntelliJ you just use Ctrl-Alt-O (for imports) in Eclipse Shift-Command-O etc. ?

    – khmarbaise
    Jan 1 at 20:47


















-1















I'm a vim/neovim user and I'm wondering whether I can simplify the task of adding imports to a file java without resorting to use intellij or language server.
So my idea was to get a list of all classes and then use this list in some way to insert an import statement.



To illustrate my idea. Say my cursor is here.



var a = List.of(1);
^


I'm invoking some vimscript and it gives me filterable list of imports that include List



Maybe something similar to hoogle?










share|improve this question




















  • 1





    Sorry but using vim as an IDE for Java does not make sense. Use an real IDE like Eclipse, IDEA IntelliJ or Netbeans which offers much more than simply adding imports etc....

    – khmarbaise
    Jan 1 at 14:24











  • It makes as much sense as using vim for any other language. Especially since language servers came up. All IDE's have a lot of bloat in the interface and don't provide efficient window navigation for example. Intellij has decent vim emulator, but it misses some important features like functionality provided by commentary, exchange and other plugins.

    – user1685095
    Jan 1 at 16:31











  • Maybe It would make sense for other languages than Java but I have my doubts cause I've worked with several languages like Go, Ruby etc. and and IDE helps and makes many things fast and easy. The windows navigation is a part which you need to learn in an IDE (learn the keyboard shortcuts) and maybe you need to map some keystrokes different to fit more your own needs. And what kind of feature you mean about commentary exchanges and what other plugins are you talking about? Apart from that for your imports: IntelliJ you just use Ctrl-Alt-O (for imports) in Eclipse Shift-Command-O etc. ?

    – khmarbaise
    Jan 1 at 20:47
















-1












-1








-1








I'm a vim/neovim user and I'm wondering whether I can simplify the task of adding imports to a file java without resorting to use intellij or language server.
So my idea was to get a list of all classes and then use this list in some way to insert an import statement.



To illustrate my idea. Say my cursor is here.



var a = List.of(1);
^


I'm invoking some vimscript and it gives me filterable list of imports that include List



Maybe something similar to hoogle?










share|improve this question
















I'm a vim/neovim user and I'm wondering whether I can simplify the task of adding imports to a file java without resorting to use intellij or language server.
So my idea was to get a list of all classes and then use this list in some way to insert an import statement.



To illustrate my idea. Say my cursor is here.



var a = List.of(1);
^


I'm invoking some vimscript and it gives me filterable list of imports that include List



Maybe something similar to hoogle?







java maven gradle






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 1 at 13:57







user1685095

















asked Jan 1 at 13:47









user1685095user1685095

2,11632763




2,11632763








  • 1





    Sorry but using vim as an IDE for Java does not make sense. Use an real IDE like Eclipse, IDEA IntelliJ or Netbeans which offers much more than simply adding imports etc....

    – khmarbaise
    Jan 1 at 14:24











  • It makes as much sense as using vim for any other language. Especially since language servers came up. All IDE's have a lot of bloat in the interface and don't provide efficient window navigation for example. Intellij has decent vim emulator, but it misses some important features like functionality provided by commentary, exchange and other plugins.

    – user1685095
    Jan 1 at 16:31











  • Maybe It would make sense for other languages than Java but I have my doubts cause I've worked with several languages like Go, Ruby etc. and and IDE helps and makes many things fast and easy. The windows navigation is a part which you need to learn in an IDE (learn the keyboard shortcuts) and maybe you need to map some keystrokes different to fit more your own needs. And what kind of feature you mean about commentary exchanges and what other plugins are you talking about? Apart from that for your imports: IntelliJ you just use Ctrl-Alt-O (for imports) in Eclipse Shift-Command-O etc. ?

    – khmarbaise
    Jan 1 at 20:47
















  • 1





    Sorry but using vim as an IDE for Java does not make sense. Use an real IDE like Eclipse, IDEA IntelliJ or Netbeans which offers much more than simply adding imports etc....

    – khmarbaise
    Jan 1 at 14:24











  • It makes as much sense as using vim for any other language. Especially since language servers came up. All IDE's have a lot of bloat in the interface and don't provide efficient window navigation for example. Intellij has decent vim emulator, but it misses some important features like functionality provided by commentary, exchange and other plugins.

    – user1685095
    Jan 1 at 16:31











  • Maybe It would make sense for other languages than Java but I have my doubts cause I've worked with several languages like Go, Ruby etc. and and IDE helps and makes many things fast and easy. The windows navigation is a part which you need to learn in an IDE (learn the keyboard shortcuts) and maybe you need to map some keystrokes different to fit more your own needs. And what kind of feature you mean about commentary exchanges and what other plugins are you talking about? Apart from that for your imports: IntelliJ you just use Ctrl-Alt-O (for imports) in Eclipse Shift-Command-O etc. ?

    – khmarbaise
    Jan 1 at 20:47










1




1





Sorry but using vim as an IDE for Java does not make sense. Use an real IDE like Eclipse, IDEA IntelliJ or Netbeans which offers much more than simply adding imports etc....

– khmarbaise
Jan 1 at 14:24





Sorry but using vim as an IDE for Java does not make sense. Use an real IDE like Eclipse, IDEA IntelliJ or Netbeans which offers much more than simply adding imports etc....

– khmarbaise
Jan 1 at 14:24













It makes as much sense as using vim for any other language. Especially since language servers came up. All IDE's have a lot of bloat in the interface and don't provide efficient window navigation for example. Intellij has decent vim emulator, but it misses some important features like functionality provided by commentary, exchange and other plugins.

– user1685095
Jan 1 at 16:31





It makes as much sense as using vim for any other language. Especially since language servers came up. All IDE's have a lot of bloat in the interface and don't provide efficient window navigation for example. Intellij has decent vim emulator, but it misses some important features like functionality provided by commentary, exchange and other plugins.

– user1685095
Jan 1 at 16:31













Maybe It would make sense for other languages than Java but I have my doubts cause I've worked with several languages like Go, Ruby etc. and and IDE helps and makes many things fast and easy. The windows navigation is a part which you need to learn in an IDE (learn the keyboard shortcuts) and maybe you need to map some keystrokes different to fit more your own needs. And what kind of feature you mean about commentary exchanges and what other plugins are you talking about? Apart from that for your imports: IntelliJ you just use Ctrl-Alt-O (for imports) in Eclipse Shift-Command-O etc. ?

– khmarbaise
Jan 1 at 20:47







Maybe It would make sense for other languages than Java but I have my doubts cause I've worked with several languages like Go, Ruby etc. and and IDE helps and makes many things fast and easy. The windows navigation is a part which you need to learn in an IDE (learn the keyboard shortcuts) and maybe you need to map some keystrokes different to fit more your own needs. And what kind of feature you mean about commentary exchanges and what other plugins are you talking about? Apart from that for your imports: IntelliJ you just use Ctrl-Alt-O (for imports) in Eclipse Shift-Command-O etc. ?

– khmarbaise
Jan 1 at 20:47














3 Answers
3






active

oldest

votes


















0














You could write a gradle task to output all classes to a file. Eg



task dumpClasses {
inputs.files configurations.compile
outputs.file "$buildDir/dumpClasses.txt"
doLast {
file("$buildDir/dumpClasses.txt").withWriter { writer ->
configurations.compile.each { file ->
FileTree tree = file.name.endsWith('.jar')
? zipTree(file)
: (file.directory ? fileTree(file) : null)
if (tree) {
tree.matching { include '**/*.class' }.each {
writer.println(it.name)
}
}
}
}
}
}





share|improve this answer
























  • Could it be modified to output to stdout?

    – user1685095
    Jan 1 at 16:20











  • On the second thought it wouldn't show any functions defined in this classes, so it isn't very helpful. But thanks anyway.

    – user1685095
    Jan 1 at 16:33











  • Have you assumed that I downvoted your answer?

    – user1685095
    Jan 1 at 19:05








  • 1





    Whoops! Your "so it isn't very helpful" comment and the downvote happened pretty much at the same time so yeah, I assumed it was you... appoligies. Stack overflow doesn't let us know who down voted

    – lance-java
    Jan 1 at 23:01













  • No problem. The downvote is strange though. You answered my question exactly!

    – user1685095
    Jan 1 at 23:28



















0














These days Java IDE's are so smart that using anything else is essentially wasting your time (and therefore indirectly money).



It is very similar to using Notepad instead of Word until (or vim instead of LibreOffice) until you want to have grammar checking and embedded graphics etc. Of course you can do it given enough time or elbow grease but why reinvent all the wheels on the way. Emacs had a quite usable Java development environment back in the early 2000's which almost instantly lost to Eclipse when it came out.



As an example, IntelliJ now knows how to show the type of the current point in a chain of method calls (very frequent with streams) which to say it brief is very helpful when reading the code later.



IntelliJ screen shot



So, to get what you need you need an IDE anyway which can understand your code. Considered instead telling an IDE to launch vim on your source if you want to use the full power of vim? IntelliJ can pick up changes in the file system without being told.






share|improve this answer
























  • Guess what, the example you're showing is one of the things I don't like when working in intellij. And I've already mentioned bloated interface and the stupid usage of tabs as representation of opened files. And language servers give me all the smartness I need. When intellij would be able to refactor usage of null into Optional I will consider calling it smart. Right now all it's doing is very very basic.

    – user1685095
    Jan 1 at 19:16











  • I would really suggest to open issues on IDEA IntelliJ with your wishes you have if you find IDEA very basic it would really improve the usage of IDEA for yourself as well as for others...

    – khmarbaise
    Jan 1 at 20:53











  • @user1685095 I may underestimate the power of language servers. Personally I like vim a lot, but in my opinion it is just not the right tool for the job (as you already found yourself). I agree upto telling JetBrains what you would like. To my understanding they are fully aware that developer needs are what sells new licenses and it appears your needs have not been met yet. That said, I still think that you will have a hard time catching up to what others get for free, but if you can make it work it will be an interesting alternative. Personally I'd be very interested in what it can do.

    – Thorbjørn Ravn Andersen
    Jan 1 at 22:06











  • It took them 5 years or something to add ability to stage a single hunk in VCS. I wouldn't bother opening an issue. With language server I'm already able to automatically add import. I just like to have alternative if possible. Seems like it isn't with java.

    – user1685095
    Jan 1 at 22:52











  • By the way I can stage individual lines and even edit the index in vim since long time. And how much time do you think it will get for them to understand that If I invoke diff then it should show me the same part of code I was looking instead of scrolling to the start? The list goes on and on and on.

    – user1685095
    Jan 1 at 22:58



















-1














Have a look at vim-javacomplete2. One of its features is to automatically add imports, including static imports and imports of nested classes. It searches class files automatically using Maven, Gradle, or Eclipse's .classpath file.






share|improve this answer
























  • Have a look at java language server from eclipse =) I know about other ways to do this as I've said. I looking for something similar to hoogle for java.

    – user1685095
    Jan 1 at 16:22











  • Jeez, why the downvote? The question states "without resorting to language server", I provide a solution that does not involve a language server. The question is tagged with "gradle", "maven", and my solution works with both.

    – Martijn
    Jan 1 at 17:58











  • You should also be more specific as to what you mean by "Hoogle for Java." Do you want to search in more than just your project's classpath? Do you want approximate solutions (e.g. name partly matches)? Do you want solutions based on the expected type (instead of the function's name)?

    – Martijn
    Jan 1 at 18:03











  • classpath and just a name would be a start. No point in clarifying if even the basic thing can't be achieved.

    – user1685095
    Jan 1 at 19:18











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53995968%2fis-there-a-way-to-output-all-classes-available-for-import-with-gradle-maven%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























3 Answers
3






active

oldest

votes








3 Answers
3






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














You could write a gradle task to output all classes to a file. Eg



task dumpClasses {
inputs.files configurations.compile
outputs.file "$buildDir/dumpClasses.txt"
doLast {
file("$buildDir/dumpClasses.txt").withWriter { writer ->
configurations.compile.each { file ->
FileTree tree = file.name.endsWith('.jar')
? zipTree(file)
: (file.directory ? fileTree(file) : null)
if (tree) {
tree.matching { include '**/*.class' }.each {
writer.println(it.name)
}
}
}
}
}
}





share|improve this answer
























  • Could it be modified to output to stdout?

    – user1685095
    Jan 1 at 16:20











  • On the second thought it wouldn't show any functions defined in this classes, so it isn't very helpful. But thanks anyway.

    – user1685095
    Jan 1 at 16:33











  • Have you assumed that I downvoted your answer?

    – user1685095
    Jan 1 at 19:05








  • 1





    Whoops! Your "so it isn't very helpful" comment and the downvote happened pretty much at the same time so yeah, I assumed it was you... appoligies. Stack overflow doesn't let us know who down voted

    – lance-java
    Jan 1 at 23:01













  • No problem. The downvote is strange though. You answered my question exactly!

    – user1685095
    Jan 1 at 23:28
















0














You could write a gradle task to output all classes to a file. Eg



task dumpClasses {
inputs.files configurations.compile
outputs.file "$buildDir/dumpClasses.txt"
doLast {
file("$buildDir/dumpClasses.txt").withWriter { writer ->
configurations.compile.each { file ->
FileTree tree = file.name.endsWith('.jar')
? zipTree(file)
: (file.directory ? fileTree(file) : null)
if (tree) {
tree.matching { include '**/*.class' }.each {
writer.println(it.name)
}
}
}
}
}
}





share|improve this answer
























  • Could it be modified to output to stdout?

    – user1685095
    Jan 1 at 16:20











  • On the second thought it wouldn't show any functions defined in this classes, so it isn't very helpful. But thanks anyway.

    – user1685095
    Jan 1 at 16:33











  • Have you assumed that I downvoted your answer?

    – user1685095
    Jan 1 at 19:05








  • 1





    Whoops! Your "so it isn't very helpful" comment and the downvote happened pretty much at the same time so yeah, I assumed it was you... appoligies. Stack overflow doesn't let us know who down voted

    – lance-java
    Jan 1 at 23:01













  • No problem. The downvote is strange though. You answered my question exactly!

    – user1685095
    Jan 1 at 23:28














0












0








0







You could write a gradle task to output all classes to a file. Eg



task dumpClasses {
inputs.files configurations.compile
outputs.file "$buildDir/dumpClasses.txt"
doLast {
file("$buildDir/dumpClasses.txt").withWriter { writer ->
configurations.compile.each { file ->
FileTree tree = file.name.endsWith('.jar')
? zipTree(file)
: (file.directory ? fileTree(file) : null)
if (tree) {
tree.matching { include '**/*.class' }.each {
writer.println(it.name)
}
}
}
}
}
}





share|improve this answer













You could write a gradle task to output all classes to a file. Eg



task dumpClasses {
inputs.files configurations.compile
outputs.file "$buildDir/dumpClasses.txt"
doLast {
file("$buildDir/dumpClasses.txt").withWriter { writer ->
configurations.compile.each { file ->
FileTree tree = file.name.endsWith('.jar')
? zipTree(file)
: (file.directory ? fileTree(file) : null)
if (tree) {
tree.matching { include '**/*.class' }.each {
writer.println(it.name)
}
}
}
}
}
}






share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 1 at 14:02









lance-javalance-java

16.7k12961




16.7k12961













  • Could it be modified to output to stdout?

    – user1685095
    Jan 1 at 16:20











  • On the second thought it wouldn't show any functions defined in this classes, so it isn't very helpful. But thanks anyway.

    – user1685095
    Jan 1 at 16:33











  • Have you assumed that I downvoted your answer?

    – user1685095
    Jan 1 at 19:05








  • 1





    Whoops! Your "so it isn't very helpful" comment and the downvote happened pretty much at the same time so yeah, I assumed it was you... appoligies. Stack overflow doesn't let us know who down voted

    – lance-java
    Jan 1 at 23:01













  • No problem. The downvote is strange though. You answered my question exactly!

    – user1685095
    Jan 1 at 23:28



















  • Could it be modified to output to stdout?

    – user1685095
    Jan 1 at 16:20











  • On the second thought it wouldn't show any functions defined in this classes, so it isn't very helpful. But thanks anyway.

    – user1685095
    Jan 1 at 16:33











  • Have you assumed that I downvoted your answer?

    – user1685095
    Jan 1 at 19:05








  • 1





    Whoops! Your "so it isn't very helpful" comment and the downvote happened pretty much at the same time so yeah, I assumed it was you... appoligies. Stack overflow doesn't let us know who down voted

    – lance-java
    Jan 1 at 23:01













  • No problem. The downvote is strange though. You answered my question exactly!

    – user1685095
    Jan 1 at 23:28

















Could it be modified to output to stdout?

– user1685095
Jan 1 at 16:20





Could it be modified to output to stdout?

– user1685095
Jan 1 at 16:20













On the second thought it wouldn't show any functions defined in this classes, so it isn't very helpful. But thanks anyway.

– user1685095
Jan 1 at 16:33





On the second thought it wouldn't show any functions defined in this classes, so it isn't very helpful. But thanks anyway.

– user1685095
Jan 1 at 16:33













Have you assumed that I downvoted your answer?

– user1685095
Jan 1 at 19:05







Have you assumed that I downvoted your answer?

– user1685095
Jan 1 at 19:05






1




1





Whoops! Your "so it isn't very helpful" comment and the downvote happened pretty much at the same time so yeah, I assumed it was you... appoligies. Stack overflow doesn't let us know who down voted

– lance-java
Jan 1 at 23:01







Whoops! Your "so it isn't very helpful" comment and the downvote happened pretty much at the same time so yeah, I assumed it was you... appoligies. Stack overflow doesn't let us know who down voted

– lance-java
Jan 1 at 23:01















No problem. The downvote is strange though. You answered my question exactly!

– user1685095
Jan 1 at 23:28





No problem. The downvote is strange though. You answered my question exactly!

– user1685095
Jan 1 at 23:28













0














These days Java IDE's are so smart that using anything else is essentially wasting your time (and therefore indirectly money).



It is very similar to using Notepad instead of Word until (or vim instead of LibreOffice) until you want to have grammar checking and embedded graphics etc. Of course you can do it given enough time or elbow grease but why reinvent all the wheels on the way. Emacs had a quite usable Java development environment back in the early 2000's which almost instantly lost to Eclipse when it came out.



As an example, IntelliJ now knows how to show the type of the current point in a chain of method calls (very frequent with streams) which to say it brief is very helpful when reading the code later.



IntelliJ screen shot



So, to get what you need you need an IDE anyway which can understand your code. Considered instead telling an IDE to launch vim on your source if you want to use the full power of vim? IntelliJ can pick up changes in the file system without being told.






share|improve this answer
























  • Guess what, the example you're showing is one of the things I don't like when working in intellij. And I've already mentioned bloated interface and the stupid usage of tabs as representation of opened files. And language servers give me all the smartness I need. When intellij would be able to refactor usage of null into Optional I will consider calling it smart. Right now all it's doing is very very basic.

    – user1685095
    Jan 1 at 19:16











  • I would really suggest to open issues on IDEA IntelliJ with your wishes you have if you find IDEA very basic it would really improve the usage of IDEA for yourself as well as for others...

    – khmarbaise
    Jan 1 at 20:53











  • @user1685095 I may underestimate the power of language servers. Personally I like vim a lot, but in my opinion it is just not the right tool for the job (as you already found yourself). I agree upto telling JetBrains what you would like. To my understanding they are fully aware that developer needs are what sells new licenses and it appears your needs have not been met yet. That said, I still think that you will have a hard time catching up to what others get for free, but if you can make it work it will be an interesting alternative. Personally I'd be very interested in what it can do.

    – Thorbjørn Ravn Andersen
    Jan 1 at 22:06











  • It took them 5 years or something to add ability to stage a single hunk in VCS. I wouldn't bother opening an issue. With language server I'm already able to automatically add import. I just like to have alternative if possible. Seems like it isn't with java.

    – user1685095
    Jan 1 at 22:52











  • By the way I can stage individual lines and even edit the index in vim since long time. And how much time do you think it will get for them to understand that If I invoke diff then it should show me the same part of code I was looking instead of scrolling to the start? The list goes on and on and on.

    – user1685095
    Jan 1 at 22:58
















0














These days Java IDE's are so smart that using anything else is essentially wasting your time (and therefore indirectly money).



It is very similar to using Notepad instead of Word until (or vim instead of LibreOffice) until you want to have grammar checking and embedded graphics etc. Of course you can do it given enough time or elbow grease but why reinvent all the wheels on the way. Emacs had a quite usable Java development environment back in the early 2000's which almost instantly lost to Eclipse when it came out.



As an example, IntelliJ now knows how to show the type of the current point in a chain of method calls (very frequent with streams) which to say it brief is very helpful when reading the code later.



IntelliJ screen shot



So, to get what you need you need an IDE anyway which can understand your code. Considered instead telling an IDE to launch vim on your source if you want to use the full power of vim? IntelliJ can pick up changes in the file system without being told.






share|improve this answer
























  • Guess what, the example you're showing is one of the things I don't like when working in intellij. And I've already mentioned bloated interface and the stupid usage of tabs as representation of opened files. And language servers give me all the smartness I need. When intellij would be able to refactor usage of null into Optional I will consider calling it smart. Right now all it's doing is very very basic.

    – user1685095
    Jan 1 at 19:16











  • I would really suggest to open issues on IDEA IntelliJ with your wishes you have if you find IDEA very basic it would really improve the usage of IDEA for yourself as well as for others...

    – khmarbaise
    Jan 1 at 20:53











  • @user1685095 I may underestimate the power of language servers. Personally I like vim a lot, but in my opinion it is just not the right tool for the job (as you already found yourself). I agree upto telling JetBrains what you would like. To my understanding they are fully aware that developer needs are what sells new licenses and it appears your needs have not been met yet. That said, I still think that you will have a hard time catching up to what others get for free, but if you can make it work it will be an interesting alternative. Personally I'd be very interested in what it can do.

    – Thorbjørn Ravn Andersen
    Jan 1 at 22:06











  • It took them 5 years or something to add ability to stage a single hunk in VCS. I wouldn't bother opening an issue. With language server I'm already able to automatically add import. I just like to have alternative if possible. Seems like it isn't with java.

    – user1685095
    Jan 1 at 22:52











  • By the way I can stage individual lines and even edit the index in vim since long time. And how much time do you think it will get for them to understand that If I invoke diff then it should show me the same part of code I was looking instead of scrolling to the start? The list goes on and on and on.

    – user1685095
    Jan 1 at 22:58














0












0








0







These days Java IDE's are so smart that using anything else is essentially wasting your time (and therefore indirectly money).



It is very similar to using Notepad instead of Word until (or vim instead of LibreOffice) until you want to have grammar checking and embedded graphics etc. Of course you can do it given enough time or elbow grease but why reinvent all the wheels on the way. Emacs had a quite usable Java development environment back in the early 2000's which almost instantly lost to Eclipse when it came out.



As an example, IntelliJ now knows how to show the type of the current point in a chain of method calls (very frequent with streams) which to say it brief is very helpful when reading the code later.



IntelliJ screen shot



So, to get what you need you need an IDE anyway which can understand your code. Considered instead telling an IDE to launch vim on your source if you want to use the full power of vim? IntelliJ can pick up changes in the file system without being told.






share|improve this answer













These days Java IDE's are so smart that using anything else is essentially wasting your time (and therefore indirectly money).



It is very similar to using Notepad instead of Word until (or vim instead of LibreOffice) until you want to have grammar checking and embedded graphics etc. Of course you can do it given enough time or elbow grease but why reinvent all the wheels on the way. Emacs had a quite usable Java development environment back in the early 2000's which almost instantly lost to Eclipse when it came out.



As an example, IntelliJ now knows how to show the type of the current point in a chain of method calls (very frequent with streams) which to say it brief is very helpful when reading the code later.



IntelliJ screen shot



So, to get what you need you need an IDE anyway which can understand your code. Considered instead telling an IDE to launch vim on your source if you want to use the full power of vim? IntelliJ can pick up changes in the file system without being told.







share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 1 at 17:38









Thorbjørn Ravn AndersenThorbjørn Ravn Andersen

57.9k24149288




57.9k24149288













  • Guess what, the example you're showing is one of the things I don't like when working in intellij. And I've already mentioned bloated interface and the stupid usage of tabs as representation of opened files. And language servers give me all the smartness I need. When intellij would be able to refactor usage of null into Optional I will consider calling it smart. Right now all it's doing is very very basic.

    – user1685095
    Jan 1 at 19:16











  • I would really suggest to open issues on IDEA IntelliJ with your wishes you have if you find IDEA very basic it would really improve the usage of IDEA for yourself as well as for others...

    – khmarbaise
    Jan 1 at 20:53











  • @user1685095 I may underestimate the power of language servers. Personally I like vim a lot, but in my opinion it is just not the right tool for the job (as you already found yourself). I agree upto telling JetBrains what you would like. To my understanding they are fully aware that developer needs are what sells new licenses and it appears your needs have not been met yet. That said, I still think that you will have a hard time catching up to what others get for free, but if you can make it work it will be an interesting alternative. Personally I'd be very interested in what it can do.

    – Thorbjørn Ravn Andersen
    Jan 1 at 22:06











  • It took them 5 years or something to add ability to stage a single hunk in VCS. I wouldn't bother opening an issue. With language server I'm already able to automatically add import. I just like to have alternative if possible. Seems like it isn't with java.

    – user1685095
    Jan 1 at 22:52











  • By the way I can stage individual lines and even edit the index in vim since long time. And how much time do you think it will get for them to understand that If I invoke diff then it should show me the same part of code I was looking instead of scrolling to the start? The list goes on and on and on.

    – user1685095
    Jan 1 at 22:58



















  • Guess what, the example you're showing is one of the things I don't like when working in intellij. And I've already mentioned bloated interface and the stupid usage of tabs as representation of opened files. And language servers give me all the smartness I need. When intellij would be able to refactor usage of null into Optional I will consider calling it smart. Right now all it's doing is very very basic.

    – user1685095
    Jan 1 at 19:16











  • I would really suggest to open issues on IDEA IntelliJ with your wishes you have if you find IDEA very basic it would really improve the usage of IDEA for yourself as well as for others...

    – khmarbaise
    Jan 1 at 20:53











  • @user1685095 I may underestimate the power of language servers. Personally I like vim a lot, but in my opinion it is just not the right tool for the job (as you already found yourself). I agree upto telling JetBrains what you would like. To my understanding they are fully aware that developer needs are what sells new licenses and it appears your needs have not been met yet. That said, I still think that you will have a hard time catching up to what others get for free, but if you can make it work it will be an interesting alternative. Personally I'd be very interested in what it can do.

    – Thorbjørn Ravn Andersen
    Jan 1 at 22:06











  • It took them 5 years or something to add ability to stage a single hunk in VCS. I wouldn't bother opening an issue. With language server I'm already able to automatically add import. I just like to have alternative if possible. Seems like it isn't with java.

    – user1685095
    Jan 1 at 22:52











  • By the way I can stage individual lines and even edit the index in vim since long time. And how much time do you think it will get for them to understand that If I invoke diff then it should show me the same part of code I was looking instead of scrolling to the start? The list goes on and on and on.

    – user1685095
    Jan 1 at 22:58

















Guess what, the example you're showing is one of the things I don't like when working in intellij. And I've already mentioned bloated interface and the stupid usage of tabs as representation of opened files. And language servers give me all the smartness I need. When intellij would be able to refactor usage of null into Optional I will consider calling it smart. Right now all it's doing is very very basic.

– user1685095
Jan 1 at 19:16





Guess what, the example you're showing is one of the things I don't like when working in intellij. And I've already mentioned bloated interface and the stupid usage of tabs as representation of opened files. And language servers give me all the smartness I need. When intellij would be able to refactor usage of null into Optional I will consider calling it smart. Right now all it's doing is very very basic.

– user1685095
Jan 1 at 19:16













I would really suggest to open issues on IDEA IntelliJ with your wishes you have if you find IDEA very basic it would really improve the usage of IDEA for yourself as well as for others...

– khmarbaise
Jan 1 at 20:53





I would really suggest to open issues on IDEA IntelliJ with your wishes you have if you find IDEA very basic it would really improve the usage of IDEA for yourself as well as for others...

– khmarbaise
Jan 1 at 20:53













@user1685095 I may underestimate the power of language servers. Personally I like vim a lot, but in my opinion it is just not the right tool for the job (as you already found yourself). I agree upto telling JetBrains what you would like. To my understanding they are fully aware that developer needs are what sells new licenses and it appears your needs have not been met yet. That said, I still think that you will have a hard time catching up to what others get for free, but if you can make it work it will be an interesting alternative. Personally I'd be very interested in what it can do.

– Thorbjørn Ravn Andersen
Jan 1 at 22:06





@user1685095 I may underestimate the power of language servers. Personally I like vim a lot, but in my opinion it is just not the right tool for the job (as you already found yourself). I agree upto telling JetBrains what you would like. To my understanding they are fully aware that developer needs are what sells new licenses and it appears your needs have not been met yet. That said, I still think that you will have a hard time catching up to what others get for free, but if you can make it work it will be an interesting alternative. Personally I'd be very interested in what it can do.

– Thorbjørn Ravn Andersen
Jan 1 at 22:06













It took them 5 years or something to add ability to stage a single hunk in VCS. I wouldn't bother opening an issue. With language server I'm already able to automatically add import. I just like to have alternative if possible. Seems like it isn't with java.

– user1685095
Jan 1 at 22:52





It took them 5 years or something to add ability to stage a single hunk in VCS. I wouldn't bother opening an issue. With language server I'm already able to automatically add import. I just like to have alternative if possible. Seems like it isn't with java.

– user1685095
Jan 1 at 22:52













By the way I can stage individual lines and even edit the index in vim since long time. And how much time do you think it will get for them to understand that If I invoke diff then it should show me the same part of code I was looking instead of scrolling to the start? The list goes on and on and on.

– user1685095
Jan 1 at 22:58





By the way I can stage individual lines and even edit the index in vim since long time. And how much time do you think it will get for them to understand that If I invoke diff then it should show me the same part of code I was looking instead of scrolling to the start? The list goes on and on and on.

– user1685095
Jan 1 at 22:58











-1














Have a look at vim-javacomplete2. One of its features is to automatically add imports, including static imports and imports of nested classes. It searches class files automatically using Maven, Gradle, or Eclipse's .classpath file.






share|improve this answer
























  • Have a look at java language server from eclipse =) I know about other ways to do this as I've said. I looking for something similar to hoogle for java.

    – user1685095
    Jan 1 at 16:22











  • Jeez, why the downvote? The question states "without resorting to language server", I provide a solution that does not involve a language server. The question is tagged with "gradle", "maven", and my solution works with both.

    – Martijn
    Jan 1 at 17:58











  • You should also be more specific as to what you mean by "Hoogle for Java." Do you want to search in more than just your project's classpath? Do you want approximate solutions (e.g. name partly matches)? Do you want solutions based on the expected type (instead of the function's name)?

    – Martijn
    Jan 1 at 18:03











  • classpath and just a name would be a start. No point in clarifying if even the basic thing can't be achieved.

    – user1685095
    Jan 1 at 19:18
















-1














Have a look at vim-javacomplete2. One of its features is to automatically add imports, including static imports and imports of nested classes. It searches class files automatically using Maven, Gradle, or Eclipse's .classpath file.






share|improve this answer
























  • Have a look at java language server from eclipse =) I know about other ways to do this as I've said. I looking for something similar to hoogle for java.

    – user1685095
    Jan 1 at 16:22











  • Jeez, why the downvote? The question states "without resorting to language server", I provide a solution that does not involve a language server. The question is tagged with "gradle", "maven", and my solution works with both.

    – Martijn
    Jan 1 at 17:58











  • You should also be more specific as to what you mean by "Hoogle for Java." Do you want to search in more than just your project's classpath? Do you want approximate solutions (e.g. name partly matches)? Do you want solutions based on the expected type (instead of the function's name)?

    – Martijn
    Jan 1 at 18:03











  • classpath and just a name would be a start. No point in clarifying if even the basic thing can't be achieved.

    – user1685095
    Jan 1 at 19:18














-1












-1








-1







Have a look at vim-javacomplete2. One of its features is to automatically add imports, including static imports and imports of nested classes. It searches class files automatically using Maven, Gradle, or Eclipse's .classpath file.






share|improve this answer













Have a look at vim-javacomplete2. One of its features is to automatically add imports, including static imports and imports of nested classes. It searches class files automatically using Maven, Gradle, or Eclipse's .classpath file.







share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 1 at 14:03









MartijnMartijn

3,68842235




3,68842235













  • Have a look at java language server from eclipse =) I know about other ways to do this as I've said. I looking for something similar to hoogle for java.

    – user1685095
    Jan 1 at 16:22











  • Jeez, why the downvote? The question states "without resorting to language server", I provide a solution that does not involve a language server. The question is tagged with "gradle", "maven", and my solution works with both.

    – Martijn
    Jan 1 at 17:58











  • You should also be more specific as to what you mean by "Hoogle for Java." Do you want to search in more than just your project's classpath? Do you want approximate solutions (e.g. name partly matches)? Do you want solutions based on the expected type (instead of the function's name)?

    – Martijn
    Jan 1 at 18:03











  • classpath and just a name would be a start. No point in clarifying if even the basic thing can't be achieved.

    – user1685095
    Jan 1 at 19:18



















  • Have a look at java language server from eclipse =) I know about other ways to do this as I've said. I looking for something similar to hoogle for java.

    – user1685095
    Jan 1 at 16:22











  • Jeez, why the downvote? The question states "without resorting to language server", I provide a solution that does not involve a language server. The question is tagged with "gradle", "maven", and my solution works with both.

    – Martijn
    Jan 1 at 17:58











  • You should also be more specific as to what you mean by "Hoogle for Java." Do you want to search in more than just your project's classpath? Do you want approximate solutions (e.g. name partly matches)? Do you want solutions based on the expected type (instead of the function's name)?

    – Martijn
    Jan 1 at 18:03











  • classpath and just a name would be a start. No point in clarifying if even the basic thing can't be achieved.

    – user1685095
    Jan 1 at 19:18

















Have a look at java language server from eclipse =) I know about other ways to do this as I've said. I looking for something similar to hoogle for java.

– user1685095
Jan 1 at 16:22





Have a look at java language server from eclipse =) I know about other ways to do this as I've said. I looking for something similar to hoogle for java.

– user1685095
Jan 1 at 16:22













Jeez, why the downvote? The question states "without resorting to language server", I provide a solution that does not involve a language server. The question is tagged with "gradle", "maven", and my solution works with both.

– Martijn
Jan 1 at 17:58





Jeez, why the downvote? The question states "without resorting to language server", I provide a solution that does not involve a language server. The question is tagged with "gradle", "maven", and my solution works with both.

– Martijn
Jan 1 at 17:58













You should also be more specific as to what you mean by "Hoogle for Java." Do you want to search in more than just your project's classpath? Do you want approximate solutions (e.g. name partly matches)? Do you want solutions based on the expected type (instead of the function's name)?

– Martijn
Jan 1 at 18:03





You should also be more specific as to what you mean by "Hoogle for Java." Do you want to search in more than just your project's classpath? Do you want approximate solutions (e.g. name partly matches)? Do you want solutions based on the expected type (instead of the function's name)?

– Martijn
Jan 1 at 18:03













classpath and just a name would be a start. No point in clarifying if even the basic thing can't be achieved.

– user1685095
Jan 1 at 19:18





classpath and just a name would be a start. No point in clarifying if even the basic thing can't be achieved.

– user1685095
Jan 1 at 19:18


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53995968%2fis-there-a-way-to-output-all-classes-available-for-import-with-gradle-maven%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Monofisismo

Angular Downloading a file using contenturl with Basic Authentication

Olmecas