coc-java icon indicating copy to clipboard operation
coc-java copied to clipboard

Not getting static import of a method as refactoring suggestion.

Open JSamir opened this issue 6 years ago • 1 comments

Hi,

in this commit the following functionality was added: get a proposal for static import of a method in quick assist. Note that this was later moved to something refactoring related, but it should be there nevertheless.

When i hover over a method which i would like to import statically, i do not get the suggestion for static import. Not in quick fix and also not in the refactoring menu.

Is this intended or should coc-java behave the same as vscode here?

JSamir avatar Jan 09 '20 10:01 JSamir

Depending on the static methods you're trying to use you may need to set the java.completion.favoriteStaticMembers configuration. By default it completes static members in these paths:

[
  "org.junit.Assert.*",
  "org.junit.Assume.*",
  "org.junit.jupiter.api.Assertions.*",
  "org.junit.jupiter.api.Assumptions.*",
  "org.junit.jupiter.api.DynamicContainer.*",
  "org.junit.jupiter.api.DynamicTest.*",
  "org.mockito.Mockito.*",
  "org.mockito.ArgumentMatchers.*",
  "org.mockito.Answers.*"
]

dansomething avatar Oct 20 '20 21:10 dansomething