Skip to content

Commit f1c8eeb

Browse files
committed
Mark all functions use fetch method as unsupported
1 parent 3651c29 commit f1c8eeb

File tree

6 files changed

+47
-5
lines changed

6 files changed

+47
-5
lines changed

.vscode/settings.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
{
77
"files.exclude": {
88
"out": false,
9+
"dist":false,
910
"**/.classpath": false,
1011
"**/.project": false,
1112
"**/.settings": false,
@@ -14,7 +15,9 @@
1415
"search.exclude": {
1516
"**/node_modules": true,
1617
"out": true, // set this to false to include "out" folder in search results
17-
"dist": true
18+
"dist": true,
19+
".vscode-test": true,
20+
".vscode-test-web": true
1821
},
1922
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
2023
"typescript.tsc.autoDetect": "off",

src/export_command/wikimedia_function/view.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import * as vscode from 'vscode';
77
import type MWBot from 'mwbot';
8-
import { extensionContext } from '../../extension';
8+
import { extensionContext } from '../../extension-node';
99
import { Action, ContextModel, alterNativeValues, Prop } from './args';
1010
import { GetViewResult, ViewConvert } from '../../interface_definition/api_interface/getView';
1111
import { getHost } from '../vscode_function/host';
File renamed without changes.

src/extension-web.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Rowe Wilson Frederisk Holme. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
import * as vscode from 'vscode';
7+
import { closeEditor } from './export_command/wikimedia_function/page';
8+
9+
10+
11+
export function activate(context: vscode.ExtensionContext): void {
12+
function subscriptUnsupportedMessage(command: string) {
13+
context.subscriptions.push(
14+
vscode.commands.registerCommand(
15+
command, () => {
16+
vscode.window.showErrorMessage('Web extension does not support this function.');
17+
}
18+
)
19+
);
20+
}
21+
22+
console.log("Extension is active.");
23+
subscriptUnsupportedMessage("wikitext.login");
24+
subscriptUnsupportedMessage("wikitext.logout",);
25+
subscriptUnsupportedMessage("wikitext.readPage");
26+
subscriptUnsupportedMessage("wikitext.writePage");
27+
context.subscriptions.push(vscode.commands.registerCommand("wikitext.closeEditor", closeEditor));
28+
subscriptUnsupportedMessage("wikitext.getPreview");
29+
subscriptUnsupportedMessage("wikitext.viewPage");
30+
subscriptUnsupportedMessage("wikitext.citeWeb");
31+
}
32+
33+
export function deactivate(): void {
34+
console.log("Extension is deactivate.");
35+
}

src/test/suite/index-web.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Rowe Wilson Frederisk Holme. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
16
require('mocha/mocha'); // import the mocha web build
27

38
export function run(): Promise<void> {

webpack.config.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"use strict";
88

99
const path = require('path');
10-
const { buffer } = require('stream/consumers');
1110
const webpack = require('webpack');
1211

1312
/** @type {webpack.Configuration} */
@@ -16,7 +15,7 @@ const webConfig = {
1615
mode: "none", // this leaves the source code as close as possible to the original (when packaging we set this to 'production')
1716
target: "webworker", // web extensions run in a webworker context
1817
entry: {
19-
"extension-web": "./src/extension.ts", // source of the web extension main file
18+
"extension-web": "./src/extension-web.ts", // source of the web extension main file
2019
"test/suite/index-web": "./src/test/suite/index-web.ts", // source of the web extension test runner
2120
},
2221
output: {
@@ -92,7 +91,7 @@ const nodeConfig = {
9291
target: 'node', // vscode extensions run in a Node.js-context 📖 -> https://webpack.js.org/configuration/node/
9392
// entry: './src/extension.ts', // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/
9493
entry: {
95-
'extension-node': "./src/extension.ts", // source of the node extension main file
94+
'extension-node': "./src/extension-node.ts", // source of the node extension main file
9695
'test/suite/index-node': "./src/test/suite/index-node.ts", // source of the node extension test runner
9796
"test/suite/extension.test": "./src/test/suite/extension.test.ts", // create a separate file for the tests, to be found by glob
9897
"test/runTest": "./src/test/runTest", // used to start the VS Code test runner (@vscode/test-electron)

0 commit comments

Comments
 (0)