Skip to content

fix: Show the hints in Java Projects explorer properly#547

Merged
jdneo merged 3 commits intomainfrom
cs/show-java-explorer-properly
Sep 16, 2021
Merged

fix: Show the hints in Java Projects explorer properly#547
jdneo merged 3 commits intomainfrom
cs/show-java-explorer-properly

Conversation

@jdneo
Copy link
Copy Markdown
Member

@jdneo jdneo commented Sep 14, 2021

The PR is to let the Java Project explorer properly show hints for users:

  • When redhat.java is not installed, hint for installation
  • When no Java projects found, hint for creation/opening
  • When JDT.LS in Lightweight mdoe, hint for switching.

Now the activation events is the same as redhat.java. But since events like workspaceContains is not supported in when clause, so I use APIs to query files during activation and set context value to imitate the condition:

  • resourceLangId == java is for onLanguage:java
  • java:workspaceContainsBuildFiles -> workspaceContains
  • java:serverMode is to make sure the explorer will always visible once JDT.LS is activated. (still visible when user switch focus to a non-Java file)

fix #551

@jdneo jdneo added this to the 0.18.8 milestone Sep 14, 2021
@CsCherrYY
Copy link
Copy Markdown
Contributor

After testing, I find no regression but an existing bug about export jar.

When there is no workspace and the language server has been activated, the export jar button doesn't show in the Java Projects view title. However, the user can trigger export jar via command palette Java: Export Jar and get the following error.

Screenshot 2021-09-14 170239

I'd like to make the when clause of java.view.package.exportJar in command palette be alignment with that in view title to fix this bug. @jdneo Could you please add a commit about this?

Comment thread src/languageServerApi/languageServerApiManager.ts
Comment thread src/languageServerApi/languageServerApiManager.ts
CsCherrYY
CsCherrYY previously approved these changes Sep 15, 2021
@jdneo jdneo changed the title fix: Show the Java Projects explorer properly fix: Show the hints in Java Projects explorer properly Sep 15, 2021
Eskibear
Eskibear previously approved these changes Sep 15, 2021
Copy link
Copy Markdown
Member

@Eskibear Eskibear left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jdneo jdneo dismissed stale reviews from Eskibear and CsCherrYY via 3654d58 September 16, 2021 06:41
@jdneo jdneo merged commit e1fe563 into main Sep 16, 2021
@jdneo jdneo deleted the cs/show-java-explorer-properly branch September 16, 2021 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hint user to install Language Support for Java if its not installed

3 participants