@theia/core 1.21.0-next.21 → 1.21.0-next.29
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/README.md +0 -1
- package/lib/browser/core-preferences.d.ts.map +1 -1
- package/lib/browser/core-preferences.js +2 -2
- package/lib/browser/core-preferences.js.map +1 -1
- package/lib/browser/index.d.ts +1 -0
- package/lib/browser/index.d.ts.map +1 -1
- package/lib/browser/index.js +1 -0
- package/lib/browser/index.js.map +1 -1
- package/lib/browser/markdown-renderer.d.ts +33 -0
- package/lib/browser/markdown-renderer.d.ts.map +1 -0
- package/lib/browser/markdown-renderer.js +72 -0
- package/lib/browser/markdown-renderer.js.map +1 -0
- package/lib/browser/markdown-renderer.spec.d.ts +17 -0
- package/lib/browser/markdown-renderer.spec.d.ts.map +1 -0
- package/lib/browser/markdown-renderer.spec.js +71 -0
- package/lib/browser/markdown-renderer.spec.js.map +1 -0
- package/lib/common/index.d.ts +1 -0
- package/lib/common/index.d.ts.map +1 -1
- package/lib/common/index.js +1 -0
- package/lib/common/index.js.map +1 -1
- package/lib/common/lsp-types.d.ts +1 -1
- package/lib/common/lsp-types.d.ts.map +1 -1
- package/lib/common/lsp-types.js +2 -2
- package/lib/common/lsp-types.js.map +1 -1
- package/lib/common/numbers.d.ts +21 -0
- package/lib/common/numbers.d.ts.map +1 -0
- package/lib/common/numbers.js +24 -0
- package/lib/common/numbers.js.map +1 -0
- package/lib/common/severity.d.ts +1 -1
- package/lib/common/severity.d.ts.map +1 -1
- package/lib/common/severity.js +7 -7
- package/lib/common/severity.js.map +1 -1
- package/lib/electron-browser/window/electron-window-service.d.ts +1 -1
- package/lib/electron-browser/window/electron-window-service.js +1 -1
- package/package.json +4 -5
- package/src/browser/core-preferences.ts +2 -3
- package/src/browser/index.ts +1 -0
- package/src/browser/markdown-renderer.spec.ts +78 -0
- package/src/browser/markdown-renderer.ts +76 -0
- package/src/common/index.ts +1 -0
- package/src/common/lsp-types.ts +1 -1
- package/src/common/numbers.ts +21 -0
- package/src/common/severity.ts +1 -1
- package/src/electron-browser/window/electron-window-service.ts +1 -1
- package/shared/vscode-languageserver-types.d.ts +0 -1
- package/shared/vscode-languageserver-types.js +0 -1
package/README.md
CHANGED
|
@@ -94,7 +94,6 @@ export class SomeClass {
|
|
|
94
94
|
- [`react-dom@^16.8.0`](https://www.npmjs.com/package/react-dom)
|
|
95
95
|
- [`react-virtualized@^9.20.0`](https://www.npmjs.com/package/react-virtualized)
|
|
96
96
|
- [`vscode-languageserver-protocol@~3.15.3`](https://www.npmjs.com/package/vscode-languageserver-protocol)
|
|
97
|
-
- [`vscode-languageserver-types@^3.15.1`](https://www.npmjs.com/package/vscode-languageserver-types)
|
|
98
97
|
- [`vscode-uri@^2.1.1`](https://www.npmjs.com/package/vscode-uri)
|
|
99
98
|
- [`vscode-ws-jsonrpc@^0.2.0`](https://www.npmjs.com/package/vscode-ws-jsonrpc)
|
|
100
99
|
- [`ws@^7.1.2`](https://www.npmjs.com/package/ws)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-preferences.d.ts","sourceRoot":"","sources":["../../src/browser/core-preferences.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAyB,eAAe,EAAE,iBAAiB,EAA0B,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAMpI,eAAO,MAAM,oBAAoB,EAAE,
|
|
1
|
+
{"version":3,"file":"core-preferences.d.ts","sourceRoot":"","sources":["../../src/browser/core-preferences.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAyB,eAAe,EAAE,iBAAiB,EAA0B,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAMpI,eAAO,MAAM,oBAAoB,EAAE,gBAmHlC,CAAC;AAEF,MAAM,WAAW,iBAAiB;IAC9B,yBAAyB,EAAE,OAAO,GAAG,YAAY,GAAG,QAAQ,CAAC;IAC7D,qBAAqB,EAAE,OAAO,CAAC;IAC/B,gBAAgB,EAAE,MAAM,CAAA;IACxB,mBAAmB,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,0BAA0B,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;IACzE,yBAAyB,EAAE,aAAa,GAAG,aAAa,CAAC;IACzD,kCAAkC,EAAE,MAAM,CAAC;IAC3C,wCAAwC,EAAE,OAAO,CAAC;IAClD,oCAAoC,EAAE,OAAO,CAAC;IAC9C,sBAAsB,EAAE,MAAM,CAAC;IAC/B,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,+BAA+B,EAAE,OAAO,CAAC;IACzC,6BAA6B,EAAE,OAAO,CAAC;IACvC,mCAAmC,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;IACnE,uBAAuB,EAAE,MAAM,CAAC;CACnC;AAED,eAAO,MAAM,0BAA0B,eAAuC,CAAC;AAC/E,eAAO,MAAM,eAAe,eAA4B,CAAC;AACzD,oBAAY,eAAe,GAAG,eAAe,CAAC,iBAAiB,CAAC,CAAC;AAEjE,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,iBAAiB,EAAE,MAAM,GAAE,gBAAuC,GAAG,eAAe,CAEtI;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,GAAG,IAAI,CAQ/D"}
|
|
@@ -57,7 +57,7 @@ exports.corePreferenceSchema = {
|
|
|
57
57
|
'keyCode',
|
|
58
58
|
],
|
|
59
59
|
default: 'code',
|
|
60
|
-
|
|
60
|
+
markdownDescription: nls_1.nls.localizeByDefault('Controls the dispatching logic for key presses to use either `code` (recommended) or `keyCode`.')
|
|
61
61
|
},
|
|
62
62
|
'window.menuBarVisibility': {
|
|
63
63
|
type: 'string',
|
|
@@ -87,7 +87,7 @@ exports.corePreferenceSchema = {
|
|
|
87
87
|
'workbench.editor.highlightModifiedTabs': {
|
|
88
88
|
'type': 'boolean',
|
|
89
89
|
// eslint-disable-next-line max-len
|
|
90
|
-
'
|
|
90
|
+
'markdownDescription': nls_1.nls.localize('theia/core/highlightModifiedTabs', 'Controls whether a top border is drawn on modified (dirty) editor tabs or not.'),
|
|
91
91
|
'default': false
|
|
92
92
|
},
|
|
93
93
|
'workbench.editor.closeOnFileDelete': {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-preferences.js","sourceRoot":"","sources":["../../src/browser/core-preferences.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAGlF,+CAAoI;AACpI,+DAA4D;AAC5D,iGAA2F;AAC3F,qCAAqC;AACrC,uCAAoC;AAEvB,QAAA,oBAAoB,GAAqB;IAClD,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE;QACR,yBAAyB,EAAE;YACvB,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE;gBACF,OAAO;gBACP,YAAY;gBACZ,QAAQ;aACX;YACD,OAAO,EAAE,YAAY;YACrB,mCAAmC;YACnC,WAAW,EAAE,SAAG,CAAC,iBAAiB,CAAC,kQAAkQ,CAAC;SACzS;QACD,qBAAqB,EAAE;YACnB,MAAM,EAAE,SAAS;YACjB,SAAS,EAAE,IAAI;YACf,aAAa,EAAE,SAAG,CAAC,iBAAiB,CAAC,wCAAwC,CAAC;YAC9E,OAAO,EAAE,aAAa;SACzB;QACD,gBAAgB,EAAE;YACd,MAAM,EAAE,QAAQ;YAChB,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,yCAAmB,CAAC;YACxC,SAAS,EAAE,MAAM;YACjB,aAAa,EAAE,SAAG,CAAC,iBAAiB,CAChC,6HAA6H,CAAC;YAClI,OAAO,EAAE,sBAAsB;YAC/B,kBAAkB,EAAE,MAAM,CAAC,IAAI,CAAC,yCAAmB,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,yCAAmB,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC;YACnG,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,yCAAmB,CAAC,CAAC,MAAM,GAAG,CAAC;SAC1D;QACD,mBAAmB,EAAE;YACjB,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE;gBACF,MAAM;gBACN,SAAS;aACZ;YACD,OAAO,EAAE,MAAM;YACf,
|
|
1
|
+
{"version":3,"file":"core-preferences.js","sourceRoot":"","sources":["../../src/browser/core-preferences.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAGlF,+CAAoI;AACpI,+DAA4D;AAC5D,iGAA2F;AAC3F,qCAAqC;AACrC,uCAAoC;AAEvB,QAAA,oBAAoB,GAAqB;IAClD,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE;QACR,yBAAyB,EAAE;YACvB,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE;gBACF,OAAO;gBACP,YAAY;gBACZ,QAAQ;aACX;YACD,OAAO,EAAE,YAAY;YACrB,mCAAmC;YACnC,WAAW,EAAE,SAAG,CAAC,iBAAiB,CAAC,kQAAkQ,CAAC;SACzS;QACD,qBAAqB,EAAE;YACnB,MAAM,EAAE,SAAS;YACjB,SAAS,EAAE,IAAI;YACf,aAAa,EAAE,SAAG,CAAC,iBAAiB,CAAC,wCAAwC,CAAC;YAC9E,OAAO,EAAE,aAAa;SACzB;QACD,gBAAgB,EAAE;YACd,MAAM,EAAE,QAAQ;YAChB,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,yCAAmB,CAAC;YACxC,SAAS,EAAE,MAAM;YACjB,aAAa,EAAE,SAAG,CAAC,iBAAiB,CAChC,6HAA6H,CAAC;YAClI,OAAO,EAAE,sBAAsB;YAC/B,kBAAkB,EAAE,MAAM,CAAC,IAAI,CAAC,yCAAmB,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,yCAAmB,CAAC,GAAG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jC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC"}
|
package/lib/browser/index.js
CHANGED
|
@@ -52,4 +52,5 @@ __exportStar(require("./core-preferences"), exports);
|
|
|
52
52
|
__exportStar(require("./view-container"), exports);
|
|
53
53
|
__exportStar(require("./breadcrumbs"), exports);
|
|
54
54
|
__exportStar(require("./tooltip-service"), exports);
|
|
55
|
+
__exportStar(require("./markdown-renderer"), exports);
|
|
55
56
|
//# sourceMappingURL=index.js.map
|
package/lib/browser/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;AAElF,0CAAwB;AACxB,yDAAuC;AACvC,6CAA2B;AAC3B,mDAAiC;AACjC,4CAA0B;AAC1B,0DAAwC;AACxC,4CAA0B;AAC1B,4CAA0B;AAC1B,yCAAuB;AACvB,8CAA4B;AAC5B,6CAA2B;AAC3B,iEAA+C;AAC/C,gDAA8B;AAC9B,mDAAiC;AACjC,6CAA2B;AAC3B,oDAAkC;AAClC,gDAA8B;AAC9B,+CAA6B;AAC7B,+CAA6B;AAC7B,mDAAiC;AACjC,wDAAsC;AACtC,gDAA8B;AAC9B,8CAA4B;AAC5B,qDAAmC;AACnC,mDAAiC;AACjC,gDAA8B;AAC9B,oDAAkC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;AAElF,0CAAwB;AACxB,yDAAuC;AACvC,6CAA2B;AAC3B,mDAAiC;AACjC,4CAA0B;AAC1B,0DAAwC;AACxC,4CAA0B;AAC1B,4CAA0B;AAC1B,yCAAuB;AACvB,8CAA4B;AAC5B,6CAA2B;AAC3B,iEAA+C;AAC/C,gDAA8B;AAC9B,mDAAiC;AACjC,6CAA2B;AAC3B,oDAAkC;AAClC,gDAA8B;AAC9B,+CAA6B;AAC7B,+CAA6B;AAC7B,mDAAiC;AACjC,wDAAsC;AACtC,gDAA8B;AAC9B,8CAA4B;AAC5B,qDAAmC;AACnC,mDAAiC;AACjC,gDAA8B;AAC9B,oDAAkC;AAClC,sDAAoC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (C) 2021 TypeFox 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
|
+
import * as markdownit from 'markdown-it';
|
|
17
|
+
export declare class MarkdownRenderer {
|
|
18
|
+
protected engine: markdownit;
|
|
19
|
+
protected callbacks: Map<string, ((element: Element) => Element | void)[]>;
|
|
20
|
+
constructor(engine?: markdownit);
|
|
21
|
+
/**
|
|
22
|
+
* Adds a modification callback that is applied to every element with the specified tag after rendering to HTML.
|
|
23
|
+
*
|
|
24
|
+
* @param tag The tag that this modification applies to.
|
|
25
|
+
* @param callback The modification to apply on every selected rendered element. Can either modify the element in place or return a new element.
|
|
26
|
+
*/
|
|
27
|
+
modify<K extends keyof HTMLElementTagNameMap>(tag: K, callback: (element: HTMLElementTagNameMap[K]) => Element | void): MarkdownRenderer;
|
|
28
|
+
render(markdown: string): HTMLElement;
|
|
29
|
+
renderInline(markdown: string): HTMLElement;
|
|
30
|
+
protected renderInternal(renderedHtml: string): HTMLElement;
|
|
31
|
+
protected sanitizeHtml(html: string): HTMLElement;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=markdown-renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown-renderer.d.ts","sourceRoot":"","sources":["../../src/browser/markdown-renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAGlF,OAAO,KAAK,UAAU,MAAM,aAAa,CAAC;AAE1C,qBAAa,gBAAgB;IAEzB,SAAS,CAAC,MAAM,EAAE,UAAU,CAAC;IAC7B,SAAS,CAAC,SAAS,yBAA8B,OAAO,KAAK,OAAO,GAAG,IAAI,KAAO;gBAEtE,MAAM,CAAC,EAAE,UAAU;IAI/B;;;;;OAKG;IACH,MAAM,CAAC,CAAC,SAAS,MAAM,qBAAqB,EAAE,GAAG,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,OAAO,EAAE,qBAAqB,CAAC,CAAC,CAAC,KAAK,OAAO,GAAG,IAAI,GAAG,gBAAgB;IASxI,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW;IAIrC,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW;IAI3C,SAAS,CAAC,cAAc,CAAC,YAAY,EAAE,MAAM,GAAG,WAAW;IAmB3D,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW;CAKpD"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/********************************************************************************
|
|
3
|
+
* Copyright (C) 2021 TypeFox 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 WITH Classpath-exception-2.0
|
|
16
|
+
********************************************************************************/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.MarkdownRenderer = void 0;
|
|
19
|
+
const DOMPurify = require("dompurify");
|
|
20
|
+
const markdownit = require("markdown-it");
|
|
21
|
+
class MarkdownRenderer {
|
|
22
|
+
constructor(engine) {
|
|
23
|
+
this.callbacks = new Map();
|
|
24
|
+
this.engine = engine !== null && engine !== void 0 ? engine : markdownit();
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Adds a modification callback that is applied to every element with the specified tag after rendering to HTML.
|
|
28
|
+
*
|
|
29
|
+
* @param tag The tag that this modification applies to.
|
|
30
|
+
* @param callback The modification to apply on every selected rendered element. Can either modify the element in place or return a new element.
|
|
31
|
+
*/
|
|
32
|
+
modify(tag, callback) {
|
|
33
|
+
if (this.callbacks.has(tag)) {
|
|
34
|
+
this.callbacks.get(tag).push(callback);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
this.callbacks.set(tag, [callback]);
|
|
38
|
+
}
|
|
39
|
+
return this;
|
|
40
|
+
}
|
|
41
|
+
render(markdown) {
|
|
42
|
+
return this.renderInternal(this.engine.render(markdown));
|
|
43
|
+
}
|
|
44
|
+
renderInline(markdown) {
|
|
45
|
+
return this.renderInternal(this.engine.renderInline(markdown));
|
|
46
|
+
}
|
|
47
|
+
renderInternal(renderedHtml) {
|
|
48
|
+
const div = this.sanitizeHtml(renderedHtml);
|
|
49
|
+
for (const [tag, calls] of this.callbacks) {
|
|
50
|
+
for (const callback of calls) {
|
|
51
|
+
const elements = Array.from(div.getElementsByTagName(tag));
|
|
52
|
+
for (const element of elements) {
|
|
53
|
+
const result = callback(element);
|
|
54
|
+
if (result) {
|
|
55
|
+
const parent = element.parentElement;
|
|
56
|
+
if (parent) {
|
|
57
|
+
parent.replaceChild(result, element);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return div;
|
|
64
|
+
}
|
|
65
|
+
sanitizeHtml(html) {
|
|
66
|
+
const div = document.createElement('div');
|
|
67
|
+
div.innerHTML = DOMPurify.sanitize(html);
|
|
68
|
+
return div;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
exports.MarkdownRenderer = MarkdownRenderer;
|
|
72
|
+
//# sourceMappingURL=markdown-renderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown-renderer.js","sourceRoot":"","sources":["../../src/browser/markdown-renderer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,uCAAuC;AACvC,0CAA0C;AAE1C,MAAa,gBAAgB;IAKzB,YAAY,MAAmB;QAFrB,cAAS,GAAG,IAAI,GAAG,EAAoD,CAAC;QAG9E,IAAI,CAAC,MAAM,GAAG,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,UAAU,EAAE,CAAC;IACzC,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAwC,GAAM,EAAE,QAA+D;QACjH,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;YACzB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SAC3C;aAAM;YACH,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;SACvC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,MAAM,CAAC,QAAgB;QACnB,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC7D,CAAC;IAED,YAAY,CAAC,QAAgB;QACzB,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;IACnE,CAAC;IAES,cAAc,CAAC,YAAoB;QACzC,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;QAC5C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,SAAS,EAAE;YACvC,KAAK,MAAM,QAAQ,IAAI,KAAK,EAAE;gBAC1B,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC,CAAC;gBAC3D,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;oBAC5B,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC;oBACjC,IAAI,MAAM,EAAE;wBACR,MAAM,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;wBACrC,IAAI,MAAM,EAAE;4BACR,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;yBACxC;qBACJ;iBACJ;aACJ;SACJ;QACD,OAAO,GAAG,CAAC;IACf,CAAC;IAES,YAAY,CAAC,IAAY;QAC/B,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC1C,GAAG,CAAC,SAAS,GAAG,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACzC,OAAO,GAAG,CAAC;IACf,CAAC;CACJ;AAxDD,4CAwDC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (C) 2021 TypeFox 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
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=markdown-renderer.spec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown-renderer.spec.d.ts","sourceRoot":"","sources":["../../src/browser/markdown-renderer.spec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/********************************************************************************
|
|
3
|
+
* Copyright (C) 2021 TypeFox 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 WITH Classpath-exception-2.0
|
|
16
|
+
********************************************************************************/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const jsdom_1 = require("../browser/test/jsdom");
|
|
19
|
+
let disableJSDOM = jsdom_1.enableJSDOM();
|
|
20
|
+
const chai_1 = require("chai");
|
|
21
|
+
const markdownit = require("markdown-it");
|
|
22
|
+
const markdown_renderer_1 = require("./markdown-renderer");
|
|
23
|
+
disableJSDOM();
|
|
24
|
+
describe('MarkdownRenderer', () => {
|
|
25
|
+
before(() => disableJSDOM = jsdom_1.enableJSDOM());
|
|
26
|
+
after(() => disableJSDOM());
|
|
27
|
+
it('Should render markdown', () => {
|
|
28
|
+
const markdownRenderer = new markdown_renderer_1.MarkdownRenderer();
|
|
29
|
+
const result = markdownRenderer.renderInline('[title](link)').innerHTML;
|
|
30
|
+
chai_1.expect(result).to.be.equal('<a href="link">title</a>');
|
|
31
|
+
});
|
|
32
|
+
it('Should accept and use custom engine', () => {
|
|
33
|
+
const engine = markdownit();
|
|
34
|
+
const originalTextRenderer = engine.renderer.rules.text;
|
|
35
|
+
engine.renderer.rules.text = (tokens, idx, options, env, self) => `[${originalTextRenderer(tokens, idx, options, env, self)}]`;
|
|
36
|
+
const markdownRenderer = new markdown_renderer_1.MarkdownRenderer(engine);
|
|
37
|
+
const result = markdownRenderer.renderInline('text').innerHTML;
|
|
38
|
+
chai_1.expect(result).to.be.equal('[text]');
|
|
39
|
+
});
|
|
40
|
+
it('Should modify rendered markdown in place', () => {
|
|
41
|
+
const markdownRenderer = new markdown_renderer_1.MarkdownRenderer().modify('a', a => {
|
|
42
|
+
a.href = 'something-else';
|
|
43
|
+
});
|
|
44
|
+
const result = markdownRenderer.renderInline('[title](link)').innerHTML;
|
|
45
|
+
chai_1.expect(result).to.be.equal('<a href="something-else">title</a>');
|
|
46
|
+
});
|
|
47
|
+
it('Should modify descendants of children', () => {
|
|
48
|
+
const markdownRenderer = new markdown_renderer_1.MarkdownRenderer().modify('em', em => {
|
|
49
|
+
const strong = document.createElement('strong');
|
|
50
|
+
// eslint-disable-next-line no-unsanitized/property
|
|
51
|
+
strong.innerHTML = em.innerHTML;
|
|
52
|
+
return strong;
|
|
53
|
+
});
|
|
54
|
+
const result = markdownRenderer.render('**bold *bold and italic***').innerHTML;
|
|
55
|
+
chai_1.expect(result).to.be.equal('<p><strong>bold <strong>bold and italic</strong></strong></p>\n');
|
|
56
|
+
});
|
|
57
|
+
it('Should modify descendants of children after previous modification', () => {
|
|
58
|
+
const markdownRenderer = new markdown_renderer_1.MarkdownRenderer().modify('em', em => {
|
|
59
|
+
const strong = document.createElement('strong');
|
|
60
|
+
// eslint-disable-next-line no-unsanitized/property
|
|
61
|
+
strong.innerHTML = em.innerHTML;
|
|
62
|
+
return strong;
|
|
63
|
+
}).modify('strong', strong => {
|
|
64
|
+
const textNode = strong.childNodes.item(0);
|
|
65
|
+
textNode.textContent = `changed_${textNode.textContent}`;
|
|
66
|
+
});
|
|
67
|
+
const result = markdownRenderer.render('**bold *bold and italic***').innerHTML;
|
|
68
|
+
chai_1.expect(result).to.be.equal('<p><strong>changed_bold <strong>changed_bold and italic</strong></strong></p>\n');
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
//# sourceMappingURL=markdown-renderer.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown-renderer.spec.js","sourceRoot":"","sources":["../../src/browser/markdown-renderer.spec.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;AAElF,iDAAoD;AACpD,IAAI,YAAY,GAAG,mBAAW,EAAE,CAAC;AAEjC,+BAA8B;AAC9B,0CAA0C;AAC1C,2DAAuD;AAEvD,YAAY,EAAE,CAAC;AAEf,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAE9B,MAAM,CAAC,GAAG,EAAE,CAAC,YAAY,GAAG,mBAAW,EAAE,CAAC,CAAC;IAC3C,KAAK,CAAC,GAAG,EAAE,CAAC,YAAY,EAAE,CAAC,CAAC;IAE5B,EAAE,CAAC,wBAAwB,EAAE,GAAG,EAAE;QAC9B,MAAM,gBAAgB,GAAG,IAAI,oCAAgB,EAAE,CAAC;Q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E,CAAC,KAAK,CAAC,iFAAiF,CAAC,CAAC;IAClH,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
package/lib/common/index.d.ts
CHANGED
|
@@ -38,6 +38,7 @@ export * from './application-error';
|
|
|
38
38
|
export * from './lsp-types';
|
|
39
39
|
export * from './contribution-filter';
|
|
40
40
|
export * from './nls';
|
|
41
|
+
export * from './numbers';
|
|
41
42
|
import { environment } from '@theia/application-package/lib/environment';
|
|
42
43
|
export { environment };
|
|
43
44
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,qBAAqB,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,MAAM,CAAC;AACrB,cAAc,YAAY,CAAC;AAC3B,cAAc,yBAAyB,CAAC;AACxC,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,qBAAqB,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,MAAM,CAAC;AACrB,cAAc,YAAY,CAAC;AAC3B,cAAc,yBAAyB,CAAC;AACxC,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,OAAO,CAAC;AACtB,cAAc,WAAW,CAAC;AAE1B,OAAO,EAAE,WAAW,EAAE,MAAM,4CAA4C,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
package/lib/common/index.js
CHANGED
|
@@ -51,6 +51,7 @@ __exportStar(require("./application-error"), exports);
|
|
|
51
51
|
__exportStar(require("./lsp-types"), exports);
|
|
52
52
|
__exportStar(require("./contribution-filter"), exports);
|
|
53
53
|
__exportStar(require("./nls"), exports);
|
|
54
|
+
__exportStar(require("./numbers"), exports);
|
|
54
55
|
const environment_1 = require("@theia/application-package/lib/environment");
|
|
55
56
|
Object.defineProperty(exports, "environment", { enumerable: true, get: function () { return environment_1.environment; } });
|
|
56
57
|
//# sourceMappingURL=index.js.map
|
package/lib/common/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;;AAElF,0CAAwB;AACxB,+CAA6B;AAC7B,8CAA4B;AAC5B,0CAAwB;AACxB,iDAA+B;AAC/B,4CAA0B;AAC1B,yCAAuB;AACvB,sDAAoC;AACpC,4CAA0B;AAC1B,uCAAqB;AACrB,6CAA2B;AAC3B,0DAAwC;AACxC,yCAAuB;AACvB,2CAAyB;AACzB,8CAA4B;AAC5B,oDAAkC;AAClC,6DAA2C;AAC3C,qDAAmC;AACnC,8DAA4C;AAC5C,8CAA4B;AAC5B,4CAA0B;AAC1B,sDAAoC;AACpC,8CAA4B;AAC5B,wDAAsC;AACtC,wCAAsB;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;;AAElF,0CAAwB;AACxB,+CAA6B;AAC7B,8CAA4B;AAC5B,0CAAwB;AACxB,iDAA+B;AAC/B,4CAA0B;AAC1B,yCAAuB;AACvB,sDAAoC;AACpC,4CAA0B;AAC1B,uCAAqB;AACrB,6CAA2B;AAC3B,0DAAwC;AACxC,yCAAuB;AACvB,2CAAyB;AACzB,8CAA4B;AAC5B,oDAAkC;AAClC,6DAA2C;AAC3C,qDAAmC;AACnC,8DAA4C;AAC5C,8CAA4B;AAC5B,4CAA0B;AAC1B,sDAAoC;AACpC,8CAA4B;AAC5B,wDAAsC;AACtC,wCAAsB;AACtB,4CAA0B;AAE1B,4EAAyE;AAChE,4FADA,yBAAW,OACA"}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { Range } from 'vscode-languageserver-
|
|
16
|
+
import { Range } from 'vscode-languageserver-protocol';
|
|
17
17
|
export interface TextDocumentContentChangeDelta {
|
|
18
18
|
readonly range: Range;
|
|
19
19
|
readonly rangeLength?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lsp-types.d.ts","sourceRoot":"","sources":["../../src/common/lsp-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"lsp-types.d.ts","sourceRoot":"","sources":["../../src/common/lsp-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAEvD,MAAM,WAAW,8BAA8B;IAC3C,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACzB;AACD,yBAAiB,8BAA8B,CAAC;IAG5C,SAAgB,EAAE,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,8BAA8B,CAElE;CAEJ"}
|
package/lib/common/lsp-types.js
CHANGED
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
********************************************************************************/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.TextDocumentContentChangeDelta = void 0;
|
|
19
|
-
const
|
|
19
|
+
const vscode_languageserver_protocol_1 = require("vscode-languageserver-protocol");
|
|
20
20
|
var TextDocumentContentChangeDelta;
|
|
21
21
|
(function (TextDocumentContentChangeDelta) {
|
|
22
22
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
23
23
|
function is(arg) {
|
|
24
|
-
return !!arg && typeof arg['text'] === 'string' && (typeof arg['rangeLength'] === 'number' || typeof arg['rangeLength'] === 'undefined') &&
|
|
24
|
+
return !!arg && typeof arg['text'] === 'string' && (typeof arg['rangeLength'] === 'number' || typeof arg['rangeLength'] === 'undefined') && vscode_languageserver_protocol_1.Range.is(arg['range']);
|
|
25
25
|
}
|
|
26
26
|
TextDocumentContentChangeDelta.is = is;
|
|
27
27
|
})(TextDocumentContentChangeDelta = exports.TextDocumentContentChangeDelta || (exports.TextDocumentContentChangeDelta = {}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lsp-types.js","sourceRoot":"","sources":["../../src/common/lsp-types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,
|
|
1
|
+
{"version":3,"file":"lsp-types.js","sourceRoot":"","sources":["../../src/common/lsp-types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,mFAAuD;AAOvD,IAAiB,8BAA8B,CAO9C;AAPD,WAAiB,8BAA8B;IAE3C,8DAA8D;IAC9D,SAAgB,EAAE,CAAC,GAAQ;QACvB,OAAO,CAAC,CAAC,GAAG,IAAI,OAAO,GAAG,CAAC,MAAM,CAAC,KAAK,QAAQ,IAAI,CAAC,OAAO,GAAG,CAAC,aAAa,CAAC,KAAK,QAAQ,IAAI,OAAO,GAAG,CAAC,aAAa,CAAC,KAAK,WAAW,CAAC,IAAI,sCAAK,CAAC,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;IACvK,CAAC;IAFe,iCAAE,KAEjB,CAAA;AAEL,CAAC,EAPgB,8BAA8B,GAA9B,sCAA8B,KAA9B,sCAA8B,QAO9C"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (C) 2021 TypeFox 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
|
+
* The maximum safe integer (`2^32-1`) is used as a placeholder for large numbers which are not allowed to be floats.
|
|
18
|
+
* For example as line/column arguments for monaco-ranges.
|
|
19
|
+
*/
|
|
20
|
+
export declare const MAX_SAFE_INTEGER = 2147483647;
|
|
21
|
+
//# sourceMappingURL=numbers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"numbers.d.ts","sourceRoot":"","sources":["../../src/common/numbers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,aAAa,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/********************************************************************************
|
|
3
|
+
* Copyright (C) 2021 TypeFox 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 WITH Classpath-exception-2.0
|
|
16
|
+
********************************************************************************/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.MAX_SAFE_INTEGER = void 0;
|
|
19
|
+
/**
|
|
20
|
+
* The maximum safe integer (`2^32-1`) is used as a placeholder for large numbers which are not allowed to be floats.
|
|
21
|
+
* For example as line/column arguments for monaco-ranges.
|
|
22
|
+
*/
|
|
23
|
+
exports.MAX_SAFE_INTEGER = 2147483647;
|
|
24
|
+
//# sourceMappingURL=numbers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"numbers.js","sourceRoot":"","sources":["../../src/common/numbers.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF;;;GAGG;AACU,QAAA,gBAAgB,GAAG,UAAU,CAAC"}
|
package/lib/common/severity.d.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { DiagnosticSeverity } from 'vscode-languageserver-
|
|
16
|
+
import { DiagnosticSeverity } from 'vscode-languageserver-protocol';
|
|
17
17
|
export declare enum Severity {
|
|
18
18
|
Ignore = 0,
|
|
19
19
|
Error = 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"severity.d.ts","sourceRoot":"","sources":["../../src/common/severity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAOlF,OAAO,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"severity.d.ts","sourceRoot":"","sources":["../../src/common/severity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAOlF,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE,oBAAY,QAAQ;IAChB,MAAM,IAAI;IACV,KAAK,IAAI;IACT,OAAO,IAAI;IACX,IAAI,IAAI;IACR,GAAG,IAAI;CACV;AAED,yBAAiB,QAAQ,CAAC;IAOtB,SAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,CAoB7D;IAED,SAAgB,oBAAoB,CAAC,KAAK,EAAE,QAAQ,GAAG,kBAAkB,CAexE;IAED,SAAgB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,GAAG,SAAS,GAAG,MAAM,CAa/D;IAED,SAAgB,OAAO,IAAI,MAAM,EAAE,CAElC;CACJ"}
|
package/lib/common/severity.js
CHANGED
|
@@ -20,7 +20,7 @@ exports.Severity = void 0;
|
|
|
20
20
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
21
21
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
22
22
|
*--------------------------------------------------------------------------------------------*/
|
|
23
|
-
const
|
|
23
|
+
const vscode_languageserver_protocol_1 = require("vscode-languageserver-protocol");
|
|
24
24
|
var Severity;
|
|
25
25
|
(function (Severity) {
|
|
26
26
|
Severity[Severity["Ignore"] = 0] = "Ignore";
|
|
@@ -58,17 +58,17 @@ var Severity;
|
|
|
58
58
|
function toDiagnosticSeverity(value) {
|
|
59
59
|
switch (value) {
|
|
60
60
|
case Severity.Ignore:
|
|
61
|
-
return
|
|
61
|
+
return vscode_languageserver_protocol_1.DiagnosticSeverity.Hint;
|
|
62
62
|
case Severity.Info:
|
|
63
|
-
return
|
|
63
|
+
return vscode_languageserver_protocol_1.DiagnosticSeverity.Information;
|
|
64
64
|
case Severity.Log:
|
|
65
|
-
return
|
|
65
|
+
return vscode_languageserver_protocol_1.DiagnosticSeverity.Information;
|
|
66
66
|
case Severity.Warning:
|
|
67
|
-
return
|
|
67
|
+
return vscode_languageserver_protocol_1.DiagnosticSeverity.Warning;
|
|
68
68
|
case Severity.Error:
|
|
69
|
-
return
|
|
69
|
+
return vscode_languageserver_protocol_1.DiagnosticSeverity.Error;
|
|
70
70
|
default:
|
|
71
|
-
return
|
|
71
|
+
return vscode_languageserver_protocol_1.DiagnosticSeverity.Error;
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
Severity.toDiagnosticSeverity = toDiagnosticSeverity;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"severity.js","sourceRoot":"","sources":["../../src/common/severity.ts"],"names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AAC,MAAM,CAAC;IAC3B,CAAC;IApBe,kBAAS,YAoBxB,CAAA;IAED,SAAgB,oBAAoB,CAAC,KAAe;QAChD,QAAQ,KAAK,EAAE;YACX,KAAK,QAAQ,CAAC,MAAM;gBAChB,OAAO,mDAAkB,CAAC,IAAI,CAAC;YACnC,KAAK,QAAQ,CAAC,IAAI;gBACd,OAAO,mDAAkB,CAAC,WAAW,CAAC;YAC1C,KAAK,QAAQ,CAAC,GAAG;gBACb,OAAO,mDAAkB,CAAC,WAAW,CAAC;YAC1C,KAAK,QAAQ,CAAC,OAAO;gBACjB,OAAO,mDAAkB,CAAC,OAAO,CAAC;YACtC,KAAK,QAAQ,CAAC,KAAK;gBACf,OAAO,mDAAkB,CAAC,KAAK,CAAC;YACpC;gBACI,OAAO,mDAAkB,CAAC,KAAK,CAAC;SACvC;IACL,CAAC;IAfe,6BAAoB,uBAenC,CAAA;IAED,SAAgB,QAAQ,CAAC,QAA8B;QACnD,QAAQ,QAAQ,EAAE;YACd,KAAK,QAAQ,CAAC,KAAK;gBACf,OAAO,KAAK,CAAC;YACjB,KAAK,QAAQ,CAAC,OAAO;gBACjB,OAAO,OAAO,CAAC;YACnB,KAAK,QAAQ,CAAC,IAAI;gBACd,OAAO,IAAI,CAAC;YAChB,KAAK,QAAQ,CAAC,GAAG;gBACb,OAAO,GAAG,CAAC;YACf;gBACI,OAAO,MAAM,CAAC;SACrB;IACL,CAAC;IAbe,iBAAQ,WAavB,CAAA;IAED,SAAgB,OAAO;QACnB,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;IAC/C,CAAC;IAFe,gBAAO,UAEtB,CAAA;AACL,CAAC,EAhEgB,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAgExB"}
|
|
@@ -36,7 +36,7 @@ export declare class ElectronWindowService extends DefaultWindowService {
|
|
|
36
36
|
/**
|
|
37
37
|
* Run when ElectronMain detects a `close` event and emits a `close-requested` event.
|
|
38
38
|
* Should send an event to `electron.ipcRenderer` on the event's `confirmChannel` if it is safe to exit
|
|
39
|
-
* after running
|
|
39
|
+
* after running FrontendApplication `onWillStop` handlers or on the `cancelChannel` if it is not safe to exit.
|
|
40
40
|
*/
|
|
41
41
|
protected handleCloseRequestedEvent(event: CloseRequestArguments): Promise<void>;
|
|
42
42
|
/**
|
|
@@ -65,7 +65,7 @@ let ElectronWindowService = class ElectronWindowService extends default_window_s
|
|
|
65
65
|
/**
|
|
66
66
|
* Run when ElectronMain detects a `close` event and emits a `close-requested` event.
|
|
67
67
|
* Should send an event to `electron.ipcRenderer` on the event's `confirmChannel` if it is safe to exit
|
|
68
|
-
* after running
|
|
68
|
+
* after running FrontendApplication `onWillStop` handlers or on the `cancelChannel` if it is not safe to exit.
|
|
69
69
|
*/
|
|
70
70
|
async handleCloseRequestedEvent(event) {
|
|
71
71
|
const safeToClose = await this.isSafeToShutDown();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/core",
|
|
3
|
-
"version": "1.21.0-next.
|
|
3
|
+
"version": "1.21.0-next.29+0836c7a1273",
|
|
4
4
|
"description": "Theia is a cloud & desktop IDE framework implemented in TypeScript.",
|
|
5
5
|
"main": "lib/common/index.js",
|
|
6
6
|
"typings": "lib/common/index.d.ts",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"@phosphor/virtualdom": "1",
|
|
18
18
|
"@phosphor/widgets": "1",
|
|
19
19
|
"@primer/octicons-react": "^9.0.0",
|
|
20
|
-
"@theia/application-package": "1.21.0-next.
|
|
20
|
+
"@theia/application-package": "1.21.0-next.29+0836c7a1273",
|
|
21
21
|
"@types/body-parser": "^1.16.4",
|
|
22
22
|
"@types/cookie": "^0.3.3",
|
|
23
23
|
"@types/dompurify": "^2.2.2",
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
"keytar": "7.2.0",
|
|
51
51
|
"lodash.debounce": "^4.0.8",
|
|
52
52
|
"lodash.throttle": "^4.1.1",
|
|
53
|
+
"markdown-it": "^8.4.0",
|
|
53
54
|
"nsfw": "^2.1.2",
|
|
54
55
|
"p-debounce": "^2.1.0",
|
|
55
56
|
"perfect-scrollbar": "^1.3.0",
|
|
@@ -63,7 +64,6 @@
|
|
|
63
64
|
"safer-buffer": "^2.1.2",
|
|
64
65
|
"uuid": "^8.3.2",
|
|
65
66
|
"vscode-languageserver-protocol": "~3.15.3",
|
|
66
|
-
"vscode-languageserver-types": "^3.15.1",
|
|
67
67
|
"vscode-uri": "^2.1.1",
|
|
68
68
|
"vscode-ws-jsonrpc": "^0.2.0",
|
|
69
69
|
"ws": "^7.1.2",
|
|
@@ -101,7 +101,6 @@
|
|
|
101
101
|
"react-dom",
|
|
102
102
|
"react-virtualized",
|
|
103
103
|
"vscode-languageserver-protocol",
|
|
104
|
-
"vscode-languageserver-types",
|
|
105
104
|
"vscode-uri",
|
|
106
105
|
"vscode-ws-jsonrpc"
|
|
107
106
|
],
|
|
@@ -177,5 +176,5 @@
|
|
|
177
176
|
"nyc": {
|
|
178
177
|
"extends": "../../configs/nyc.json"
|
|
179
178
|
},
|
|
180
|
-
"gitHead": "
|
|
179
|
+
"gitHead": "0836c7a12731b7bd148b217dc59943a0f110ec45"
|
|
181
180
|
}
|
|
@@ -58,8 +58,7 @@ export const corePreferenceSchema: PreferenceSchema = {
|
|
|
58
58
|
'keyCode',
|
|
59
59
|
],
|
|
60
60
|
default: 'code',
|
|
61
|
-
|
|
62
|
-
'Controls the dispatching logic for key presses to use either `code` (recommended) or `keyCode`.')
|
|
61
|
+
markdownDescription: nls.localizeByDefault('Controls the dispatching logic for key presses to use either `code` (recommended) or `keyCode`.')
|
|
63
62
|
},
|
|
64
63
|
'window.menuBarVisibility': {
|
|
65
64
|
type: 'string',
|
|
@@ -89,7 +88,7 @@ export const corePreferenceSchema: PreferenceSchema = {
|
|
|
89
88
|
'workbench.editor.highlightModifiedTabs': {
|
|
90
89
|
'type': 'boolean',
|
|
91
90
|
// eslint-disable-next-line max-len
|
|
92
|
-
'
|
|
91
|
+
'markdownDescription': nls.localize('theia/core/highlightModifiedTabs', 'Controls whether a top border is drawn on modified (dirty) editor tabs or not.'),
|
|
93
92
|
'default': false
|
|
94
93
|
},
|
|
95
94
|
'workbench.editor.closeOnFileDelete': {
|
package/src/browser/index.ts
CHANGED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (C) 2021 TypeFox 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 { enableJSDOM } from '../browser/test/jsdom';
|
|
18
|
+
let disableJSDOM = enableJSDOM();
|
|
19
|
+
|
|
20
|
+
import { expect } from 'chai';
|
|
21
|
+
import * as markdownit from 'markdown-it';
|
|
22
|
+
import { MarkdownRenderer } from './markdown-renderer';
|
|
23
|
+
|
|
24
|
+
disableJSDOM();
|
|
25
|
+
|
|
26
|
+
describe('MarkdownRenderer', () => {
|
|
27
|
+
|
|
28
|
+
before(() => disableJSDOM = enableJSDOM());
|
|
29
|
+
after(() => disableJSDOM());
|
|
30
|
+
|
|
31
|
+
it('Should render markdown', () => {
|
|
32
|
+
const markdownRenderer = new MarkdownRenderer();
|
|
33
|
+
const result = markdownRenderer.renderInline('[title](link)').innerHTML;
|
|
34
|
+
expect(result).to.be.equal('<a href="link">title</a>');
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('Should accept and use custom engine', () => {
|
|
38
|
+
const engine = markdownit();
|
|
39
|
+
const originalTextRenderer = engine.renderer.rules.text!;
|
|
40
|
+
engine.renderer.rules.text = (tokens, idx, options, env, self) => `[${originalTextRenderer(tokens, idx, options, env, self)}]`;
|
|
41
|
+
const markdownRenderer = new MarkdownRenderer(engine);
|
|
42
|
+
const result = markdownRenderer.renderInline('text').innerHTML;
|
|
43
|
+
expect(result).to.be.equal('[text]');
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('Should modify rendered markdown in place', () => {
|
|
47
|
+
const markdownRenderer = new MarkdownRenderer().modify('a', a => {
|
|
48
|
+
a.href = 'something-else';
|
|
49
|
+
});
|
|
50
|
+
const result = markdownRenderer.renderInline('[title](link)').innerHTML;
|
|
51
|
+
expect(result).to.be.equal('<a href="something-else">title</a>');
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it('Should modify descendants of children', () => {
|
|
55
|
+
const markdownRenderer = new MarkdownRenderer().modify('em', em => {
|
|
56
|
+
const strong = document.createElement('strong');
|
|
57
|
+
// eslint-disable-next-line no-unsanitized/property
|
|
58
|
+
strong.innerHTML = em.innerHTML;
|
|
59
|
+
return strong;
|
|
60
|
+
});
|
|
61
|
+
const result = markdownRenderer.render('**bold *bold and italic***').innerHTML;
|
|
62
|
+
expect(result).to.be.equal('<p><strong>bold <strong>bold and italic</strong></strong></p>\n');
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it('Should modify descendants of children after previous modification', () => {
|
|
66
|
+
const markdownRenderer = new MarkdownRenderer().modify('em', em => {
|
|
67
|
+
const strong = document.createElement('strong');
|
|
68
|
+
// eslint-disable-next-line no-unsanitized/property
|
|
69
|
+
strong.innerHTML = em.innerHTML;
|
|
70
|
+
return strong;
|
|
71
|
+
}).modify('strong', strong => { // Will pick up both the original and modified strong element
|
|
72
|
+
const textNode = strong.childNodes.item(0);
|
|
73
|
+
textNode.textContent = `changed_${textNode.textContent}`;
|
|
74
|
+
});
|
|
75
|
+
const result = markdownRenderer.render('**bold *bold and italic***').innerHTML;
|
|
76
|
+
expect(result).to.be.equal('<p><strong>changed_bold <strong>changed_bold and italic</strong></strong></p>\n');
|
|
77
|
+
});
|
|
78
|
+
});
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (C) 2021 TypeFox 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 DOMPurify from 'dompurify';
|
|
18
|
+
import * as markdownit from 'markdown-it';
|
|
19
|
+
|
|
20
|
+
export class MarkdownRenderer {
|
|
21
|
+
|
|
22
|
+
protected engine: markdownit;
|
|
23
|
+
protected callbacks = new Map<string, ((element: Element) => Element | void)[]>();
|
|
24
|
+
|
|
25
|
+
constructor(engine?: markdownit) {
|
|
26
|
+
this.engine = engine ?? markdownit();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Adds a modification callback that is applied to every element with the specified tag after rendering to HTML.
|
|
31
|
+
*
|
|
32
|
+
* @param tag The tag that this modification applies to.
|
|
33
|
+
* @param callback The modification to apply on every selected rendered element. Can either modify the element in place or return a new element.
|
|
34
|
+
*/
|
|
35
|
+
modify<K extends keyof HTMLElementTagNameMap>(tag: K, callback: (element: HTMLElementTagNameMap[K]) => Element | void): MarkdownRenderer {
|
|
36
|
+
if (this.callbacks.has(tag)) {
|
|
37
|
+
this.callbacks.get(tag)!.push(callback);
|
|
38
|
+
} else {
|
|
39
|
+
this.callbacks.set(tag, [callback]);
|
|
40
|
+
}
|
|
41
|
+
return this;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
render(markdown: string): HTMLElement {
|
|
45
|
+
return this.renderInternal(this.engine.render(markdown));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
renderInline(markdown: string): HTMLElement {
|
|
49
|
+
return this.renderInternal(this.engine.renderInline(markdown));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
protected renderInternal(renderedHtml: string): HTMLElement {
|
|
53
|
+
const div = this.sanitizeHtml(renderedHtml);
|
|
54
|
+
for (const [tag, calls] of this.callbacks) {
|
|
55
|
+
for (const callback of calls) {
|
|
56
|
+
const elements = Array.from(div.getElementsByTagName(tag));
|
|
57
|
+
for (const element of elements) {
|
|
58
|
+
const result = callback(element);
|
|
59
|
+
if (result) {
|
|
60
|
+
const parent = element.parentElement;
|
|
61
|
+
if (parent) {
|
|
62
|
+
parent.replaceChild(result, element);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return div;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
protected sanitizeHtml(html: string): HTMLElement {
|
|
72
|
+
const div = document.createElement('div');
|
|
73
|
+
div.innerHTML = DOMPurify.sanitize(html);
|
|
74
|
+
return div;
|
|
75
|
+
}
|
|
76
|
+
}
|
package/src/common/index.ts
CHANGED
|
@@ -39,6 +39,7 @@ export * from './application-error';
|
|
|
39
39
|
export * from './lsp-types';
|
|
40
40
|
export * from './contribution-filter';
|
|
41
41
|
export * from './nls';
|
|
42
|
+
export * from './numbers';
|
|
42
43
|
|
|
43
44
|
import { environment } from '@theia/application-package/lib/environment';
|
|
44
45
|
export { environment };
|
package/src/common/lsp-types.ts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
|
|
17
|
-
import { Range } from 'vscode-languageserver-
|
|
17
|
+
import { Range } from 'vscode-languageserver-protocol';
|
|
18
18
|
|
|
19
19
|
export interface TextDocumentContentChangeDelta {
|
|
20
20
|
readonly range: Range;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (C) 2021 TypeFox 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
|
+
/**
|
|
18
|
+
* The maximum safe integer (`2^32-1`) is used as a placeholder for large numbers which are not allowed to be floats.
|
|
19
|
+
* For example as line/column arguments for monaco-ranges.
|
|
20
|
+
*/
|
|
21
|
+
export const MAX_SAFE_INTEGER = 2147483647;
|
package/src/common/severity.ts
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
20
20
|
*--------------------------------------------------------------------------------------------*/
|
|
21
21
|
|
|
22
|
-
import { DiagnosticSeverity } from 'vscode-languageserver-
|
|
22
|
+
import { DiagnosticSeverity } from 'vscode-languageserver-protocol';
|
|
23
23
|
|
|
24
24
|
export enum Severity {
|
|
25
25
|
Ignore = 0,
|
|
@@ -68,7 +68,7 @@ export class ElectronWindowService extends DefaultWindowService {
|
|
|
68
68
|
/**
|
|
69
69
|
* Run when ElectronMain detects a `close` event and emits a `close-requested` event.
|
|
70
70
|
* Should send an event to `electron.ipcRenderer` on the event's `confirmChannel` if it is safe to exit
|
|
71
|
-
* after running
|
|
71
|
+
* after running FrontendApplication `onWillStop` handlers or on the `cancelChannel` if it is not safe to exit.
|
|
72
72
|
*/
|
|
73
73
|
protected async handleCloseRequestedEvent(event: CloseRequestArguments): Promise<void> {
|
|
74
74
|
const safeToClose = await this.isSafeToShutDown();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from 'vscode-languageserver-types';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('vscode-languageserver-types');
|