Skip to content
This repository has been archived by the owner on May 11, 2022. It is now read-only.

Latest commit

 

History

History
188 lines (117 loc) · 8.43 KB

commands.reference.adoc

File metadata and controls

188 lines (117 loc) · 8.43 KB

Didact Commands Reference

vscode.didact.<ID> Description Parameters Return

cliCommandSuccessful

Even simpler command-line check for system capabilities. Takes two parameters - the id of the HTML element to update with the results and the test command (such as mvn --version. If command executes with no errors (return code 0), it returns true. If not, false.

requirement: string / required testCommand: string / required

true on success, false on failure; result posted as message to update requirement element

closeNamedTerminal

Terminate a named terminal and dispose of it.

name : string / required

Check Didact output channel

copyClipboardToActiveTextEditor

Copies contents of the system clipboard to the currently open (or previously used) editor.

Check Didact output channel

copyClipboardToEditorForFile

Copies contents of the system clipboard to a file path for an existing file (opened if not already open).

filepath:vscode.Uri / required

Check Didact output channel

copyClipboardToNewFile

Copies contents of the system clipboard to a new file (opened after creation).

Check Didact output channel

copyFileTextToClipboardCommand

Copies text from a file to the system clipboard.

text : string / required

Check Didact output channel

copyToClipboardCommand

Copies text to the system clipboard.

text : string / required

Check Didact output channel

createWorkspaceFolder

Creating temporary folder as workspace root. Update named 'requirement' label field with success or failure.

requirement: string / optional

Check Didact output channel

extensionRequirementCheck

Simple check to see if the extension Id is installed in the user workspace.

requirement: string / required extensionId : string / required

true on success, false on failure; result posted as message to update requirement element

gatherAllCommands

Gathers a list of all commands used in the Didact file. Used for testing purposes only.

array any[]

gatherAllRequirements

Gathers a list of all requirements in the Didact file. Used internally as part of the validateAllRequirements execution.

array any[]

openTutorial

Opens the Didact editor with the default didact URI set in the user settings.

Check Didact output channel

register

Command used to register a new Didact tutorial so that it appears in the Didact Tutorials view. This command is invoked by VS Code Extension code to register tutorials they provide.

name : string / required sourceUri : string / required category : string / optional

Check Didact output channel

reload

Forces the Didact window to reload with the default Didact file specified in VS Code settings.

Check Didact output channel

requirementCheck

Simple command-line check for system capabilities. Takes three parameters - the id of the HTML element to update with the results, the test command (such as mvn --version, and a string to search for in the resulting text, such as Apache Maven if the mvn command works successfully).

requirement: string / required testCommand: string / required testResult: string / required

true on success, false on failure; result posted as message to update requirement element

scaffoldProject

Create new project in user workspace from json file provided by P1.

jsonpath:vscode.Uri / required

Check Didact output channel

sendNamedTerminalAString

Send a text string to a named terminal. If the terminal doesn’t exist, create it. Pass text as is. Does not automatically add a NL/CR at the end.

name : string / required text: string / required

Check Didact output channel

sendNamedTerminalCtrlC

Send a Ctrl+C key combination to a named terminal to stop a long-running process.

name : string / required

Check Didact output channel

startDidact

Opens the Didact editor using the markdown or asciidoc file URI passed in. Can be

uri:vscode.Uri / optional

Check Didact output channel

startTerminalWithName

Show terminal. If no name, create an unamed terminal. If name provided and terminal doesn’t exist, it creates it. If passed a file URI, pass that as the current working directory.

name : string / optional filePath : vscode.Uri / optional

Check Didact output channel

validateAllRequirements

Gathers all requirements in the Didact file and invokes the requirement checks one at a time. Useful if you have a long list of requirements to check.

Check Didact output channel

view.refresh

Refresh the Didact Tutorials view. Called automatically each time register is called.

No output

view.tutorial.open

Menu command used when the user right-clicks on a tutorial in the Didact Tutorials view to Start Didact Tutorial.

node: TreeNode / required

Check Didact output channel

workspaceFolderExistsCheck

Simple check to see if the workspace has at least one root folder.

requirement: string / required

true on success, false on failure; result posted as message to update requirement element

openNamedOutputChannel

Creates and opens an output channel with the given name.

channelName: string / optional

Check the named output channel

sendTextToNamedOutputChannel

Sends a text to the output channel with the given name. If no name is provided it will use the Didact Activity channel.

message: string channelName: string / optional

Check the named output channel