diff --git a/package.json b/package.json index b41b897..69f11b7 100644 --- a/package.json +++ b/package.json @@ -1,18 +1,29 @@ { "name": "ext1", "displayName": "Ext1", - "description": "a test", - "version": "0.0.8", + "description": "a test extension", + "version": "0.0.9", "private": true, "publisher": "quodatum", "engines": { "vscode": "^1.63.0" }, + "icon": "resources/ext1.png", + "homepage": "https://git.quodatum.duckdns.org/apb/ext1", + "repository": { + "type": "git", + "url": "https://git.quodatum.duckdns.org/apb/ext1.git" + }, + "bugs": { + "url": "https://git.quodatum.duckdns.org/apb/ext1/issues" + }, "categories": [ "Other" ], "activationEvents": [ "onCommand:ext1.helloWorld", + "onCommand:ext1.pick", + "onCommand:ext1.debug", "onCommand:ext1.newDoc" ], "main": "./out/extension.js", diff --git a/resources/ext1.png b/resources/ext1.png new file mode 100644 index 0000000..e297397 Binary files /dev/null and b/resources/ext1.png differ diff --git a/src/extension.ts b/src/extension.ts index 6ecfdbc..8424a8f 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1,7 +1,7 @@ // The module 'vscode' contains the VS Code extensibility API // Import the module and reference it with the alias vscode in your code below import { - commands, languages, window, workspace, ExtensionContext, Memento, + commands, languages, window, workspace,WorkspaceFolder, ExtensionContext, Memento, TextEditor, TextEditorSelectionChangeEvent, TextEditorSelectionChangeKind, DiagnosticCollection, Uri } from "vscode"; @@ -14,7 +14,21 @@ export function activate(context: ExtensionContext) { console.log('Congratulations, your extension "ext1" is now active!'); function helloHandler() { - window.showInformationMessage('Hello World!'); + let path: string; + if (!workspace.workspaceFolders) { + path = "none"; + } else { + let root: WorkspaceFolder; + if (workspace.workspaceFolders.length === 1) { + root = workspace.workspaceFolders[0]; + path = root.uri.fsPath; + } else { + path="count?"; + } + + + } + window.showInformationMessage('Hello World!' + path); } function pickHandler(name: string = 'world') {