-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add: contextMenu items for Run.Plugin.VSCodeWorkspaces
#36517
base: main
Are you sure you want to change the base?
add: contextMenu items for Run.Plugin.VSCodeWorkspaces
#36517
Conversation
ShowErrorMessage("Can't copy to clipboard"); | ||
return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add logging using Wox.Plugin.Logger.Log.Exception()
.
(Same on the other places.)
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as resolved.
This comment was marked as resolved.
fix errors
I need help |
@programming-with-ia Btw. The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the mentioned things. Other than that looks good to me.
I can a a second look after you did the changes.
}; | ||
} | ||
|
||
private ContextMenuResult CreateContextMenuResult(string title, string glyph, Key acceleratorKey, ModifierKeys acceleratorModifiers, Func<bool> action) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we please go without this duplicated code. It is except of one ore two properties the same as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't quite understand.
Are you suggesting removing the CreateContextMenuResult()
method and directly adding the entries into the List<ContextMenuResult>()
instead? Similar to this example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Otherwise we have duplicated code that acts only as transport code. This is not really needed.
Alternatively you can move all the context menu code into a method and only call the method from the property.
} | ||
catch (Exception ex) | ||
{ | ||
LogError("Can't copy to clipboard", ex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the message box too. I think direct user feedback makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{ | ||
var name = $"Plugin: {_context.CurrentPluginMetadata.Name}"; | ||
var msg = "Can't Open this file"; | ||
_context.API.ShowMsg(name, msg, string.Empty); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why removing existing functionality? Please add message box again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically this works. But logging and showing all message are different things. Either you rename the method or you split the methods.
return true; | ||
} | ||
|
||
public void LogError(string msg, Exception exception = null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why public. Private should be work. Or not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping: @programming-with-ia
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@htcfreek
review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@programming-with-ia
The new HandleError()
method si still public. And I think private should works and is the better way to go. Please change this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What method would you change else? This PR only implements the HandleError()
and this should be done in the correct way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @htcfreek,
Looks like there's a build error 😒. Could you guide me on how to rerun this job?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately I can't rerun the pipeline. But you can merge current main in. This should trigger the pipeline again.
remove unnecessary empty lines `private HandleError()` method
24154a1
to
602735c
Compare
@programming-with-ia |
Summary of the Pull Request
This pull request addresses and resolves Issue #35773 by introducing the
ContextMenuResult
functionality to theRun.Plugin.VSCodeWorkspaces
plugin.PR Checklist
Detailed Description of the Pull Request / Additional comments
Fix ✅Issue #35773
Validation Steps Performed
All good from my perspective☺️ .