Skip to content

Commit

Permalink
feat: add doc command (#306)
Browse files Browse the repository at this point in the history
  • Loading branch information
sockmaster27 authored Sep 10, 2023
1 parent cec1058 commit 91882ed
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions client/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ export async function activate(context: vscode.ExtensionContext, launchOptions:
registerCommand('flix.cmdBuildPkg', handlers.cmdBuildPkg(context, launchOptions))
registerCommand('flix.cmdRunProject', handlers.cmdRunProject(context, launchOptions))
registerCommand('flix.cmdTests', handlers.cmdTests(context, launchOptions))
registerCommand('flix.cmdDoc', handlers.cmdDoc(context, launchOptions))
registerCommand('flix.showParserAst', handlers.showAst(client, 'Parser'))
registerCommand('flix.showWeederAst', handlers.showAst(client, 'Weeder'))
registerCommand('flix.showKinderAst', handlers.showAst(client, 'Kinder'))
Expand Down
13 changes: 13 additions & 0 deletions client/src/handlers/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,19 @@ export function cmdTests(context: vscode.ExtensionContext, launchOptions: Launch
return runCmd(context, launchOptions, ':test')
}

/**
* builds the documentation for the current project using the command `java -jar flix.jar doc`
*
* @param context vscode.ExtensionContext
*
* @param launchOptions LaunchOptions
*
* @returns function handler
*/
export function cmdDoc(context: vscode.ExtensionContext, launchOptions: LaunchOptions = defaultLaunchOptions) {
return runCmd(context, launchOptions, ':doc')
}

/**
* show the ast of a given phase
*
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
"command": "flix.cmdTests",
"title": "Flix: test"
},
{
"command": "flix.cmdDoc",
"title": "Flix: doc"
},
{
"command": "flix.showParserAst",
"title": "Flix: Show Parser AST"
Expand Down

0 comments on commit 91882ed

Please sign in to comment.