Refine the context value of the nodes in the project explorer#311
Merged
Conversation
testforstephen
previously approved these changes
Aug 24, 2020
Eskibear
previously approved these changes
Aug 24, 2020
Eskibear
approved these changes
Aug 31, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
workspaceFolderprojectcontainerpackageRootpackagejarNot available node types are:
folderfiletype(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: