fix: Create new packages or classes does not work via hotkeys - #467
Merged
Conversation
Sheng Chen (jdneo)
requested review from
Shi Chen (CsCherrYY),
Yan Zhang (Eskibear) and
Jinbo Wang (testforstephen)
March 8, 2021 07:35
|
|
||
| export async function newPackage(node: DataNode): Promise<void> { | ||
| if (!node.uri) { | ||
| if (!node?.uri || !canCreatePackage(node)) { |
Member
There was a problem hiding this comment.
Just one concern. If no node is selected, by triggering keyboard shortcut, nothing would happen. Is that true? If so, "Creating new packages or classes doesn't work using hotkeys" is still true in such scenarios.
I think it would be better to let users know what to do next.
- Better experience: Prompt to select target package
- Easy implementation: notification with instructions
Member
Author
There was a problem hiding this comment.
Good point. Let me think how to improve this
Yan Zhang (Eskibear)
approved these changes
Mar 9, 2021
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 fix #465, including following changes
new package/classare triggered and the parameter is not provided (triggered via hotkeys), get the current selected node.Primary Type, use its declared package as the base path.