Skip to content

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

Merged
Sheng Chen (jdneo) merged 3 commits into
mainfrom
cs/show-java-explorer-properly
Sep 16, 2021
Merged

Sheng Chen (jdneo) merged 3 commits into
mainfrom
cs/show-java-explorer-properly

Conversation

@jdneo

@jdneo Sheng Chen (jdneo) commented Sep 14, 2021 •

Copy link
Copy Markdown
Member

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 Sheng Chen (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. Sheng Chen (@jdneo) Could you please add a commit about this?

@jdneo Sheng Chen (jdneo) changed the title fix: Show the Java Projects explorer properly fix: Show the hints in Java Projects explorer properly Sep 15, 2021

@Eskibear Yan Zhang (Eskibear) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

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