@difizen/libro-language-client 0.2.20 → 0.2.22
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/es/common/notebook.d.ts.map +1 -1
- package/es/common/notebook.js +1 -1
- package/es/common/vscodeAdaptor/convertor.d.ts.map +1 -1
- package/es/common/vscodeAdaptor/convertor.js +2 -5
- package/es/index.d.ts +0 -1
- package/es/index.d.ts.map +1 -1
- package/es/index.js +0 -1
- package/es/libro-language-client-contribution.d.ts.map +1 -1
- package/es/libro-language-client-contribution.js +3 -2
- package/es/util.d.ts +0 -4
- package/es/util.d.ts.map +1 -1
- package/es/util.js +0 -8
- package/package.json +6 -6
- package/src/common/notebook.ts +1 -2
- package/src/common/vscodeAdaptor/convertor.ts +2 -6
- package/src/index.ts +0 -1
- package/src/libro-language-client-contribution.ts +3 -2
- package/src/util.ts +0 -15
- package/es/constants.d.ts +0 -2
- package/es/constants.d.ts.map +0 -1
- package/es/constants.js +0 -1
- package/src/constants.ts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notebook.d.ts","sourceRoot":"","sources":["../../src/common/notebook.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"notebook.d.ts","sourceRoot":"","sources":["../../src/common/notebook.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,KAAK,MAAM,yCAAyC,CAAC;AACjE,OAAO,KAAK,EAIV,8BAA8B,EAE/B,MAAM,yCAAyC,CAAC;AAEjD,OAAO,KAAK,EACV,YAAY,EAEZ,gBAAgB,EAChB,YAAY,EACZ,uBAAuB,EAIxB,MAAM,QAAQ,CAAC;AAGhB,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,YAAY,EACb,MAAM,eAAe,CAAC;AA4cvB,MAAM,MAAM,4BAA4B,GAAG;IACzC;;OAEG;IACH,QAAQ,EAAE,gBAAgB,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,EAAE;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,EAAE,MAAM,CAAsB;IAE/D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAGrB;IACF,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAmD;IACjF,OAAO,CAAC,gBAAgB,CAA+B;gBAGrD,MAAM,EAAE,aAAa,CAAC,0BAA0B,EAAE,wBAAwB,CAAC;IA6D7E,QAAQ,IAAI,YAAY;IAgCxB,SAAgB,gBAAgB,EAAE,KAAK,CAAC,gBAAgB,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;IAEjG,sBAAsB,CAAC,YAAY,EAAE,KAAK,CAAC,kBAAkB,GAAG,IAAI;IASpE,aAAa,CAAC,YAAY,EAAE,KAAK,CAAC,kBAAkB,CAAC,GAAG,CAAC,GAAG,IAAI;IAUhE,UAAU,CAAC,YAAY,EAAE,KAAK,CAAC,kBAAkB,CAAC,GAAG,CAAC,GAAG,IAAI;IAS7D,QAAQ,CACb,IAAI,EAAE,gBAAgB,CAAC,KAAK,CAAC,uCAAuC,CAAC,GACpE,IAAI;IAQA,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAQ5B,KAAK,IAAI,IAAI;IAOb,OAAO,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO;IAkB5C,WAAW,CAChB,YAAY,EAAE,YAAY,GACzB,gCAAgC,GAAG,SAAS;IAS/C,OAAO,CAAC,2BAA2B;CAapC"}
|
package/es/common/notebook.js
CHANGED
|
@@ -20,9 +20,9 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
20
20
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
21
21
|
* ------------------------------------------------------------------------------------------ */
|
|
22
22
|
|
|
23
|
+
import { LibroCellURIScheme } from '@difizen/libro-common';
|
|
23
24
|
import * as proto from '@difizen/vscode-languageserver-protocol';
|
|
24
25
|
import * as minimatch from 'minimatch';
|
|
25
|
-
import { LibroCellURIScheme } from "../constants.js";
|
|
26
26
|
import * as Is from "./utils/is.js";
|
|
27
27
|
import * as UUID from "./utils/uuid.js";
|
|
28
28
|
import { NotebookCellKind } from "./vscodeAdaptor/vscodeAdaptor.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convertor.d.ts","sourceRoot":"","sources":["../../../src/common/vscodeAdaptor/convertor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"convertor.d.ts","sourceRoot":"","sources":["../../../src/common/vscodeAdaptor/convertor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAE/D,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAiB,MAAM,QAAQ,CAAC;AAK5E,eAAO,MAAM,GAAG;kCACgB,SAAS,GAAG,gBAAgB;yBAuBrC,QAAQ,GAAG,YAAY;CAqC7C,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { getCellURI } from '@difizen/libro-common';
|
|
1
2
|
import { ExecutableNotebookModel } from '@difizen/libro-kernel';
|
|
2
|
-
import { NotebookDocumentSyncFeature } from "../notebook.js";
|
|
3
3
|
import { unsupported } from "./util.js";
|
|
4
4
|
import { EndOfLine, NotebookCellKind, Uri } from "./vscodeAdaptor.js";
|
|
5
5
|
export var l2c = {
|
|
@@ -36,10 +36,7 @@ export var l2c = {
|
|
|
36
36
|
notebook: l2c.asNotebookDocument(cell.parent),
|
|
37
37
|
kind: cell.model.type === 'code' ? NotebookCellKind.Code : NotebookCellKind.Markup,
|
|
38
38
|
document: {
|
|
39
|
-
uri: Uri.parse(filePath).
|
|
40
|
-
scheme: NotebookDocumentSyncFeature.CellScheme,
|
|
41
|
-
query: "cellid=".concat(cell.model.id)
|
|
42
|
-
}),
|
|
39
|
+
uri: Uri.parse(getCellURI(filePath, cell.model.id).toString()),
|
|
43
40
|
fileName: filePath,
|
|
44
41
|
isUntitled: false,
|
|
45
42
|
languageId: 'python',
|
package/es/index.d.ts
CHANGED
package/es/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC;AACnD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC;AACnD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC"}
|
package/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"libro-language-client-contribution.d.ts","sourceRoot":"","sources":["../src/libro-language-client-contribution.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"libro-language-client-contribution.d.ts","sourceRoot":"","sources":["../src/libro-language-client-contribution.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,sBAAsB,EACtB,YAAY,EACb,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,uBAAuB,EAAqB,MAAM,mBAAmB,CAAC;AAK/E,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAE1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAGhF,qBACa,+BAAgC,YAAW,uBAAuB;IAE7E,SAAS,CAAC,QAAQ,CAAC,qBAAqB,EAAE,sBAAsB,CAAC;IAEjE,SAAS,CAAC,QAAQ,CAAC,0BAA0B,EAAE,0BAA0B,CAAC;IAG1E,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAGlC,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IAExC,WAAW;IAMX,oBAAoB;IAmC1B,iBAAiB;CA4DlB"}
|
|
@@ -14,6 +14,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
14
14
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
15
15
|
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
|
|
16
16
|
function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }
|
|
17
|
+
import { getCellURI } from '@difizen/libro-common';
|
|
17
18
|
import { EditorCellView, ILibroWorkspaceService, LibroService } from '@difizen/libro-core';
|
|
18
19
|
import { ExecutableNotebookModel } from '@difizen/libro-kernel';
|
|
19
20
|
import { ApplicationContribution, inject, singleton } from '@difizen/mana-app';
|
|
@@ -23,7 +24,7 @@ import { CloseAction, ErrorAction } from "./common/api.js";
|
|
|
23
24
|
import { LSPEnv } from "./common/vscodeAdaptor/lspEnv.js";
|
|
24
25
|
import { workspace } from "./common/vscodeAdaptor/vscodeAdaptor.js";
|
|
25
26
|
import { LibroLanguageClientManager } from "./libro-language-client-manager.js";
|
|
26
|
-
import {
|
|
27
|
+
import { toEditorRange, toMonacoPosition } from "./util.js";
|
|
27
28
|
export var LibroLanguageClientContribution = (_dec = singleton({
|
|
28
29
|
contrib: [ApplicationContribution]
|
|
29
30
|
}), _dec2 = inject(ILibroWorkspaceService), _dec3 = inject(LibroLanguageClientManager), _dec4 = inject(LSPEnv), _dec5 = inject(LibroService), _dec(_class = (_class2 = /*#__PURE__*/function () {
|
|
@@ -160,7 +161,7 @@ export var LibroLanguageClientContribution = (_dec = singleton({
|
|
|
160
161
|
return false;
|
|
161
162
|
}
|
|
162
163
|
var cell = libroView.model.cells.find(function (item) {
|
|
163
|
-
return ExecutableNotebookModel.is(libroView.model) && getCellURI(libroView.model, item.model).toString() === decodeURIComponent(resource.toString());
|
|
164
|
+
return ExecutableNotebookModel.is(libroView.model) && getCellURI(libroView.model.filePath, item.model.id).toString() === decodeURIComponent(resource.toString());
|
|
164
165
|
});
|
|
165
166
|
if (EditorCellView.is(cell)) {
|
|
166
167
|
var _cell$editor, _line;
|
package/es/util.d.ts
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import type { IPosition, IRange } from '@difizen/libro-code-editor';
|
|
2
|
-
import type { CellModel } from '@difizen/libro-core';
|
|
3
|
-
import type { ExecutableNotebookModel } from '@difizen/libro-kernel';
|
|
4
|
-
import { URI } from '@difizen/mana-app';
|
|
5
2
|
import type * as monaco from '@difizen/monaco-editor-core';
|
|
6
|
-
export declare const getCellURI: (libroModel: ExecutableNotebookModel, cellModel: CellModel) => URI;
|
|
7
3
|
export declare const toEditorRange: (range: monaco.IRange) => IRange;
|
|
8
4
|
export declare const toMonacoPosition: (position: monaco.IPosition | undefined) => IPosition;
|
|
9
5
|
//# sourceMappingURL=util.d.ts.map
|
package/es/util.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,KAAK,KAAK,MAAM,MAAM,6BAA6B,CAAC;AAE3D,eAAO,MAAM,aAAa,UAAW,aAAa,KAAG,MAWpD,CAAC;AAEF,eAAO,MAAM,gBAAgB,aAAc,gBAAgB,GAAG,SAAS,KAAG,SAWzE,CAAC"}
|
package/es/util.js
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
import { URI } from '@difizen/mana-app';
|
|
2
|
-
import { LibroCellURIScheme } from "./constants.js";
|
|
3
|
-
export var getCellURI = function getCellURI(libroModel, cellModel) {
|
|
4
|
-
var uri = new URI(libroModel.filePath);
|
|
5
|
-
uri = URI.withScheme(uri, LibroCellURIScheme);
|
|
6
|
-
uri = URI.withQuery(uri, "cellid=".concat(cellModel.id));
|
|
7
|
-
return uri;
|
|
8
|
-
};
|
|
9
1
|
export var toEditorRange = function toEditorRange(range) {
|
|
10
2
|
return {
|
|
11
3
|
start: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@difizen/libro-language-client",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.22",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"libro",
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
"src"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@difizen/libro-core": "^0.2.
|
|
36
|
-
"@difizen/libro-code-editor": "^0.2.
|
|
37
|
-
"@difizen/libro-kernel": "^0.2.
|
|
38
|
-
"@difizen/libro-common": "^0.2.
|
|
39
|
-
"@difizen/libro-lsp": "^0.2.
|
|
35
|
+
"@difizen/libro-core": "^0.2.22",
|
|
36
|
+
"@difizen/libro-code-editor": "^0.2.22",
|
|
37
|
+
"@difizen/libro-kernel": "^0.2.22",
|
|
38
|
+
"@difizen/libro-common": "^0.2.22",
|
|
39
|
+
"@difizen/libro-lsp": "^0.2.22",
|
|
40
40
|
"@difizen/mana-app": "latest",
|
|
41
41
|
"@difizen/mana-common": "latest",
|
|
42
42
|
"uuid": "^9.0.0",
|
package/src/common/notebook.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
5
5
|
* ------------------------------------------------------------------------------------------ */
|
|
6
6
|
|
|
7
|
+
import { LibroCellURIScheme } from '@difizen/libro-common';
|
|
7
8
|
import * as proto from '@difizen/vscode-languageserver-protocol';
|
|
8
9
|
import type {
|
|
9
10
|
StaticRegistrationOptions,
|
|
@@ -24,8 +25,6 @@ import type {
|
|
|
24
25
|
NotebookDocumentChangeEvent,
|
|
25
26
|
} from 'vscode';
|
|
26
27
|
|
|
27
|
-
import { LibroCellURIScheme } from '../constants.js';
|
|
28
|
-
|
|
29
28
|
import type * as _c2p from './codeConverter.js';
|
|
30
29
|
import type {
|
|
31
30
|
DynamicFeature,
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
import { getCellURI } from '@difizen/libro-common';
|
|
1
2
|
import type { CellView, LibroView } from '@difizen/libro-core';
|
|
2
3
|
import { ExecutableNotebookModel } from '@difizen/libro-kernel';
|
|
3
4
|
import type { NotebookCell, NotebookDocument, NotebookRange } from 'vscode';
|
|
4
5
|
|
|
5
|
-
import { NotebookDocumentSyncFeature } from '../notebook.js';
|
|
6
|
-
|
|
7
6
|
import { unsupported } from './util.js';
|
|
8
7
|
import { EndOfLine, NotebookCellKind, Uri } from './vscodeAdaptor.js';
|
|
9
8
|
|
|
@@ -43,10 +42,7 @@ export const l2c = {
|
|
|
43
42
|
kind:
|
|
44
43
|
cell.model.type === 'code' ? NotebookCellKind.Code : NotebookCellKind.Markup,
|
|
45
44
|
document: {
|
|
46
|
-
uri: Uri.parse(filePath).
|
|
47
|
-
scheme: NotebookDocumentSyncFeature.CellScheme,
|
|
48
|
-
query: `cellid=${cell.model.id}`,
|
|
49
|
-
}),
|
|
45
|
+
uri: Uri.parse(getCellURI(filePath, cell.model.id).toString()),
|
|
50
46
|
fileName: filePath,
|
|
51
47
|
isUntitled: false,
|
|
52
48
|
languageId: 'python',
|
package/src/index.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getCellURI } from '@difizen/libro-common';
|
|
1
2
|
import {
|
|
2
3
|
EditorCellView,
|
|
3
4
|
ILibroWorkspaceService,
|
|
@@ -12,7 +13,7 @@ import { CloseAction, ErrorAction } from './common/api.js';
|
|
|
12
13
|
import { LSPEnv } from './common/vscodeAdaptor/lspEnv.js';
|
|
13
14
|
import { workspace } from './common/vscodeAdaptor/vscodeAdaptor.js';
|
|
14
15
|
import { LibroLanguageClientManager } from './libro-language-client-manager.js';
|
|
15
|
-
import {
|
|
16
|
+
import { toEditorRange, toMonacoPosition } from './util.js';
|
|
16
17
|
|
|
17
18
|
@singleton({ contrib: [ApplicationContribution] })
|
|
18
19
|
export class LibroLanguageClientContribution implements ApplicationContribution {
|
|
@@ -92,7 +93,7 @@ export class LibroLanguageClientContribution implements ApplicationContribution
|
|
|
92
93
|
const cell = libroView.model.cells.find((item) => {
|
|
93
94
|
return (
|
|
94
95
|
ExecutableNotebookModel.is(libroView.model) &&
|
|
95
|
-
getCellURI(libroView.model, item.model).toString() ===
|
|
96
|
+
getCellURI(libroView.model.filePath, item.model.id).toString() ===
|
|
96
97
|
decodeURIComponent(resource.toString())
|
|
97
98
|
);
|
|
98
99
|
});
|
package/src/util.ts
CHANGED
|
@@ -1,21 +1,6 @@
|
|
|
1
1
|
import type { IPosition, IRange } from '@difizen/libro-code-editor';
|
|
2
|
-
import type { CellModel } from '@difizen/libro-core';
|
|
3
|
-
import type { ExecutableNotebookModel } from '@difizen/libro-kernel';
|
|
4
|
-
import { URI } from '@difizen/mana-app';
|
|
5
2
|
import type * as monaco from '@difizen/monaco-editor-core';
|
|
6
3
|
|
|
7
|
-
import { LibroCellURIScheme } from './constants.js';
|
|
8
|
-
|
|
9
|
-
export const getCellURI = (
|
|
10
|
-
libroModel: ExecutableNotebookModel,
|
|
11
|
-
cellModel: CellModel,
|
|
12
|
-
): URI => {
|
|
13
|
-
let uri = new URI(libroModel.filePath);
|
|
14
|
-
uri = URI.withScheme(uri, LibroCellURIScheme);
|
|
15
|
-
uri = URI.withQuery(uri, `cellid=${cellModel.id}`);
|
|
16
|
-
return uri;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
4
|
export const toEditorRange = (range: monaco.IRange): IRange => {
|
|
20
5
|
return {
|
|
21
6
|
start: {
|
package/es/constants.d.ts
DELETED
package/es/constants.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,wBAAwB,CAAC"}
|
package/es/constants.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export var LibroCellURIScheme = 'libro-notebook-cell';
|
package/src/constants.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const LibroCellURIScheme = 'libro-notebook-cell';
|