custom commands - #388
Conversation
…ch#385) * check to ask for workspace * one line * remove empty line from source code * apply what taylor said * fix typo * better description * reuse 'getGlobalSettings' * remove unused import * remove unsued import * remove space * move comment * better naming * remove string property that _can_ cuase bug when refactoring * . * naming * better name * do not use IPC * remove extra spaces * . * add periods, American spell * . * remove comment --------- Co-authored-by: pc <hamidb@aut.ac.ir>
* add checkbox checked glyph option * ' -> " import quote * follow style guide * . * syntax consistency * capitalize * fix grammer * add period * style consistency * prefer const * style guide * remove dummy var --------- Co-authored-by: pc <hamidb@aut.ac.ir>
…nt. Add optional debug logging for node handles.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
taylorhadden
left a comment
There was a problem hiding this comment.
Lots of stuff here. This is absolutely the right direction 🍻.
The largest point of single feedback is that I don't think we want to use "Rule"; we can just call these things "External Commands".
I also want to highlight the query about shell.ts. Why not use the referenced library?
…form independent
|
|
||
| export function nameFromRule(rule: ExternalCommandRule | ExternalCommandRuleDefinition, name?: string): string { | ||
| return (typeof rule.name == 'string' ? rule.name : rule.name.value) || name | ||
| export function nameFromCommand(command: ExternalCommand | ExternalCommandDefinition, name?: string): string { |
There was a problem hiding this comment.
In place of some of this you can use rawOrStoreValue() in ReadableStore.ts.
|
|
||
| export default class ExecuteExternalCommand extends WorkspaceCommand { | ||
| constructor(workspace: Workspace) { | ||
| super(workspace, { group: 'Notes' }) // <---- this makes it available when editing notes |
There was a problem hiding this comment.
Having an empty group should be fine, and is probably what is desired. The groups are used to separate out groups of bindings that won't ever be in scope with each other.
| function createAllCommands(workspace: Workspace) { | ||
| return { | ||
|
|
||
There was a problem hiding this comment.
Nit: this is just a whitespace change.
| use:tooltip={"Define the name of the command. Set an emoji as the first character of the name to make an icon."} | ||
| ></h2> | ||
| </header> | ||
| <label use:tooltip={"Defines how the note will be named. Refer to the Template Token list for available dynamic values."}> |
There was a problem hiding this comment.
This tooltip and label span are still mentioning the creation rules. It's also bound to the same value as the header. Seems like we don't need both. Is one of these supposed to be the command template?
demo for #367
comments are welcome
currently is tries to find.shor.batscripts in the workspace root directory