@theia/plugin-ext-vscode 1.70.0-next.28 → 1.70.0-next.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/node/scanner-vscode.d.ts.map +1 -1
- package/lib/node/scanner-vscode.js +1 -0
- package/lib/node/scanner-vscode.js.map +1 -1
- package/lib/node/scanner-vscode.spec.d.ts +2 -0
- package/lib/node/scanner-vscode.spec.d.ts.map +1 -0
- package/lib/node/scanner-vscode.spec.js +80 -0
- package/lib/node/scanner-vscode.spec.js.map +1 -0
- package/package.json +17 -17
- package/src/node/scanner-vscode.spec.ts +95 -0
- package/src/node/scanner-vscode.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scanner-vscode.d.ts","sourceRoot":"","sources":["../../src/node/scanner-vscode.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,eAAe,EAAwE,MAAM,mBAAmB,CAAC;AACnL,OAAO,EAAE,kBAAkB,EAAE,MAAM,0DAA0D,CAAC;AAM9F,qBACa,mBAAoB,SAAQ,kBAAmB,YAAW,aAAa;IAEhF,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA0B;IAEtD,IAAa,OAAO,IAAI,YAAY,CAEnC;IAEQ,QAAQ,CAAC,MAAM,EAAE,aAAa,GAAG,WAAW;
|
|
1
|
+
{"version":3,"file":"scanner-vscode.d.ts","sourceRoot":"","sources":["../../src/node/scanner-vscode.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,eAAe,EAAwE,MAAM,mBAAmB,CAAC;AACnL,OAAO,EAAE,kBAAkB,EAAE,MAAM,0DAA0D,CAAC;AAM9F,qBACa,mBAAoB,SAAQ,kBAAmB,YAAW,aAAa;IAEhF,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA0B;IAEtD,IAAa,OAAO,IAAI,YAAY,CAEnC;IAEQ,QAAQ,CAAC,MAAM,EAAE,aAAa,GAAG,WAAW;IAgDrD;;OAEG;IACM,eAAe,CAAC,MAAM,EAAE,aAAa,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS;IAiBvE,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,eAAe;CAWhE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scanner-vscode.js","sourceRoot":"","sources":["../../src/node/scanner-vscode.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,wCAAwC;AACxC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,6BAA6B;AAC7B,4DAA0D;AAC1D,kDAAmL;AACnL,4FAA8F;AAC9F,+FAA4F;AAC5F,mEAAiE;AAEjE,MAAM,MAAM,GAAG,yBAAW,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,mBAAM,CAAC,OAAO,CAAC,CAAC,CAAC,mBAAM,CAAC,GAAG,CAAC;AAGhE,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,kCAAkB;IAApD;;QAEc,gBAAW,GAAiB,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"scanner-vscode.js","sourceRoot":"","sources":["../../src/node/scanner-vscode.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,wCAAwC;AACxC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,6BAA6B;AAC7B,4DAA0D;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AE;oBAC/B,MAAM,YAAY,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;oBACvC,YAAY,CAAC,GAAG,CAAC,YAAY,EAAE,sCAAkB,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;gBACvF,CAAC,CAAC,CAAC;YACP,CAAC;QACL,CAAC;QACD,+DAA+D;QAC/D,OAAO,YAAY,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC;IAC5D,CAAC;IAEQ,YAAY,CAAC,MAAqB;QACvC,OAAO;YACH,WAAW,EAAE,UAAU;YACvB,UAAU,EAAE,YAAY;YACxB,kBAAkB,EAAE,IAAA,oCAAuB,EAAC,MAAM,CAAC;YAEnD,gBAAgB,EAAE,0BAA0B;YAC5C,eAAe,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC;SAC9D,CAAC;IACN,CAAC;CAEJ,CAAA;AAvFY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,sBAAU,GAAE;GACA,mBAAmB,CAuF/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scanner-vscode.spec.d.ts","sourceRoot":"","sources":["../../src/node/scanner-vscode.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2026 EclipseSource and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
19
|
+
const chai_1 = require("chai");
|
|
20
|
+
const os = require("os");
|
|
21
|
+
const path = require("path");
|
|
22
|
+
const fs = require("fs");
|
|
23
|
+
const scanner_vscode_1 = require("./scanner-vscode");
|
|
24
|
+
const uri_1 = require("@theia/core/lib/common/uri");
|
|
25
|
+
function createVsCodePluginPackage(capabilities, packagePath) {
|
|
26
|
+
return {
|
|
27
|
+
name: 'test-vscode-plugin',
|
|
28
|
+
publisher: 'test-publisher',
|
|
29
|
+
version: '1.0.0',
|
|
30
|
+
engines: { vscode: '^1.5.0' },
|
|
31
|
+
displayName: 'Test VSCode Plugin',
|
|
32
|
+
description: 'A test vscode plugin',
|
|
33
|
+
packagePath: packagePath ?? os.tmpdir(),
|
|
34
|
+
main: 'extension.js',
|
|
35
|
+
capabilities
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
describe('VsCodePluginScanner', () => {
|
|
39
|
+
let scanner;
|
|
40
|
+
let tmpDir;
|
|
41
|
+
before(() => {
|
|
42
|
+
scanner = new scanner_vscode_1.VsCodePluginScanner();
|
|
43
|
+
// Inject a mock pluginUriFactory
|
|
44
|
+
scanner.pluginUriFactory = {
|
|
45
|
+
createUri: (_pkg, _relativePath) => new uri_1.default('file:///dummy')
|
|
46
|
+
};
|
|
47
|
+
// Create a real temp directory so readdirSync in getLicenseUrl/getReadmeUrl works
|
|
48
|
+
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'scanner-vscode-test-'));
|
|
49
|
+
});
|
|
50
|
+
after(() => {
|
|
51
|
+
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
52
|
+
});
|
|
53
|
+
it('should set untrustedWorkspacesSupport to true when capabilities.untrustedWorkspaces.supported is true', () => {
|
|
54
|
+
const pkg = createVsCodePluginPackage({
|
|
55
|
+
untrustedWorkspaces: { supported: true }
|
|
56
|
+
}, tmpDir);
|
|
57
|
+
const model = scanner.getModel(pkg);
|
|
58
|
+
(0, chai_1.expect)(model.untrustedWorkspacesSupport).to.equal(true);
|
|
59
|
+
});
|
|
60
|
+
it('should set untrustedWorkspacesSupport to false when capabilities.untrustedWorkspaces.supported is false', () => {
|
|
61
|
+
const pkg = createVsCodePluginPackage({
|
|
62
|
+
untrustedWorkspaces: { supported: false }
|
|
63
|
+
}, tmpDir);
|
|
64
|
+
const model = scanner.getModel(pkg);
|
|
65
|
+
(0, chai_1.expect)(model.untrustedWorkspacesSupport).to.equal(false);
|
|
66
|
+
});
|
|
67
|
+
it('should set untrustedWorkspacesSupport to "limited" when capabilities.untrustedWorkspaces.supported is "limited"', () => {
|
|
68
|
+
const pkg = createVsCodePluginPackage({
|
|
69
|
+
untrustedWorkspaces: { supported: 'limited' }
|
|
70
|
+
}, tmpDir);
|
|
71
|
+
const model = scanner.getModel(pkg);
|
|
72
|
+
(0, chai_1.expect)(model.untrustedWorkspacesSupport).to.equal('limited');
|
|
73
|
+
});
|
|
74
|
+
it('should leave untrustedWorkspacesSupport undefined when no capabilities field is present', () => {
|
|
75
|
+
const pkg = createVsCodePluginPackage(undefined, tmpDir);
|
|
76
|
+
const model = scanner.getModel(pkg);
|
|
77
|
+
(0, chai_1.expect)(model.untrustedWorkspacesSupport).to.equal(undefined);
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
//# sourceMappingURL=scanner-vscode.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scanner-vscode.spec.js","sourceRoot":"","sources":["../../src/node/scanner-vscode.spec.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,EAAE;AACF,2EAA2E;AAC3E,mEA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AAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QACpC,IAAA,aAAM,EAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IACjE,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/plugin-ext-vscode",
|
|
3
|
-
"version": "1.70.0-next.
|
|
3
|
+
"version": "1.70.0-next.43+8b83716cc",
|
|
4
4
|
"description": "Theia - Plugin Extension for VsCode",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@theia/callhierarchy": "1.70.0-next.
|
|
7
|
-
"@theia/core": "1.70.0-next.
|
|
8
|
-
"@theia/editor": "1.70.0-next.
|
|
9
|
-
"@theia/filesystem": "1.70.0-next.
|
|
10
|
-
"@theia/monaco": "1.70.0-next.
|
|
11
|
-
"@theia/monaco-editor-core": "1.
|
|
12
|
-
"@theia/navigator": "1.70.0-next.
|
|
13
|
-
"@theia/outline-view": "1.70.0-next.
|
|
14
|
-
"@theia/plugin": "1.70.0-next.
|
|
15
|
-
"@theia/plugin-ext": "1.70.0-next.
|
|
16
|
-
"@theia/scm": "1.70.0-next.
|
|
17
|
-
"@theia/terminal": "1.70.0-next.
|
|
18
|
-
"@theia/typehierarchy": "1.70.0-next.
|
|
19
|
-
"@theia/userstorage": "1.70.0-next.
|
|
20
|
-
"@theia/workspace": "1.70.0-next.
|
|
6
|
+
"@theia/callhierarchy": "1.70.0-next.43+8b83716cc",
|
|
7
|
+
"@theia/core": "1.70.0-next.43+8b83716cc",
|
|
8
|
+
"@theia/editor": "1.70.0-next.43+8b83716cc",
|
|
9
|
+
"@theia/filesystem": "1.70.0-next.43+8b83716cc",
|
|
10
|
+
"@theia/monaco": "1.70.0-next.43+8b83716cc",
|
|
11
|
+
"@theia/monaco-editor-core": "1.108.201",
|
|
12
|
+
"@theia/navigator": "1.70.0-next.43+8b83716cc",
|
|
13
|
+
"@theia/outline-view": "1.70.0-next.43+8b83716cc",
|
|
14
|
+
"@theia/plugin": "1.70.0-next.43+8b83716cc",
|
|
15
|
+
"@theia/plugin-ext": "1.70.0-next.43+8b83716cc",
|
|
16
|
+
"@theia/scm": "1.70.0-next.43+8b83716cc",
|
|
17
|
+
"@theia/terminal": "1.70.0-next.43+8b83716cc",
|
|
18
|
+
"@theia/typehierarchy": "1.70.0-next.43+8b83716cc",
|
|
19
|
+
"@theia/userstorage": "1.70.0-next.43+8b83716cc",
|
|
20
|
+
"@theia/workspace": "1.70.0-next.43+8b83716cc",
|
|
21
21
|
"decompress": "^4.2.1",
|
|
22
22
|
"filenamify": "^4.1.0",
|
|
23
23
|
"tslib": "^2.6.2"
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"nyc": {
|
|
62
62
|
"extends": "../../configs/nyc.json"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "8b83716cc93de231a1d472d4ae4016711dbd31a3"
|
|
65
65
|
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2026 EclipseSource and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
18
|
+
|
|
19
|
+
import { expect } from 'chai';
|
|
20
|
+
import * as os from 'os';
|
|
21
|
+
import * as path from 'path';
|
|
22
|
+
import * as fs from 'fs';
|
|
23
|
+
import { VsCodePluginScanner } from './scanner-vscode';
|
|
24
|
+
import { PluginPackage } from '@theia/plugin-ext';
|
|
25
|
+
import URI from '@theia/core/lib/common/uri';
|
|
26
|
+
|
|
27
|
+
function createVsCodePluginPackage(
|
|
28
|
+
capabilities?: PluginPackage['capabilities'],
|
|
29
|
+
packagePath?: string
|
|
30
|
+
): PluginPackage {
|
|
31
|
+
return {
|
|
32
|
+
name: 'test-vscode-plugin',
|
|
33
|
+
publisher: 'test-publisher',
|
|
34
|
+
version: '1.0.0',
|
|
35
|
+
engines: { vscode: '^1.5.0' },
|
|
36
|
+
displayName: 'Test VSCode Plugin',
|
|
37
|
+
description: 'A test vscode plugin',
|
|
38
|
+
packagePath: packagePath ?? os.tmpdir(),
|
|
39
|
+
main: 'extension.js',
|
|
40
|
+
capabilities
|
|
41
|
+
} as PluginPackage;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
describe('VsCodePluginScanner', () => {
|
|
45
|
+
let scanner: VsCodePluginScanner;
|
|
46
|
+
let tmpDir: string;
|
|
47
|
+
|
|
48
|
+
before(() => {
|
|
49
|
+
scanner = new VsCodePluginScanner();
|
|
50
|
+
// Inject a mock pluginUriFactory
|
|
51
|
+
(scanner as any).pluginUriFactory = {
|
|
52
|
+
createUri: (_pkg: PluginPackage, _relativePath?: string) => new URI('file:///dummy')
|
|
53
|
+
};
|
|
54
|
+
// Create a real temp directory so readdirSync in getLicenseUrl/getReadmeUrl works
|
|
55
|
+
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'scanner-vscode-test-'));
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
after(() => {
|
|
59
|
+
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('should set untrustedWorkspacesSupport to true when capabilities.untrustedWorkspaces.supported is true', () => {
|
|
63
|
+
const pkg = createVsCodePluginPackage({
|
|
64
|
+
untrustedWorkspaces: { supported: true }
|
|
65
|
+
}, tmpDir);
|
|
66
|
+
|
|
67
|
+
const model = scanner.getModel(pkg);
|
|
68
|
+
expect(model.untrustedWorkspacesSupport).to.equal(true);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it('should set untrustedWorkspacesSupport to false when capabilities.untrustedWorkspaces.supported is false', () => {
|
|
72
|
+
const pkg = createVsCodePluginPackage({
|
|
73
|
+
untrustedWorkspaces: { supported: false }
|
|
74
|
+
}, tmpDir);
|
|
75
|
+
|
|
76
|
+
const model = scanner.getModel(pkg);
|
|
77
|
+
expect(model.untrustedWorkspacesSupport).to.equal(false);
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it('should set untrustedWorkspacesSupport to "limited" when capabilities.untrustedWorkspaces.supported is "limited"', () => {
|
|
81
|
+
const pkg = createVsCodePluginPackage({
|
|
82
|
+
untrustedWorkspaces: { supported: 'limited' }
|
|
83
|
+
}, tmpDir);
|
|
84
|
+
|
|
85
|
+
const model = scanner.getModel(pkg);
|
|
86
|
+
expect(model.untrustedWorkspacesSupport).to.equal('limited');
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
it('should leave untrustedWorkspacesSupport undefined when no capabilities field is present', () => {
|
|
90
|
+
const pkg = createVsCodePluginPackage(undefined, tmpDir);
|
|
91
|
+
|
|
92
|
+
const model = scanner.getModel(pkg);
|
|
93
|
+
expect(model.untrustedWorkspacesSupport).to.equal(undefined);
|
|
94
|
+
});
|
|
95
|
+
});
|