Refine the context value of the nodes in the project explorer #311
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is to better expose the node context value.
Context Value Format
java:<node type>[+<attribute>]*
Available Node Types:
Currently, available node types are:
workspaceFolder
project
container
packageRoot
package
jar
Not available node types are:
folder
file
type
(class, enum, interface,...)Below picture illustrates the different node types

Attributes:
For each node type, it may have some attributes. Every attribute will start with a
+
.Common Attributes:
+uri
: The node has uriSpecific Attributes:
Project Node:
+java
: Java project+maven
: Maven project+gradle
: Gradle projectContainer Node:
+jre
: Container for JRE+maven
: Container for Maven+gradle
: Container for Gradle+referencedLibrary
: Container for Referenced LibrariesPackage Root Node:
+source
: Source package root.+resource
: Resource package rootPackage Node:
+source
: Source package+binary
: Binary package (Expanded inside a binary jar)Jar Node:
+referencedLibrary
: Referenced Library jarUsage example:
For example, A node for a Maven project may have the following context value:
If you want to register a command on that node, you can write your when clause as: