Since a few versions, IntelliJ has a very helpful feature: when you put the individual method calls of a stream() statement on separate lines, IntelliJ puts type information on each line:
But when you don't call stream() directly, like when it is returned from another method, that information is omitted:
Is there a way to convince IntelliJ to show such type information for such situations, too?
As pure text, with manually inserted comments to "show" the problem with pure text:
public Stream<Entry<String, String>> withTypeInformation() {
return generateMap() // Map<String, String>
.entrySet() // Set<Entry<String, String>>
.stream() // Stream<Set<Entry<String, String>>>
.filter(e -> !e.getKey().equals("foo")) // Stream<Set<Entry<String, String>>>
.filter(e -> !e.getKey().equals("bar")) // Stream<Set<Entry<String, String>>>
.filter(e -> !e.getKey().equals("now"));
}
public Stream<Entry<String, String>> withoutTypeInformation() {
return withTypeInformation() // no such info
.filter(e -> !e.getKey().equals("foo")) // not here either
.filter(e -> !e.getKey().equals("bar")) // guess what, nothing, too
.filter(e -> !e.getKey().equals("now"));
}
And note: the first method uses a generator method that returns a map instance. There IntelliJ is smart enough to give me the type information?!

