vscode-java
vscode-java copied to clipboard
be smarter on inferring types when collection type does not match
I had this code first:
final Map<String, String> messages = new HashMap<>();
Then changed it to:
final List<Map<String, String>> messages = new HashMap<>();
Now vscode just complains about not being able to infer the right types and no quick fix available.
Given the left side explicitly says this needs to be a List not a Map derivative anymore could a quickfix
not suggest to make it new ArrayList<>(); as a decent fix to make it compile ?
Similar would work for Set, Map, and other collection types.
We'll need JDT-LS updated to at least I20240628-1800 ( to be built today) in the target file, to take advantage of the feature/API.