@theia/plugin-ext 1.27.0-next.9 → 1.27.0
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/common/connection.d.ts +3 -3
- package/lib/common/connection.d.ts.map +1 -1
- package/lib/common/connection.js +0 -1
- package/lib/common/connection.js.map +1 -1
- package/lib/common/plugin-api-rpc.d.ts +18 -8
- package/lib/common/plugin-api-rpc.d.ts.map +1 -1
- package/lib/common/plugin-api-rpc.js.map +1 -1
- package/lib/common/plugin-identifiers.d.ts +41 -0
- package/lib/common/plugin-identifiers.d.ts.map +1 -0
- package/lib/common/plugin-identifiers.js +81 -0
- package/lib/common/plugin-identifiers.js.map +1 -0
- package/lib/common/plugin-protocol.d.ts +50 -11
- package/lib/common/plugin-protocol.d.ts.map +1 -1
- package/lib/common/plugin-protocol.js +3 -1
- package/lib/common/plugin-protocol.js.map +1 -1
- package/lib/hosted/browser/hosted-plugin.d.ts +2 -2
- package/lib/hosted/browser/hosted-plugin.d.ts.map +1 -1
- package/lib/hosted/browser/hosted-plugin.js +26 -18
- package/lib/hosted/browser/hosted-plugin.js.map +1 -1
- package/lib/hosted/browser/worker/debug-stub.d.ts +1 -1
- package/lib/hosted/browser/worker/debug-stub.d.ts.map +1 -1
- package/lib/hosted/browser/worker/debug-stub.js +2 -2
- package/lib/hosted/browser/worker/debug-stub.js.map +1 -1
- package/lib/hosted/browser/worker/plugin-manifest-loader.d.ts.map +1 -1
- package/lib/hosted/browser/worker/plugin-manifest-loader.js +4 -1
- package/lib/hosted/browser/worker/plugin-manifest-loader.js.map +1 -1
- package/lib/hosted/node/hosted-plugin-deployer-handler.d.ts +17 -9
- package/lib/hosted/node/hosted-plugin-deployer-handler.d.ts.map +1 -1
- package/lib/hosted/node/hosted-plugin-deployer-handler.js +99 -18
- package/lib/hosted/node/hosted-plugin-deployer-handler.js.map +1 -1
- package/lib/hosted/node/hosted-plugin-localization-service.d.ts.map +1 -1
- package/lib/hosted/node/hosted-plugin-localization-service.js +2 -4
- package/lib/hosted/node/hosted-plugin-localization-service.js.map +1 -1
- package/lib/hosted/node/hosted-plugin-process.d.ts +2 -2
- package/lib/hosted/node/hosted-plugin-process.d.ts.map +1 -1
- package/lib/hosted/node/hosted-plugin-process.js.map +1 -1
- package/lib/hosted/node/hosted-plugin.d.ts +2 -2
- package/lib/hosted/node/hosted-plugin.d.ts.map +1 -1
- package/lib/hosted/node/hosted-plugin.js.map +1 -1
- package/lib/hosted/node/metadata-scanner.d.ts +3 -2
- package/lib/hosted/node/metadata-scanner.d.ts.map +1 -1
- package/lib/hosted/node/metadata-scanner.js +8 -3
- package/lib/hosted/node/metadata-scanner.js.map +1 -1
- package/lib/hosted/node/plugin-host-rpc.js +2 -2
- package/lib/hosted/node/plugin-host-rpc.js.map +1 -1
- package/lib/hosted/node/plugin-manifest-loader.d.ts.map +1 -1
- package/lib/hosted/node/plugin-manifest-loader.js +3 -0
- package/lib/hosted/node/plugin-manifest-loader.js.map +1 -1
- package/lib/hosted/node/plugin-service.d.ts +18 -4
- package/lib/hosted/node/plugin-service.d.ts.map +1 -1
- package/lib/hosted/node/plugin-service.js +73 -18
- package/lib/hosted/node/plugin-service.js.map +1 -1
- package/lib/hosted/node/scanners/scanner-theia.d.ts.map +1 -1
- package/lib/hosted/node/scanners/scanner-theia.js +6 -3
- package/lib/hosted/node/scanners/scanner-theia.js.map +1 -1
- package/lib/main/browser/custom-editors/custom-editor-opener.d.ts.map +1 -1
- package/lib/main/browser/custom-editors/custom-editor-opener.js +2 -2
- package/lib/main/browser/custom-editors/custom-editor-opener.js.map +1 -1
- package/lib/main/browser/debug/plugin-debug-session-factory.d.ts +3 -3
- package/lib/main/browser/debug/plugin-debug-session-factory.d.ts.map +1 -1
- package/lib/main/browser/debug/plugin-debug-session-factory.js.map +1 -1
- package/lib/main/browser/documents-main.d.ts +1 -2
- package/lib/main/browser/documents-main.d.ts.map +1 -1
- package/lib/main/browser/documents-main.js +26 -6
- package/lib/main/browser/documents-main.js.map +1 -1
- package/lib/main/browser/editors-and-documents-main.d.ts +2 -0
- package/lib/main/browser/editors-and-documents-main.d.ts.map +1 -1
- package/lib/main/browser/editors-and-documents-main.js +14 -2
- package/lib/main/browser/editors-and-documents-main.js.map +1 -1
- package/lib/main/browser/languages-main.d.ts.map +1 -1
- package/lib/main/browser/languages-main.js +2 -1
- package/lib/main/browser/languages-main.js.map +1 -1
- package/lib/main/browser/main-context.d.ts.map +1 -1
- package/lib/main/browser/main-context.js +5 -4
- package/lib/main/browser/main-context.js.map +1 -1
- package/lib/main/browser/plugin-contribution-handler.d.ts +2 -0
- package/lib/main/browser/plugin-contribution-handler.d.ts.map +1 -1
- package/lib/main/browser/plugin-contribution-handler.js +36 -1
- package/lib/main/browser/plugin-contribution-handler.js.map +1 -1
- package/lib/main/browser/plugin-shared-style.d.ts +4 -2
- package/lib/main/browser/plugin-shared-style.d.ts.map +1 -1
- package/lib/main/browser/plugin-shared-style.js +15 -4
- package/lib/main/browser/plugin-shared-style.js.map +1 -1
- package/lib/main/browser/text-editors-main.d.ts +6 -3
- package/lib/main/browser/text-editors-main.d.ts.map +1 -1
- package/lib/main/browser/text-editors-main.js +8 -1
- package/lib/main/browser/text-editors-main.js.map +1 -1
- package/lib/main/browser/theming-main.d.ts +2 -1
- package/lib/main/browser/theming-main.d.ts.map +1 -1
- package/lib/main/browser/theming-main.js +3 -6
- package/lib/main/browser/theming-main.js.map +1 -1
- package/lib/main/browser/view/plugin-tree-view-node-label-provider.d.ts.map +1 -1
- package/lib/main/browser/view/plugin-tree-view-node-label-provider.js +7 -5
- package/lib/main/browser/view/plugin-tree-view-node-label-provider.js.map +1 -1
- package/lib/main/browser/view/plugin-view-registry.d.ts +1 -1
- package/lib/main/browser/view/plugin-view-registry.d.ts.map +1 -1
- package/lib/main/browser/view/plugin-view-registry.js +11 -6
- package/lib/main/browser/view/plugin-view-registry.js.map +1 -1
- package/lib/main/browser/view/tree-view-widget.d.ts +10 -5
- package/lib/main/browser/view/tree-view-widget.d.ts.map +1 -1
- package/lib/main/browser/view/tree-view-widget.js +40 -14
- package/lib/main/browser/view/tree-view-widget.js.map +1 -1
- package/lib/main/browser/webview/webview-theme-data-provider.d.ts +3 -1
- package/lib/main/browser/webview/webview-theme-data-provider.d.ts.map +1 -1
- package/lib/main/browser/webview/webview-theme-data-provider.js +5 -1
- package/lib/main/browser/webview/webview-theme-data-provider.js.map +1 -1
- package/lib/main/node/handlers/plugin-theia-directory-handler.d.ts +6 -1
- package/lib/main/node/handlers/plugin-theia-directory-handler.d.ts.map +1 -1
- package/lib/main/node/handlers/plugin-theia-directory-handler.js +61 -20
- package/lib/main/node/handlers/plugin-theia-directory-handler.js.map +1 -1
- package/lib/main/node/handlers/plugin-theia-file-handler.d.ts +4 -0
- package/lib/main/node/handlers/plugin-theia-file-handler.d.ts.map +1 -1
- package/lib/main/node/handlers/plugin-theia-file-handler.js +26 -4
- package/lib/main/node/handlers/plugin-theia-file-handler.js.map +1 -1
- package/lib/main/node/plugin-cli-contribution.d.ts +3 -0
- package/lib/main/node/plugin-cli-contribution.d.ts.map +1 -1
- package/lib/main/node/plugin-cli-contribution.js +13 -0
- package/lib/main/node/plugin-cli-contribution.js.map +1 -1
- package/lib/main/node/plugin-deployer-directory-handler-context-impl.d.ts +1 -0
- package/lib/main/node/plugin-deployer-directory-handler-context-impl.d.ts.map +1 -1
- package/lib/main/node/plugin-deployer-directory-handler-context-impl.js +17 -0
- package/lib/main/node/plugin-deployer-directory-handler-context-impl.js.map +1 -1
- package/lib/main/node/plugin-deployer-file-handler-context-impl.d.ts.map +1 -1
- package/lib/main/node/plugin-deployer-file-handler-context-impl.js +0 -1
- package/lib/main/node/plugin-deployer-file-handler-context-impl.js.map +1 -1
- package/lib/main/node/plugin-deployer-impl.d.ts +10 -7
- package/lib/main/node/plugin-deployer-impl.d.ts.map +1 -1
- package/lib/main/node/plugin-deployer-impl.js +84 -38
- package/lib/main/node/plugin-deployer-impl.js.map +1 -1
- package/lib/main/node/plugin-ext-backend-module.d.ts.map +1 -1
- package/lib/main/node/plugin-ext-backend-module.js +2 -0
- package/lib/main/node/plugin-ext-backend-module.js.map +1 -1
- package/lib/main/node/plugin-server-handler.d.ts +5 -4
- package/lib/main/node/plugin-server-handler.d.ts.map +1 -1
- package/lib/main/node/plugin-server-handler.js +12 -5
- package/lib/main/node/plugin-server-handler.js.map +1 -1
- package/lib/main/node/plugin-uninstallation-manager.d.ts +15 -0
- package/lib/main/node/plugin-uninstallation-manager.d.ts.map +1 -0
- package/lib/main/node/plugin-uninstallation-manager.js +85 -0
- package/lib/main/node/plugin-uninstallation-manager.js.map +1 -0
- package/lib/plugin/{node/debug/debug.d.ts → debug/debug-ext.d.ts} +15 -13
- package/lib/plugin/debug/debug-ext.d.ts.map +1 -0
- package/lib/plugin/{node/debug/debug.js → debug/debug-ext.js} +17 -51
- package/lib/plugin/debug/debug-ext.js.map +1 -0
- package/lib/plugin/debug/plugin-debug-adapter-creator.d.ts +11 -0
- package/lib/plugin/debug/plugin-debug-adapter-creator.d.ts.map +1 -0
- package/lib/plugin/debug/plugin-debug-adapter-creator.js +42 -0
- package/lib/plugin/debug/plugin-debug-adapter-creator.js.map +1 -0
- package/lib/plugin/{node/debug → debug}/plugin-debug-adapter-session.d.ts +4 -4
- package/lib/plugin/debug/plugin-debug-adapter-session.d.ts.map +1 -0
- package/lib/plugin/{node/debug → debug}/plugin-debug-adapter-session.js +1 -1
- package/lib/plugin/debug/plugin-debug-adapter-session.js.map +1 -0
- package/lib/plugin/{node/debug → debug}/plugin-debug-adapter-tracker.d.ts +0 -0
- package/lib/plugin/debug/plugin-debug-adapter-tracker.d.ts.map +1 -0
- package/lib/plugin/{node/debug → debug}/plugin-debug-adapter-tracker.js +0 -0
- package/lib/plugin/debug/plugin-debug-adapter-tracker.js.map +1 -0
- package/lib/plugin/languages-utils.d.ts.map +1 -1
- package/lib/plugin/languages-utils.js +3 -2
- package/lib/plugin/languages-utils.js.map +1 -1
- package/lib/plugin/node/debug/plugin-node-debug-adapter-creator.d.ts +18 -0
- package/lib/plugin/node/debug/plugin-node-debug-adapter-creator.d.ts.map +1 -0
- package/lib/plugin/node/debug/plugin-node-debug-adapter-creator.js +155 -0
- package/lib/plugin/node/debug/plugin-node-debug-adapter-creator.js.map +1 -0
- package/lib/plugin/plugin-context.d.ts +1 -1
- package/lib/plugin/plugin-context.d.ts.map +1 -1
- package/lib/plugin/plugin-context.js +1 -2
- package/lib/plugin/plugin-context.js.map +1 -1
- package/lib/plugin/plugin-manager.d.ts.map +1 -1
- package/lib/plugin/plugin-manager.js +5 -9
- package/lib/plugin/plugin-manager.js.map +1 -1
- package/lib/plugin/text-editor.d.ts +2 -0
- package/lib/plugin/text-editor.d.ts.map +1 -1
- package/lib/plugin/text-editor.js +9 -0
- package/lib/plugin/text-editor.js.map +1 -1
- package/lib/plugin/theming.d.ts +1 -1
- package/lib/plugin/theming.d.ts.map +1 -1
- package/lib/plugin/tree/tree-views.d.ts +1 -0
- package/lib/plugin/tree/tree-views.d.ts.map +1 -1
- package/lib/plugin/tree/tree-views.js +10 -9
- package/lib/plugin/tree/tree-views.js.map +1 -1
- package/lib/plugin/types-impl.d.ts +1 -0
- package/lib/plugin/types-impl.d.ts.map +1 -1
- package/lib/plugin/types-impl.js +3 -2
- package/lib/plugin/types-impl.js.map +1 -1
- package/package.json +26 -25
- package/src/common/connection.ts +3 -4
- package/src/common/plugin-api-rpc.ts +20 -12
- package/src/common/plugin-identifiers.ts +84 -0
- package/src/common/plugin-protocol.ts +57 -12
- package/src/hosted/browser/hosted-plugin.ts +28 -21
- package/src/hosted/browser/worker/debug-stub.ts +1 -1
- package/src/hosted/browser/worker/plugin-manifest-loader.ts +4 -2
- package/src/hosted/node/hosted-plugin-deployer-handler.ts +109 -28
- package/src/hosted/node/hosted-plugin-localization-service.ts +4 -6
- package/src/hosted/node/hosted-plugin-process.ts +4 -4
- package/src/hosted/node/hosted-plugin.ts +2 -2
- package/src/hosted/node/metadata-scanner.ts +8 -6
- package/src/hosted/node/plugin-host-rpc.ts +2 -2
- package/src/hosted/node/plugin-manifest-loader.ts +2 -0
- package/src/hosted/node/plugin-service.ts +79 -23
- package/src/hosted/node/scanners/scanner-theia.ts +7 -4
- package/src/main/browser/custom-editors/custom-editor-opener.tsx +2 -2
- package/src/main/browser/debug/plugin-debug-session-factory.ts +2 -2
- package/src/main/browser/documents-main.ts +26 -8
- package/src/main/browser/editors-and-documents-main.ts +16 -2
- package/src/main/browser/languages-main.ts +2 -1
- package/src/main/browser/main-context.ts +4 -3
- package/src/main/browser/plugin-contribution-handler.ts +41 -3
- package/src/main/browser/plugin-icon-theme-service.ts +1 -1
- package/src/main/browser/plugin-shared-style.ts +9 -5
- package/src/main/browser/text-editors-main.ts +12 -2
- package/src/main/browser/theming-main.ts +3 -7
- package/src/main/browser/view/plugin-tree-view-node-label-provider.ts +7 -5
- package/src/main/browser/view/plugin-view-registry.ts +12 -7
- package/src/main/browser/view/tree-view-widget.tsx +45 -17
- package/src/main/browser/webview/webview-theme-data-provider.ts +7 -10
- package/src/main/node/handlers/plugin-theia-directory-handler.ts +56 -28
- package/src/main/node/handlers/plugin-theia-file-handler.ts +26 -4
- package/src/main/node/plugin-cli-contribution.ts +12 -0
- package/src/main/node/plugin-deployer-directory-handler-context-impl.ts +17 -1
- package/src/main/node/plugin-deployer-file-handler-context-impl.ts +0 -1
- package/src/main/node/plugin-deployer-impl.ts +88 -41
- package/src/main/node/plugin-ext-backend-module.ts +3 -0
- package/src/main/node/plugin-server-handler.ts +15 -7
- package/src/main/node/plugin-uninstallation-manager.ts +74 -0
- package/src/plugin/{node/debug/debug.ts → debug/debug-ext.ts} +25 -56
- package/src/plugin/debug/plugin-debug-adapter-creator.ts +50 -0
- package/src/plugin/{node/debug → debug}/plugin-debug-adapter-session.ts +4 -4
- package/src/plugin/{node/debug → debug}/plugin-debug-adapter-tracker.ts +0 -0
- package/src/plugin/languages-utils.ts +3 -2
- package/src/plugin/node/debug/plugin-node-debug-adapter-creator.ts +167 -0
- package/src/plugin/plugin-context.ts +2 -3
- package/src/plugin/plugin-manager.ts +5 -9
- package/src/plugin/text-editor.ts +16 -5
- package/src/plugin/theming.ts +1 -1
- package/src/plugin/tree/tree-views.ts +15 -12
- package/src/plugin/types-impl.ts +1 -1
- package/lib/main/browser/custom-editors/glob.d.ts +0 -51
- package/lib/main/browser/custom-editors/glob.d.ts.map +0 -1
- package/lib/main/browser/custom-editors/glob.js +0 -593
- package/lib/main/browser/custom-editors/glob.js.map +0 -1
- package/lib/main/browser/custom-editors/paths.d.ts +0 -25
- package/lib/main/browser/custom-editors/paths.d.ts.map +0 -1
- package/lib/main/browser/custom-editors/paths.js +0 -227
- package/lib/main/browser/custom-editors/paths.js.map +0 -1
- package/lib/main/browser/editor/untitled-resource.d.ts +0 -3
- package/lib/main/browser/editor/untitled-resource.d.ts.map +0 -1
- package/lib/main/browser/editor/untitled-resource.js +0 -24
- package/lib/main/browser/editor/untitled-resource.js.map +0 -1
- package/lib/plugin/node/debug/debug.d.ts.map +0 -1
- package/lib/plugin/node/debug/debug.js.map +0 -1
- package/lib/plugin/node/debug/plugin-debug-adapter-executable-resolver.d.ts +0 -7
- package/lib/plugin/node/debug/plugin-debug-adapter-executable-resolver.d.ts.map +0 -1
- package/lib/plugin/node/debug/plugin-debug-adapter-executable-resolver.js +0 -57
- package/lib/plugin/node/debug/plugin-debug-adapter-executable-resolver.js.map +0 -1
- package/lib/plugin/node/debug/plugin-debug-adapter-session.d.ts.map +0 -1
- package/lib/plugin/node/debug/plugin-debug-adapter-session.js.map +0 -1
- package/lib/plugin/node/debug/plugin-debug-adapter-starter.d.ts +0 -15
- package/lib/plugin/node/debug/plugin-debug-adapter-starter.d.ts.map +0 -1
- package/lib/plugin/node/debug/plugin-debug-adapter-starter.js +0 -85
- package/lib/plugin/node/debug/plugin-debug-adapter-starter.js.map +0 -1
- package/lib/plugin/node/debug/plugin-debug-adapter-tracker.d.ts.map +0 -1
- package/lib/plugin/node/debug/plugin-debug-adapter-tracker.js.map +0 -1
- package/lib/plugin/node/debug/plugin-inline-debug-adapter.d.ts +0 -19
- package/lib/plugin/node/debug/plugin-inline-debug-adapter.d.ts.map +0 -1
- package/lib/plugin/node/debug/plugin-inline-debug-adapter.js +0 -45
- package/lib/plugin/node/debug/plugin-inline-debug-adapter.js.map +0 -1
- package/src/main/browser/custom-editors/glob.ts +0 -743
- package/src/main/browser/custom-editors/paths.ts +0 -250
- package/src/main/browser/editor/untitled-resource.ts +0 -18
- package/src/plugin/node/debug/plugin-debug-adapter-executable-resolver.ts +0 -58
- package/src/plugin/node/debug/plugin-debug-adapter-starter.ts +0 -86
- package/src/plugin/node/debug/plugin-inline-debug-adapter.ts +0 -47
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2021 SAP SE or an SAP affiliate company 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 WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
// copied from https://github.com/Microsoft/vscode/blob/bf7ac9201e7a7d01741d4e6e64b5dc9f3197d97b/src/vs/base/common/paths.ts
|
|
18
|
-
/*---------------------------------------------------------------------------------------------
|
|
19
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
20
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
21
|
-
*--------------------------------------------------------------------------------------------*/
|
|
22
|
-
/* eslint-disable no-void */
|
|
23
|
-
/* eslint-disable no-null/no-null */
|
|
24
|
-
'use strict';
|
|
25
|
-
import { isWindows } from '@theia/core/lib/common/os';
|
|
26
|
-
import { startsWithIgnoreCase } from '@theia/core/lib/common/strings';
|
|
27
|
-
import { CharCode } from '@theia/core/lib/common/char-code';
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* The forward slash path separator.
|
|
31
|
-
*/
|
|
32
|
-
export const sep = '/';
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* The native path separator depending on the OS.
|
|
36
|
-
*/
|
|
37
|
-
export const nativeSep = isWindows ? '\\' : '/';
|
|
38
|
-
|
|
39
|
-
const _posixBadPath = /(\/\.\.?\/)|(\/\.\.?)$|^(\.\.?\/)|(\/\/+)|(\\)/;
|
|
40
|
-
const _winBadPath = /(\\\.\.?\\)|(\\\.\.?)$|^(\.\.?\\)|(\\\\+)|(\/)/;
|
|
41
|
-
|
|
42
|
-
function _isNormal(path: string, win: boolean): boolean {
|
|
43
|
-
return win
|
|
44
|
-
? !_winBadPath.test(path)
|
|
45
|
-
: !_posixBadPath.test(path);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* @returns the base name of a path.
|
|
50
|
-
*/
|
|
51
|
-
export function basename(path: string): string {
|
|
52
|
-
const idx = ~path.lastIndexOf('/') || ~path.lastIndexOf('\\');
|
|
53
|
-
if (idx === 0) {
|
|
54
|
-
return path;
|
|
55
|
-
} else if (~idx === path.length - 1) {
|
|
56
|
-
return basename(path.substring(0, path.length - 1));
|
|
57
|
-
} else {
|
|
58
|
-
return path.substr(~idx + 1);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* @returns `.far` from `boo.far` or the empty string.
|
|
64
|
-
*/
|
|
65
|
-
export function extname(path: string): string {
|
|
66
|
-
path = basename(path);
|
|
67
|
-
const idx = ~path.lastIndexOf('.');
|
|
68
|
-
return idx ? path.substring(~idx) : '';
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export function normalize(path: string, toOSPath?: boolean): string {
|
|
72
|
-
if (path === null || path === void 0) {
|
|
73
|
-
return path;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
const len = path.length;
|
|
77
|
-
if (len === 0) {
|
|
78
|
-
return '.';
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
const wantsBackslash = isWindows && toOSPath;
|
|
82
|
-
if (_isNormal(path, wantsBackslash!)) {
|
|
83
|
-
return path;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
87
|
-
const sep = wantsBackslash ? '\\' : '/';
|
|
88
|
-
const root = getRoot(path, sep);
|
|
89
|
-
|
|
90
|
-
// skip the root-portion of the path
|
|
91
|
-
let start = root.length;
|
|
92
|
-
let skip = false;
|
|
93
|
-
let res = '';
|
|
94
|
-
|
|
95
|
-
for (let end = root.length; end <= len; end++) {
|
|
96
|
-
|
|
97
|
-
// either at the end or at a path-separator character
|
|
98
|
-
if (end === len || path.charCodeAt(end) === CharCode.Slash || path.charCodeAt(end) === CharCode.Backslash) {
|
|
99
|
-
|
|
100
|
-
if (streql(path, start, end, '..')) {
|
|
101
|
-
// skip current and remove parent (if there is already something)
|
|
102
|
-
const prev_start = res.lastIndexOf(sep);
|
|
103
|
-
const prev_part = res.slice(prev_start + 1);
|
|
104
|
-
if ((root || prev_part.length > 0) && prev_part !== '..') {
|
|
105
|
-
res = prev_start === -1 ? '' : res.slice(0, prev_start);
|
|
106
|
-
skip = true;
|
|
107
|
-
}
|
|
108
|
-
} else if (streql(path, start, end, '.') && (root || res || end < len - 1)) {
|
|
109
|
-
// skip current (if there is already something or if there is more to come)
|
|
110
|
-
skip = true;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
if (!skip) {
|
|
114
|
-
const part = path.slice(start, end);
|
|
115
|
-
if (res !== '' && res[res.length - 1] !== sep) {
|
|
116
|
-
res += sep;
|
|
117
|
-
}
|
|
118
|
-
res += part;
|
|
119
|
-
}
|
|
120
|
-
start = end + 1;
|
|
121
|
-
skip = false;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
return root + res;
|
|
126
|
-
}
|
|
127
|
-
function streql(value: string, start: number, end: number, other: string): boolean {
|
|
128
|
-
return start + other.length === end && value.indexOf(other, start) === start;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* Computes the _root_ this path, like `getRoot('c:\files') === c:\`,
|
|
133
|
-
* `getRoot('files:///files/path') === files:///`,
|
|
134
|
-
* or `getRoot('\\server\shares\path') === \\server\shares\`
|
|
135
|
-
*/
|
|
136
|
-
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
137
|
-
export function getRoot(path: string, sep: string = '/'): string {
|
|
138
|
-
|
|
139
|
-
if (!path) {
|
|
140
|
-
return '';
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
const len = path.length;
|
|
144
|
-
let code = path.charCodeAt(0);
|
|
145
|
-
if (code === CharCode.Slash || code === CharCode.Backslash) {
|
|
146
|
-
|
|
147
|
-
code = path.charCodeAt(1);
|
|
148
|
-
if (code === CharCode.Slash || code === CharCode.Backslash) {
|
|
149
|
-
// UNC candidate \\localhost\shares\ddd
|
|
150
|
-
// ^^^^^^^^^^^^^^^^^^^
|
|
151
|
-
code = path.charCodeAt(2);
|
|
152
|
-
if (code !== CharCode.Slash && code !== CharCode.Backslash) {
|
|
153
|
-
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
154
|
-
let pos = 3;
|
|
155
|
-
const start = pos;
|
|
156
|
-
for (; pos < len; pos++) {
|
|
157
|
-
code = path.charCodeAt(pos);
|
|
158
|
-
if (code === CharCode.Slash || code === CharCode.Backslash) {
|
|
159
|
-
break;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
code = path.charCodeAt(pos + 1);
|
|
163
|
-
if (start !== pos && code !== CharCode.Slash && code !== CharCode.Backslash) {
|
|
164
|
-
pos += 1;
|
|
165
|
-
for (; pos < len; pos++) {
|
|
166
|
-
code = path.charCodeAt(pos);
|
|
167
|
-
if (code === CharCode.Slash || code === CharCode.Backslash) {
|
|
168
|
-
return path.slice(0, pos + 1) // consume this separator
|
|
169
|
-
.replace(/[\\/]/g, sep);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
// /user/far
|
|
177
|
-
// ^
|
|
178
|
-
return sep;
|
|
179
|
-
|
|
180
|
-
} else if ((code >= CharCode.A && code <= CharCode.Z) || (code >= CharCode.a && code <= CharCode.z)) {
|
|
181
|
-
// check for windows drive letter c:\ or c:
|
|
182
|
-
|
|
183
|
-
if (path.charCodeAt(1) === CharCode.Colon) {
|
|
184
|
-
code = path.charCodeAt(2);
|
|
185
|
-
if (code === CharCode.Slash || code === CharCode.Backslash) {
|
|
186
|
-
// C:\fff
|
|
187
|
-
// ^^^
|
|
188
|
-
return path.slice(0, 2) + sep;
|
|
189
|
-
} else {
|
|
190
|
-
// C:
|
|
191
|
-
// ^^
|
|
192
|
-
return path.slice(0, 2);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
// check for URI
|
|
198
|
-
// scheme://authority/path
|
|
199
|
-
// ^^^^^^^^^^^^^^^^^^^
|
|
200
|
-
let pos = path.indexOf('://');
|
|
201
|
-
if (pos !== -1) {
|
|
202
|
-
pos += 3; // 3 -> "://".length
|
|
203
|
-
for (; pos < len; pos++) {
|
|
204
|
-
code = path.charCodeAt(pos);
|
|
205
|
-
if (code === CharCode.Slash || code === CharCode.Backslash) {
|
|
206
|
-
return path.slice(0, pos + 1); // consume this separator
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
return '';
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
export function isEqualOrParent(path: string, candidate: string, ignoreCase?: boolean): boolean {
|
|
215
|
-
if (path === candidate) {
|
|
216
|
-
return true;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
if (!path || !candidate) {
|
|
220
|
-
return false;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
if (candidate.length > path.length) {
|
|
224
|
-
return false;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
if (ignoreCase) {
|
|
228
|
-
const beginsWith = startsWithIgnoreCase(path, candidate);
|
|
229
|
-
if (!beginsWith) {
|
|
230
|
-
return false;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
if (candidate.length === path.length) {
|
|
234
|
-
return true; // same path, different casing
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
let sepOffset = candidate.length;
|
|
238
|
-
if (candidate.charAt(candidate.length - 1) === nativeSep) {
|
|
239
|
-
sepOffset--; // adjust the expected sep offset in case our candidate already ends in separator character
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
return path.charAt(sepOffset) === nativeSep;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
if (candidate.charAt(candidate.length - 1) !== nativeSep) {
|
|
246
|
-
candidate += nativeSep;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
return path.indexOf(candidate) === 0;
|
|
250
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2018 Red Hat, Inc. 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 WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
/** @deprecated @since 1.24. Import from `core/lib/common/resource` instead. */
|
|
18
|
-
export { UntitledResourceResolver, UntitledResource, createUntitledURI } from '@theia/core/lib/common/resource';
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2018 Red Hat, Inc. 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 WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
import * as path from 'path';
|
|
18
|
-
import * as theia from '@theia/plugin';
|
|
19
|
-
import { PlatformSpecificAdapterContribution, PluginPackageDebuggersContribution } from '../../../common';
|
|
20
|
-
import { isWindows, isOSX } from '@theia/core/lib/common/os';
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Resolves [DebugAdapterExecutable](#DebugAdapterExecutable) based on contribution.
|
|
24
|
-
*/
|
|
25
|
-
export async function resolveDebugAdapterExecutable(
|
|
26
|
-
pluginPath: string, debuggerContribution: PluginPackageDebuggersContribution): Promise<theia.DebugAdapterExecutable | undefined> {
|
|
27
|
-
const info = toPlatformInfo(debuggerContribution);
|
|
28
|
-
let program = (info && info.program || debuggerContribution.program);
|
|
29
|
-
if (!program) {
|
|
30
|
-
return undefined;
|
|
31
|
-
}
|
|
32
|
-
program = path.join(pluginPath, program);
|
|
33
|
-
const programArgs = info && info.args || debuggerContribution.args || [];
|
|
34
|
-
let runtime = info && info.runtime || debuggerContribution.runtime;
|
|
35
|
-
if (runtime && runtime.indexOf('./') === 0) {
|
|
36
|
-
runtime = path.join(pluginPath, runtime);
|
|
37
|
-
}
|
|
38
|
-
const runtimeArgs = info && info.runtimeArgs || debuggerContribution.runtimeArgs || [];
|
|
39
|
-
const command = runtime ? runtime : program;
|
|
40
|
-
const args = runtime ? [...runtimeArgs, program, ...programArgs] : programArgs;
|
|
41
|
-
return {
|
|
42
|
-
command,
|
|
43
|
-
args
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function toPlatformInfo(executable: PluginPackageDebuggersContribution): PlatformSpecificAdapterContribution | undefined {
|
|
48
|
-
if (isWindows && !process.env.hasOwnProperty('PROCESSOR_ARCHITEW6432')) {
|
|
49
|
-
return executable.winx86 || executable.win || executable.windows;
|
|
50
|
-
}
|
|
51
|
-
if (isWindows) {
|
|
52
|
-
return executable.win || executable.windows;
|
|
53
|
-
}
|
|
54
|
-
if (isOSX) {
|
|
55
|
-
return executable.osx;
|
|
56
|
-
}
|
|
57
|
-
return executable.linux;
|
|
58
|
-
}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2018 Red Hat, Inc. 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 WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
import * as net from 'net';
|
|
18
|
-
import { ChildProcess, spawn, fork, ForkOptions } from 'child_process';
|
|
19
|
-
import { DebugAdapter } from '@theia/debug/lib/node/debug-model';
|
|
20
|
-
import { DebugAdapterExecutable, DebugAdapterInlineImplementation, DebugAdapterNamedPipeServer, DebugAdapterServer } from '../../types-impl';
|
|
21
|
-
import { InlineDebugAdapter } from './plugin-inline-debug-adapter';
|
|
22
|
-
import { ProcessDebugAdapter, SocketDebugAdapter } from '@theia/debug/lib/node/stream-debug-adapter';
|
|
23
|
-
const isElectron = require('is-electron');
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Starts debug adapter process.
|
|
27
|
-
*/
|
|
28
|
-
export function startDebugAdapter(executable: DebugAdapterExecutable): DebugAdapter {
|
|
29
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
30
|
-
const options: any = { stdio: ['pipe', 'pipe', 2] };
|
|
31
|
-
|
|
32
|
-
if (executable.options) {
|
|
33
|
-
options.cwd = executable.options.cwd;
|
|
34
|
-
|
|
35
|
-
// The additional environment of the executed program or shell. If omitted
|
|
36
|
-
// the parent process' environment is used. If provided it is merged with
|
|
37
|
-
// the parent process' environment.
|
|
38
|
-
options.env = Object.assign({}, process.env);
|
|
39
|
-
Object.assign(options.env, executable.options.env);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
let childProcess: ChildProcess;
|
|
43
|
-
const { command, args } = executable;
|
|
44
|
-
if (command === 'node') {
|
|
45
|
-
if (Array.isArray(args) && args.length > 0) {
|
|
46
|
-
const forkOptions: ForkOptions = {
|
|
47
|
-
env: options.env,
|
|
48
|
-
// When running in Electron, fork will automatically add ELECTRON_RUN_AS_NODE=1 to the env,
|
|
49
|
-
// but this will cause issues when debugging Electron apps, so we'll remove it.
|
|
50
|
-
execArgv: isElectron()
|
|
51
|
-
? ['-e', 'delete process.env.ELECTRON_RUN_AS_NODE;require(process.argv[1])']
|
|
52
|
-
: [],
|
|
53
|
-
silent: true
|
|
54
|
-
};
|
|
55
|
-
if (options.cwd) {
|
|
56
|
-
forkOptions.cwd = options.cwd;
|
|
57
|
-
}
|
|
58
|
-
options.stdio.push('ipc');
|
|
59
|
-
forkOptions.stdio = options.stdio;
|
|
60
|
-
childProcess = fork(args[0], args.slice(1), forkOptions);
|
|
61
|
-
} else {
|
|
62
|
-
throw new Error(`It is not possible to launch debug adapter with the command: ${JSON.stringify(executable)}`);
|
|
63
|
-
}
|
|
64
|
-
} else {
|
|
65
|
-
childProcess = spawn(command, args, options);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return new ProcessDebugAdapter(childProcess);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Connects to a remote debug server.
|
|
73
|
-
*/
|
|
74
|
-
export function connectSocketDebugAdapter(server: DebugAdapterServer): SocketDebugAdapter {
|
|
75
|
-
const socket = net.createConnection(server.port, server.host);
|
|
76
|
-
return new SocketDebugAdapter(socket);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export function connectPipeDebugAdapter(adapter: DebugAdapterNamedPipeServer): SocketDebugAdapter {
|
|
80
|
-
const socket = net.createConnection(adapter.path);
|
|
81
|
-
return new SocketDebugAdapter(socket);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export function connectInlineDebugAdapter(adapter: DebugAdapterInlineImplementation): InlineDebugAdapter {
|
|
85
|
-
return new InlineDebugAdapter(adapter.implementation);
|
|
86
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2021 Red Hat, Inc. 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 WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
import { Emitter, Event } from '@theia/core/lib/common/event';
|
|
18
|
-
import { DebugAdapter } from '@theia/debug/lib/node/debug-model';
|
|
19
|
-
import * as theia from '@theia/plugin';
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* A debug adapter for using the inline implementation from a plugin.
|
|
23
|
-
*/
|
|
24
|
-
export class InlineDebugAdapter implements DebugAdapter {
|
|
25
|
-
private messageReceivedEmitter = new Emitter<string>();
|
|
26
|
-
onMessageReceived: Event<string> = this.messageReceivedEmitter.event;
|
|
27
|
-
onError: Event<Error> = Event.None;
|
|
28
|
-
private closeEmitter = new Emitter<void>();
|
|
29
|
-
onClose: Event<void> = this.closeEmitter.event;
|
|
30
|
-
|
|
31
|
-
constructor(private debugAdapter: theia.DebugAdapter) {
|
|
32
|
-
this.debugAdapter.onDidSendMessage(msg => {
|
|
33
|
-
this.messageReceivedEmitter.fire(JSON.stringify(msg));
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
async start(): Promise<void> {
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
send(message: string): void {
|
|
41
|
-
this.debugAdapter.handleMessage(JSON.parse(message));
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
async stop(): Promise<void> {
|
|
45
|
-
this.debugAdapter.dispose();
|
|
46
|
-
}
|
|
47
|
-
}
|