Skip to content
Snippets Groups Projects
Verified Commit f3d81127 authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

feat: open doc

parent f004a635
No related branches found
No related tags found
No related merge requests found
......@@ -34,16 +34,35 @@ __export(extension_exports, {
});
module.exports = __toCommonJS(extension_exports);
var vscode = __toESM(require("vscode"), 1);
var isWeb = false;
if (isWeb) {
console.log("web");
} else {
console.log("something");
}
function activate(context) {
console.log('Congratulations, your extension "helloworld-minimal-sample" is now active!');
let disposable = vscode.commands.registerCommand("extension.helloWorld", () => {
vscode.window.showInformationMessage("Hello World!");
let disposable = vscode.commands.registerCommand("monster.open-doc", () => {
let documentationUrls;
vscode.env.openExternal(vscode.Uri.parse("https://monsterjs.org/en/doc/"));
const onDiskPath = vscode.Uri.joinPath(context.extensionUri, "documentation");
documentationUrls = panel.webview.asWebviewUri(onDiskPath);
const panel = vscode.window.createWebviewPanel(
"monsterDocumentation",
// Identifies the type of the webview. Used internally
"Monster JS Documentation",
// Title of the panel displayed to the user
vscode.ViewColumn.One,
{
enableScripts: true,
localResourceRoots: [documentationUrls]
}
// Webview options. More on these later.
);
getWebviewContent(context).then((html) => {
panel.webview.html = html;
}).catch((error) => {
console.log(error);
});
panel.onDidDispose(
() => {
},
null,
context.subscriptions
);
});
context.subscriptions.push(disposable);
}
......
{
"version": 3,
"sources": ["../source/extension.mjs"],
"sourcesContent": ["import * as vscode from 'vscode';\n//import * as vscodeWeb from 'vscode-web';\n\n\nlet isWeb = false;\n//if (typeof vscodeWeb !== 'undefined') {\n// isWeb = true;\n//}\n\nif (isWeb) {\n\tconsole.log(\"web\")\n // Code f\u00FCr die Web-Version von VS Code\n} else {\n\tconsole.log(\"something\")\n // Code f\u00FCr die Desktop-Version von VS Code\n}\n\nexport function activate(context) {\n console.log('Congratulations, your extension \"helloworld-minimal-sample\" is now active!');\n\t\n let disposable = vscode.commands.registerCommand('extension.helloWorld', () => {\n\t\t// The code you place here will be executed every time your command is executed\n\n\t\t// Display a message box to the user\n\t\tvscode.window.showInformationMessage('Hello World!');\n\t});\n\n\tcontext.subscriptions.push(disposable);\n}\n\nexport function deactivate() {}\n\n\n/**\nconst view = vscode.window.createWebviewView('myView', 'My Button', vscode.ViewColumn.Beside, {});\nview.webview.html = '<button>Hello World</button>';\n\n\nview.reveal({ select: false, focus: false });\n\n\nview.webview.onDidReceiveMessage(message => {\n if (message.command === 'buttonClicked') {\n vscode.window.showInformationMessage('Button clicked!');\n }\n});\n */"],
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAAwB;AAIxB,IAAI,QAAQ;AAKZ,IAAI,OAAO;AACV,UAAQ,IAAI,KAAK;AAElB,OAAO;AACN,UAAQ,IAAI,WAAW;AAExB;AAEO,SAAS,SAAS,SAAS;AAChC,UAAQ,IAAI,4EAA4E;AAExF,MAAI,aAAoB,gBAAS,gBAAgB,wBAAwB,MAAM;AAI/E,IAAO,cAAO,uBAAuB,cAAc;AAAA,EACpD,CAAC;AAED,UAAQ,cAAc,KAAK,UAAU;AACtC;AAEO,SAAS,aAAa;AAAC;",
"sourcesContent": ["import * as vscode from 'vscode';\n\n// see https://code.visualstudio.com/api/extension-guides/webview\n\nexport function activate(context) {\n\n let disposable = vscode.commands.registerCommand('monster.open-doc', () => {\n // The code you place here will be executed every time your command is executed\n\n let documentationUrls;\n\n vscode.env.openExternal(vscode.Uri.parse('https://monsterjs.org/en/doc/'));\n\n const onDiskPath = vscode.Uri.joinPath(context.extensionUri, 'documentation');\n \n\n documentationUrls = panel.webview.asWebviewUri(onDiskPath);\n \n\n const panel = vscode.window.createWebviewPanel(\n 'monsterDocumentation', // Identifies the type of the webview. Used internally\n 'Monster JS Documentation', // Title of the panel displayed to the user\n vscode.ViewColumn.One,\n {\n enableScripts: true,\n localResourceRoots: [documentationUrls]\n } // Webview options. More on these later.\n );\n\n getWebviewContent(context).then(html => {\n panel.webview.html = html;\n }).catch(error => {\n console.log(error)\n })\n // \n panel.onDidDispose(\n () => {\n // When the panel is closed, cancel any future updates to the webview content\n\n },\n null,\n context.subscriptions\n );\n\n });\n\n context.subscriptions.push(disposable);\n}\n\nexport function deactivate() { }"],
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAAwB;AAIjB,SAAS,SAAS,SAAS;AAEhC,MAAI,aAAoB,gBAAS,gBAAgB,oBAAoB,MAAM;AAGzE,QAAI;AAEJ,IAAO,WAAI,aAAoB,WAAI,MAAM,+BAA+B,CAAC;AAEzE,UAAM,aAAoB,WAAI,SAAS,QAAQ,cAAc,eAAe;AAG5E,wBAAoB,MAAM,QAAQ,aAAa,UAAU;AAGzD,UAAM,QAAe,cAAO;AAAA,MAC1B;AAAA;AAAA,MACA;AAAA;AAAA,MACO,kBAAW;AAAA,MAClB;AAAA,QACE,eAAe;AAAA,QACf,oBAAoB,CAAC,iBAAiB;AAAA,MACxC;AAAA;AAAA,IACF;AAEA,sBAAkB,OAAO,EAAE,KAAK,UAAQ;AACtC,YAAM,QAAQ,OAAO;AAAA,IACvB,CAAC,EAAE,MAAM,WAAS;AAChB,cAAQ,IAAI,KAAK;AAAA,IACnB,CAAC;AAED,UAAM;AAAA,MACJ,MAAM;AAAA,MAGN;AAAA,MACA;AAAA,MACA,QAAQ;AAAA,IACV;AAAA,EAEF,CAAC;AAED,UAAQ,cAAc,KAAK,UAAU;AACvC;AAEO,SAAS,aAAa;AAAE;",
"names": []
}
......@@ -14,7 +14,7 @@
},
"homepage": "https://monsterjs.org",
"pricing": "Free",
"version": "0.0.5",
"version": "0.0.6",
"engines": {
"vscode": "^1.76.0"
},
......@@ -40,8 +40,8 @@
"contributes": {
"commands": [
{
"command": "extension.helloWorld",
"title": "Hello World"
"command": "monster.open-doc",
"title": "Open Monster JS Documentation"
}
],
"configuration": [
......
import * as vscode from 'vscode';
//import * as vscodeWeb from 'vscode-web';
// see https://code.visualstudio.com/api/extension-guides/webview
let isWeb = false;
//if (typeof vscodeWeb !== 'undefined') {
// isWeb = true;
//}
export function activate(context) {
if (isWeb) {
console.log("web")
// Code für die Web-Version von VS Code
} else {
console.log("something")
// Code für die Desktop-Version von VS Code
}
let disposable = vscode.commands.registerCommand('monster.open-doc', () => {
// The code you place here will be executed every time your command is executed
export function activate(context) {
console.log('Congratulations, your extension "helloworld-minimal-sample" is now active!');
let disposable = vscode.commands.registerCommand('extension.helloWorld', () => {
// The code you place here will be executed every time your command is executed
let documentationUrls;
// Display a message box to the user
vscode.window.showInformationMessage('Hello World!');
});
vscode.env.openExternal(vscode.Uri.parse('https://monsterjs.org/en/doc/'));
context.subscriptions.push(disposable);
}
const onDiskPath = vscode.Uri.joinPath(context.extensionUri, 'documentation');
export function deactivate() {}
documentationUrls = panel.webview.asWebviewUri(onDiskPath);
const panel = vscode.window.createWebviewPanel(
'monsterDocumentation', // Identifies the type of the webview. Used internally
'Monster JS Documentation', // Title of the panel displayed to the user
vscode.ViewColumn.One,
{
enableScripts: true,
localResourceRoots: [documentationUrls]
} // Webview options. More on these later.
);
/**
const view = vscode.window.createWebviewView('myView', 'My Button', vscode.ViewColumn.Beside, {});
view.webview.html = '<button>Hello World</button>';
getWebviewContent(context).then(html => {
panel.webview.html = html;
}).catch(error => {
console.log(error)
})
//
panel.onDidDispose(
() => {
// When the panel is closed, cancel any future updates to the webview content
},
null,
context.subscriptions
);
view.reveal({ select: false, focus: false });
});
context.subscriptions.push(disposable);
}
view.webview.onDidReceiveMessage(message => {
if (message.command === 'buttonClicked') {
vscode.window.showInformationMessage('Button clicked!');
}
});
*/
\ No newline at end of file
export function deactivate() { }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment