Skip to content

Commit

Permalink
execute function on command
Browse files Browse the repository at this point in the history
  • Loading branch information
serkonda7 committed Dec 2, 2023
1 parent d742a28 commit e68d83b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "VBA",
"description": "VBA tooling, syntax highlighting and snippets for VS Code.",
"icon": "images/icon_256x256.png",
"version": "0.10.0-dev",
"version": "0.9.5-dev",
"license": "MIT",
"repository": {
"type": "git",
Expand Down Expand Up @@ -72,7 +72,7 @@
],
"commands": [
{
"command": "vba.extract_to_source",
"command": "vba.extract_from_doc",
"title": "VBA: Extract code from office document."
},
{
Expand All @@ -83,7 +83,7 @@
"menus": {
"commandPalette": [
{
"command": "vba.extract_to_source",
"command": "vba.extract_from_doc",
"when": "false"
},
{
Expand All @@ -93,7 +93,7 @@
],
"explorer/context": [
{
"command": "vba.extract_to_source",
"command": "vba.extract_from_doc",
"when": "resourceExtname in vba.ctx.docExts",
"group": "2_workspace"
},
Expand Down
19 changes: 16 additions & 3 deletions src/extension.js.bt
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,26 @@ package extension

import 'vscode' as #JS.vscode

// TODO vscode.ExtensionContext
// TODO lot's of JS interop improvements

@export: 'activate'
fun activate(context #JS.Any) {
// TODO vscode.commands.executeCommand
#JS.'JS.vscode.commands.executeCommand("setContext", "vba.ctx.docExts", [".docm", ".xlsm", ".pptm"])'

// TODO implement and register commands
#JS.'context.subscriptions.push(JS.vscode.commands.registerCommand("vba.extract_from_doc", extension__extract_from_doc))'
#JS.'context.subscriptions.push(JS.vscode.commands.registerCommand("vba.write_to_doc", extension__write_to_doc))'

println('vscode-vba activated')
}

fun extract_from_doc() {
show_notif_funding()
}

fun write_to_doc() {
show_notif_funding()
}

fun show_notif_funding(){
#JS.'JS.vscode.window.showInformationMessage("This feature is not yet complete.\nPlease consider a donation to support it\'s development.")'
}

0 comments on commit e68d83b

Please sign in to comment.