@codingame/monaco-vscode-api 5.1.0 → 5.1.2-segmenter.1
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/package.json +8 -8
- package/service-override/files.d.ts +1 -0
- package/vscode/src/vs/base/browser/dom.js +4 -4
- package/vscode/src/vs/base/common/date.js +4 -12
- package/vscode/src/vs/base/common/decorators.js +2 -6
- package/vscode/src/vs/base/common/extpath.js +2 -8
- package/vscode/src/vs/base/common/jsonEdit.js +1 -1
- package/vscode/src/vs/editor/browser/viewParts/editorScrollbar/editorScrollbar.js +1 -1
- package/vscode/src/vs/editor/common/core/lineRange.js +1 -1
- package/vscode/src/vs/editor/common/core/wordCharacterClassifier.d.ts +11 -6
- package/vscode/src/vs/editor/common/core/wordCharacterClassifier.js +1 -33
- package/vscode/src/vs/editor/contrib/indentation/common/indentation.js +1 -13
- package/vscode/src/vs/platform/quickinput/browser/quickPickPin.js +3 -3
- package/vscode/src/vs/platform/workspace/common/workspace.js +1 -5
- package/vscode/src/vs/workbench/contrib/comments/browser/commentNode.js +0 -3
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +1 -1
- package/vscode/src/vs/workbench/contrib/debug/common/debugModel.js +1 -1
- package/vscode/src/vs/workbench/contrib/debug/common/debugUtils.js +0 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +2 -14
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbars.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.js +1 -56
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelQuickPickStrategy.js +2 -2
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalIcon.js +1 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-api",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.2-segmenter.1",
|
|
4
4
|
"description": "VSCode public API plugged on the monaco editor",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": {
|
|
@@ -99,12 +99,12 @@
|
|
|
99
99
|
"dependencies": {
|
|
100
100
|
"@vscode/iconv-lite-umd": "0.7.0",
|
|
101
101
|
"jschardet": "3.0.0",
|
|
102
|
-
"@codingame/monaco-vscode-extensions-service-override": "5.1.
|
|
103
|
-
"@codingame/monaco-vscode-files-service-override": "5.1.
|
|
104
|
-
"@codingame/monaco-vscode-quickaccess-service-override": "5.1.
|
|
105
|
-
"@codingame/monaco-vscode-environment-service-override": "5.1.
|
|
106
|
-
"@codingame/monaco-vscode-layout-service-override": "5.1.
|
|
107
|
-
"@codingame/monaco-vscode-host-service-override": "5.1.
|
|
108
|
-
"@codingame/monaco-vscode-base-service-override": "5.1.
|
|
102
|
+
"@codingame/monaco-vscode-extensions-service-override": "5.1.2-segmenter.1",
|
|
103
|
+
"@codingame/monaco-vscode-files-service-override": "5.1.2-segmenter.1",
|
|
104
|
+
"@codingame/monaco-vscode-quickaccess-service-override": "5.1.2-segmenter.1",
|
|
105
|
+
"@codingame/monaco-vscode-environment-service-override": "5.1.2-segmenter.1",
|
|
106
|
+
"@codingame/monaco-vscode-layout-service-override": "5.1.2-segmenter.1",
|
|
107
|
+
"@codingame/monaco-vscode-host-service-override": "5.1.2-segmenter.1",
|
|
108
|
+
"@codingame/monaco-vscode-base-service-override": "5.1.2-segmenter.1"
|
|
109
109
|
}
|
|
110
110
|
}
|
|
@@ -55,6 +55,7 @@ declare class RegisteredFileSystemProvider extends Disposable implements IFileSy
|
|
|
55
55
|
onDidChangeCapabilities: Event<any>;
|
|
56
56
|
_onDidChangeFile: Emitter<readonly IFileChange[]>;
|
|
57
57
|
onDidChangeFile: Event<readonly IFileChange[]>;
|
|
58
|
+
private formatUri;
|
|
58
59
|
registerFile(file: RegisteredFile): IDisposable;
|
|
59
60
|
stat(resource: URI): Promise<IStat>;
|
|
60
61
|
readdir(resource: URI): Promise<[string, FileType][]>;
|
|
@@ -427,16 +427,16 @@ function size(element, width, height) {
|
|
|
427
427
|
}
|
|
428
428
|
}
|
|
429
429
|
function position(element, top, right, bottom, left, position = 'absolute') {
|
|
430
|
-
|
|
430
|
+
{
|
|
431
431
|
element.style.top = `${top}px`;
|
|
432
432
|
}
|
|
433
|
-
|
|
433
|
+
{
|
|
434
434
|
element.style.right = `${right}px`;
|
|
435
435
|
}
|
|
436
|
-
|
|
436
|
+
{
|
|
437
437
|
element.style.bottom = `${bottom}px`;
|
|
438
438
|
}
|
|
439
|
-
|
|
439
|
+
{
|
|
440
440
|
element.style.left = `${left}px`;
|
|
441
441
|
}
|
|
442
442
|
element.style.position = position;
|
|
@@ -200,24 +200,16 @@ function fromNow(date, appendAgoLabel, useFullTimeWords, disallowNow) {
|
|
|
200
200
|
function getDurationString(ms, useFullTimeWords) {
|
|
201
201
|
const seconds = Math.abs(ms / 1000);
|
|
202
202
|
if (seconds < 1) {
|
|
203
|
-
return
|
|
204
|
-
? ( localizeWithPath(_moduleId, 54, '{0} milliseconds', ms))
|
|
205
|
-
: ( localizeWithPath(_moduleId, 55, '{0}ms', ms));
|
|
203
|
+
return ( localizeWithPath(_moduleId, 55, '{0}ms', ms));
|
|
206
204
|
}
|
|
207
205
|
if (seconds < minute) {
|
|
208
|
-
return
|
|
209
|
-
? ( localizeWithPath(_moduleId, 56, '{0} seconds', Math.round(ms) / 1000))
|
|
210
|
-
: ( localizeWithPath(_moduleId, 57, '{0}s', Math.round(ms) / 1000));
|
|
206
|
+
return ( localizeWithPath(_moduleId, 57, '{0}s', Math.round(ms) / 1000));
|
|
211
207
|
}
|
|
212
208
|
if (seconds < hour) {
|
|
213
|
-
return
|
|
214
|
-
? ( localizeWithPath(_moduleId, 58, '{0} minutes', Math.round(ms / (1000 * minute))))
|
|
215
|
-
: ( localizeWithPath(_moduleId, 59, '{0} mins', Math.round(ms / (1000 * minute))));
|
|
209
|
+
return ( localizeWithPath(_moduleId, 59, '{0} mins', Math.round(ms / (1000 * minute))));
|
|
216
210
|
}
|
|
217
211
|
if (seconds < day) {
|
|
218
|
-
return
|
|
219
|
-
? ( localizeWithPath(_moduleId, 60, '{0} hours', Math.round(ms / (1000 * hour))))
|
|
220
|
-
: ( localizeWithPath(_moduleId, 61, '{0} hrs', Math.round(ms / (1000 * hour))));
|
|
212
|
+
return ( localizeWithPath(_moduleId, 61, '{0} hrs', Math.round(ms / (1000 * hour))));
|
|
221
213
|
}
|
|
222
214
|
return ( localizeWithPath(_moduleId, 62, '{0} days', Math.round(ms / (1000 * day))));
|
|
223
215
|
}
|
|
@@ -52,16 +52,12 @@ function debounce(delay, reducer, initialValueProvider) {
|
|
|
52
52
|
const resultKey = `$debounce$result$${key}`;
|
|
53
53
|
return function (...args) {
|
|
54
54
|
if (!this[resultKey]) {
|
|
55
|
-
this[resultKey] =
|
|
55
|
+
this[resultKey] = undefined;
|
|
56
56
|
}
|
|
57
57
|
clearTimeout(this[timerKey]);
|
|
58
|
-
if (reducer) {
|
|
59
|
-
this[resultKey] = reducer(this[resultKey], ...args);
|
|
60
|
-
args = [this[resultKey]];
|
|
61
|
-
}
|
|
62
58
|
this[timerKey] = setTimeout(() => {
|
|
63
59
|
fn.apply(this, args);
|
|
64
|
-
this[resultKey] =
|
|
60
|
+
this[resultKey] = undefined;
|
|
65
61
|
}, delay);
|
|
66
62
|
};
|
|
67
63
|
}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { posix, sep } from './path.js';
|
|
2
2
|
import { isWindows } from './platform.js';
|
|
3
3
|
import { equalsIgnoreCase, startsWithIgnoreCase } from './strings.js';
|
|
4
4
|
import { isNumber } from './types.js';
|
|
@@ -233,15 +233,9 @@ function randomPath(parent, prefix, randomLength = 8) {
|
|
|
233
233
|
suffix += pathCharsTouse.charAt(Math.floor(Math.random() * pathCharsTouse.length));
|
|
234
234
|
}
|
|
235
235
|
let randomFileName;
|
|
236
|
-
|
|
237
|
-
randomFileName = `${prefix}-${suffix}`;
|
|
238
|
-
}
|
|
239
|
-
else {
|
|
236
|
+
{
|
|
240
237
|
randomFileName = suffix;
|
|
241
238
|
}
|
|
242
|
-
if (parent) {
|
|
243
|
-
return join(parent, randomFileName);
|
|
244
|
-
}
|
|
245
239
|
return randomFileName;
|
|
246
240
|
}
|
|
247
241
|
export { getDriveLetter, getRoot, hasDriveLetter, indexOfPath, isEqual, isEqualOrParent, isPathSeparator, isUNC, isValidBasename, isWindowsDriveLetter, parseLineAndColumnAware, randomPath, toPosixPath, toSlashes };
|
|
@@ -62,7 +62,7 @@ function setProperty(text, originalPath, value, formattingOptions, getInsertionI
|
|
|
62
62
|
return [];
|
|
63
63
|
}
|
|
64
64
|
const newProperty = `${JSON.stringify(lastSegment)}: ${JSON.stringify(value)}`;
|
|
65
|
-
const index =
|
|
65
|
+
const index = parent.children.length;
|
|
66
66
|
let edit;
|
|
67
67
|
if (index > 0) {
|
|
68
68
|
const previous = parent.children[index - 1];
|
|
@@ -43,7 +43,7 @@ class EditorScrollbar extends ViewPart {
|
|
|
43
43
|
this._setLayout();
|
|
44
44
|
const onBrowserDesperateReveal = (domNode, lookAtScrollTop, lookAtScrollLeft) => {
|
|
45
45
|
const newScrollPosition = {};
|
|
46
|
-
|
|
46
|
+
{
|
|
47
47
|
const deltaTop = domNode.scrollTop;
|
|
48
48
|
if (deltaTop) {
|
|
49
49
|
newScrollPosition.scrollTop = this._context.viewLayout.getCurrentScrollTop() + deltaTop;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BugIndicatingError } from '../../../base/common/errors.js';
|
|
2
2
|
import { OffsetRange } from './offsetRange.js';
|
|
3
3
|
import { Range } from './range.js';
|
|
4
|
-
import { findFirstIdxMonotonousOrArrLen,
|
|
4
|
+
import { findFirstIdxMonotonousOrArrLen, findLastMonotonous, findLastIdxMonotonous } from '../../../base/common/arraysFind.js';
|
|
5
5
|
class LineRange {
|
|
6
6
|
static fromRange(range) {
|
|
7
7
|
return ( new LineRange(range.startLineNumber, range.endLineNumber));
|
|
@@ -7,17 +7,22 @@ declare const enum WordCharacterClass {
|
|
|
7
7
|
}
|
|
8
8
|
declare class WordCharacterClassifier extends CharacterClassifier<WordCharacterClass> {
|
|
9
9
|
readonly intlSegmenterLocales: Intl.UnicodeBCP47LocaleIdentifier[];
|
|
10
|
-
private readonly _segmenter;
|
|
11
|
-
private _cachedLine;
|
|
12
|
-
private _cachedSegments;
|
|
13
10
|
constructor(wordSeparators: string, intlSegmenterLocales: Intl.UnicodeBCP47LocaleIdentifier[]);
|
|
14
11
|
findPrevIntlWordBeforeOrAtOffset(line: string, offset: number): IntlWordSegmentData | null;
|
|
15
12
|
findNextIntlWordAtOrAfterOffset(lineContent: string, offset: number): IntlWordSegmentData | null;
|
|
16
13
|
private _getIntlSegmenterWordsOnLine;
|
|
17
|
-
private _filterWordSegments;
|
|
18
|
-
private _isWordLike;
|
|
19
14
|
}
|
|
20
|
-
interface IntlWordSegmentData
|
|
15
|
+
interface IntlWordSegmentData {
|
|
16
|
+
/** A string containing the segment extracted from the original input string. */
|
|
17
|
+
segment: string;
|
|
18
|
+
/** The code unit index in the original input string at which the segment begins. */
|
|
19
|
+
index: number;
|
|
20
|
+
/** The complete input string that was segmented. */
|
|
21
|
+
input: string;
|
|
22
|
+
/**
|
|
23
|
+
* A boolean value only if granularity is "word"; otherwise, undefined.
|
|
24
|
+
* If granularity is "word", then isWordLike is true when the segment is word-like (i.e., consists of letters/numbers/ideographs/etc.); otherwise, false.
|
|
25
|
+
*/
|
|
21
26
|
isWordLike: true;
|
|
22
27
|
}
|
|
23
28
|
|
|
@@ -3,16 +3,7 @@ import { CharacterClassifier } from './characterClassifier.js';
|
|
|
3
3
|
class WordCharacterClassifier extends CharacterClassifier {
|
|
4
4
|
constructor(wordSeparators, intlSegmenterLocales) {
|
|
5
5
|
super(0 );
|
|
6
|
-
this._segmenter = null;
|
|
7
|
-
this._cachedLine = null;
|
|
8
|
-
this._cachedSegments = [];
|
|
9
6
|
this.intlSegmenterLocales = intlSegmenterLocales;
|
|
10
|
-
if (this.intlSegmenterLocales.length > 0) {
|
|
11
|
-
this._segmenter = new Intl.Segmenter(this.intlSegmenterLocales, { granularity: 'word' });
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
this._segmenter = null;
|
|
15
|
-
}
|
|
16
7
|
for (let i = 0, len = wordSeparators.length; i < len; i++) {
|
|
17
8
|
this.set(wordSeparators.charCodeAt(i), 2 );
|
|
18
9
|
}
|
|
@@ -39,30 +30,7 @@ class WordCharacterClassifier extends CharacterClassifier {
|
|
|
39
30
|
return null;
|
|
40
31
|
}
|
|
41
32
|
_getIntlSegmenterWordsOnLine(line) {
|
|
42
|
-
|
|
43
|
-
return [];
|
|
44
|
-
}
|
|
45
|
-
if (this._cachedLine === line) {
|
|
46
|
-
return this._cachedSegments;
|
|
47
|
-
}
|
|
48
|
-
this._cachedLine = line;
|
|
49
|
-
this._cachedSegments = this._filterWordSegments(this._segmenter.segment(line));
|
|
50
|
-
return this._cachedSegments;
|
|
51
|
-
}
|
|
52
|
-
_filterWordSegments(segments) {
|
|
53
|
-
const result = [];
|
|
54
|
-
for (const segment of segments) {
|
|
55
|
-
if (this._isWordLike(segment)) {
|
|
56
|
-
result.push(segment);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
return result;
|
|
60
|
-
}
|
|
61
|
-
_isWordLike(segment) {
|
|
62
|
-
if (segment.isWordLike) {
|
|
63
|
-
return true;
|
|
64
|
-
}
|
|
65
|
-
return false;
|
|
33
|
+
return [];
|
|
66
34
|
}
|
|
67
35
|
}
|
|
68
36
|
const wordClassifierCache = ( new LRUCache(10));
|
|
@@ -38,19 +38,7 @@ function getReindentEditOperations(model, languageConfigurationService, startLin
|
|
|
38
38
|
let globalIndent;
|
|
39
39
|
const currentLineText = model.getLineContent(startLineNumber);
|
|
40
40
|
let adjustedLineContent = currentLineText;
|
|
41
|
-
|
|
42
|
-
globalIndent = inheritedIndent;
|
|
43
|
-
const oldIndentation = getLeadingWhitespace(currentLineText);
|
|
44
|
-
adjustedLineContent = globalIndent + currentLineText.substring(oldIndentation.length);
|
|
45
|
-
if (indentationRules.decreaseIndentPattern && indentationRules.decreaseIndentPattern.test(adjustedLineContent)) {
|
|
46
|
-
globalIndent = unshiftIndent(globalIndent);
|
|
47
|
-
adjustedLineContent = globalIndent + currentLineText.substring(oldIndentation.length);
|
|
48
|
-
}
|
|
49
|
-
if (currentLineText !== adjustedLineContent) {
|
|
50
|
-
indentEdits.push(EditOperation.replaceMove(( new Selection(startLineNumber, 1, startLineNumber, oldIndentation.length + 1)), normalizeIndentation(globalIndent, indentSize, insertSpaces)));
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
41
|
+
{
|
|
54
42
|
globalIndent = getLeadingWhitespace(currentLineText);
|
|
55
43
|
}
|
|
56
44
|
let idealIndentForNextLine = globalIndent;
|
|
@@ -7,12 +7,12 @@ const pinnedButtonClass = ThemeIcon.asClassName(Codicon.pinned);
|
|
|
7
7
|
const buttonClasses = [pinButtonClass, pinnedButtonClass];
|
|
8
8
|
async function showWithPinnedItems(storageService, storageKey, quickPick, filterDuplicates) {
|
|
9
9
|
const itemsWithoutPinned = quickPick.items;
|
|
10
|
-
let itemsWithPinned = _formatPinnedItems(storageKey, quickPick, storageService, undefined
|
|
10
|
+
let itemsWithPinned = _formatPinnedItems(storageKey, quickPick, storageService, undefined);
|
|
11
11
|
quickPick.onDidTriggerItemButton(async (buttonEvent) => {
|
|
12
12
|
const expectedButton = buttonEvent.button.iconClass && buttonClasses.includes(buttonEvent.button.iconClass);
|
|
13
13
|
if (expectedButton) {
|
|
14
14
|
quickPick.items = itemsWithoutPinned;
|
|
15
|
-
itemsWithPinned = _formatPinnedItems(storageKey, quickPick, storageService, buttonEvent.item
|
|
15
|
+
itemsWithPinned = _formatPinnedItems(storageKey, quickPick, storageService, buttonEvent.item);
|
|
16
16
|
quickPick.items = quickPick.value ? itemsWithoutPinned : itemsWithPinned;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
@@ -45,7 +45,7 @@ function _formatPinnedItems(storageKey, quickPick, storageService, changedItem,
|
|
|
45
45
|
if (itemToPin) {
|
|
46
46
|
const pinnedItemId = getItemIdentifier(itemToPin);
|
|
47
47
|
const pinnedItem = Object.assign({}, itemToPin);
|
|
48
|
-
if (!
|
|
48
|
+
if (!( (pinnedIds.has(pinnedItemId)))) {
|
|
49
49
|
pinnedIds.add(pinnedItemId);
|
|
50
50
|
updateButtons(pinnedItem, false);
|
|
51
51
|
formattedItems.push(pinnedItem);
|
|
@@ -15,7 +15,6 @@ function isEmptyWorkspaceIdentifier(obj) {
|
|
|
15
15
|
&& !isSingleFolderWorkspaceIdentifier(obj)
|
|
16
16
|
&& !isWorkspaceIdentifier(obj);
|
|
17
17
|
}
|
|
18
|
-
const EXTENSION_DEVELOPMENT_EMPTY_WINDOW_WORKSPACE = { id: 'ext-dev' };
|
|
19
18
|
const UNKNOWN_EMPTY_WINDOW_WORKSPACE = { id: 'empty-window' };
|
|
20
19
|
function toWorkspaceIdentifier(arg0, isExtensionDevelopment) {
|
|
21
20
|
if (typeof arg0 === 'string' || typeof arg0 === 'undefined') {
|
|
@@ -24,9 +23,6 @@ function toWorkspaceIdentifier(arg0, isExtensionDevelopment) {
|
|
|
24
23
|
id: basename(arg0)
|
|
25
24
|
};
|
|
26
25
|
}
|
|
27
|
-
if (isExtensionDevelopment) {
|
|
28
|
-
return EXTENSION_DEVELOPMENT_EMPTY_WINDOW_WORKSPACE;
|
|
29
|
-
}
|
|
30
26
|
return UNKNOWN_EMPTY_WINDOW_WORKSPACE;
|
|
31
27
|
}
|
|
32
28
|
const workspace = arg0;
|
|
@@ -165,4 +161,4 @@ function hasWorkspaceFileExtension(path) {
|
|
|
165
161
|
const ext = (typeof path === 'string') ? extname(path) : extname$1(path);
|
|
166
162
|
return ext === WORKSPACE_SUFFIX;
|
|
167
163
|
}
|
|
168
|
-
export {
|
|
164
|
+
export { STANDALONE_EDITOR_WORKSPACE_ID, UNKNOWN_EMPTY_WINDOW_WORKSPACE, UNTITLED_WORKSPACE_NAME, WORKSPACE_EXTENSION, WORKSPACE_FILTER, WORKSPACE_SUFFIX, Workspace$1 as Workspace, WorkspaceFolder, hasWorkspaceFileExtension, isEmptyWorkspaceIdentifier, isSavedWorkspace, isSingleFolderWorkspaceIdentifier, isStandaloneEditorWorkspace, isTemporaryWorkspace, isUntitledWorkspace, isWorkspace, isWorkspaceFolder, isWorkspaceIdentifier, toWorkspaceFolder, toWorkspaceIdentifier };
|
|
@@ -647,9 +647,6 @@ CommentNode = ( (__decorate([
|
|
|
647
647
|
function fillInActions(groups, target, useAlternativeActions, isPrimaryGroup = group => group === 'navigation') {
|
|
648
648
|
for (const tuple of groups) {
|
|
649
649
|
let [group, actions] = tuple;
|
|
650
|
-
if (useAlternativeActions) {
|
|
651
|
-
actions = ( (actions.map(a => (a instanceof MenuItemAction) && !!a.alt ? a.alt : a)));
|
|
652
|
-
}
|
|
653
650
|
if (isPrimaryGroup(group)) {
|
|
654
651
|
const to = Array.isArray(target) ? target : target.primary;
|
|
655
652
|
to.unshift(...actions);
|
|
@@ -19,7 +19,7 @@ import { IQuickInputService } from '../../../../platform/quickinput/common/quick
|
|
|
19
19
|
import { CommentGlyphWidget } from './commentGlyphWidget.js';
|
|
20
20
|
import { ICommentService } from './commentService.service.js';
|
|
21
21
|
import { CommentWidgetFocus, ReviewZoneWidget, parseMouseDownInfoFromEvent, isMouseUpEventDragFromMouseDown } from './commentThreadZoneWidget.js';
|
|
22
|
-
import {
|
|
22
|
+
import { ACTIVE_GROUP, SIDE_GROUP } from '../../../services/editor/common/editorService.js';
|
|
23
23
|
import { IEditorService } from '../../../services/editor/common/editorService.service.js';
|
|
24
24
|
import { EmbeddedCodeEditorWidget } from '../../../../editor/browser/widget/codeEditor/embeddedCodeEditorWidget.js';
|
|
25
25
|
import { IViewsService } from '../../../services/views/common/viewsService.service.js';
|
|
@@ -599,7 +599,7 @@ const getUriForDebugMemory = (sessionId, memoryReference, range, displayName = '
|
|
|
599
599
|
scheme: DEBUG_MEMORY_SCHEME,
|
|
600
600
|
authority: sessionId,
|
|
601
601
|
path: '/' + encodeURIComponent(memoryReference) + `/${encodeURIComponent(displayName)}.bin`,
|
|
602
|
-
query:
|
|
602
|
+
query: undefined,
|
|
603
603
|
}))
|
|
604
604
|
);
|
|
605
605
|
};
|
|
@@ -9,9 +9,6 @@ import { coalesce } from '../../../../base/common/arrays.js';
|
|
|
9
9
|
const _formatPIIRegexp = /{([^}]+)}/g;
|
|
10
10
|
function formatPII(value, excludePII, args) {
|
|
11
11
|
return value.replace(_formatPIIRegexp, function (match, group) {
|
|
12
|
-
if (excludePII && group.length > 0 && group[0] !== '_') {
|
|
13
|
-
return match;
|
|
14
|
-
}
|
|
15
12
|
return args && args.hasOwnProperty(group) ?
|
|
16
13
|
args[group] :
|
|
17
14
|
match;
|
|
@@ -341,17 +341,8 @@ async function joinNotebookCells(editor, range, direction, constraint) {
|
|
|
341
341
|
if (range.end === textModel.length && direction === 'below') {
|
|
342
342
|
return null;
|
|
343
343
|
}
|
|
344
|
-
for (let i = 0; i < cells.length; i++) {
|
|
345
|
-
const cell = cells[i];
|
|
346
|
-
if (constraint && cell.cellKind !== constraint) {
|
|
347
|
-
return null;
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
344
|
if (direction === 'above') {
|
|
351
345
|
const above = editor.cellAt(range.start - 1);
|
|
352
|
-
if (constraint && above.cellKind !== constraint) {
|
|
353
|
-
return null;
|
|
354
|
-
}
|
|
355
346
|
const insertContent = ( (cells.map(cell => (cell.textBuffer.getEOL() ?? '') + cell.getText()))).join('');
|
|
356
347
|
const aboveCellLineCount = above.textBuffer.getLineCount();
|
|
357
348
|
const aboveCellLastLineEndColumn = above.textBuffer.getLineLength(aboveCellLineCount);
|
|
@@ -377,9 +368,6 @@ async function joinNotebookCells(editor, range, direction, constraint) {
|
|
|
377
368
|
}
|
|
378
369
|
else {
|
|
379
370
|
const below = editor.cellAt(range.end);
|
|
380
|
-
if (constraint && below.cellKind !== constraint) {
|
|
381
|
-
return null;
|
|
382
|
-
}
|
|
383
371
|
const cell = cells[0];
|
|
384
372
|
const restCells = [...cells.slice(1), below];
|
|
385
373
|
const insertContent = ( (restCells.map(cl => (cl.textBuffer.getEOL() ?? '') + cl.getText()))).join('');
|
|
@@ -560,7 +548,7 @@ function insertCell(languageService, editor, index, type, direction = 'above', i
|
|
|
560
548
|
const insertIndex = cell ?
|
|
561
549
|
(direction === 'above' ? index : nextIndex) :
|
|
562
550
|
index;
|
|
563
|
-
return insertCellAtIndex(viewModel, insertIndex, initialText, language, type, undefined, [], true
|
|
551
|
+
return insertCellAtIndex(viewModel, insertIndex, initialText, language, type, undefined, [], true);
|
|
564
552
|
}
|
|
565
553
|
function insertCellAtIndex(viewModel, index, source, language, type, metadata, outputs, synchronous, pushUndoStop) {
|
|
566
554
|
const endSelections = { kind: SelectionStateType.Index, focus: { start: index, end: index + 1 }, selections: [{ start: index, end: index + 1 }] };
|
|
@@ -580,7 +568,7 @@ function insertCellAtIndex(viewModel, index, source, language, type, metadata, o
|
|
|
580
568
|
}
|
|
581
569
|
]
|
|
582
570
|
}
|
|
583
|
-
], synchronous, { kind: SelectionStateType.Index, focus: viewModel.getFocus(), selections: viewModel.getSelections() }, () => endSelections, undefined,
|
|
571
|
+
], synchronous, { kind: SelectionStateType.Index, focus: viewModel.getFocus(), selections: viewModel.getSelections() }, () => endSelections, undefined, !viewModel.options.isReadOnly);
|
|
584
572
|
return viewModel.cellAt(index);
|
|
585
573
|
}
|
|
586
574
|
export { changeCellToKind, computeCellLinesContents, copyCellRange, insertCell, insertCellAtIndex, joinCellsWithSurrounds, joinNotebookCells, joinSelectedCells, moveCellRange, runDeleteAction };
|
|
@@ -227,7 +227,7 @@ function createDeleteToolbar(accessor, container, hoverDelegate, elementClass) {
|
|
|
227
227
|
renderDropdownAsChildElement: true,
|
|
228
228
|
hoverDelegate
|
|
229
229
|
}));
|
|
230
|
-
|
|
230
|
+
{
|
|
231
231
|
toolbar.getElement().classList.add(elementClass);
|
|
232
232
|
}
|
|
233
233
|
return toolbar;
|
|
@@ -586,23 +586,8 @@ async function webviewPreloads(ctx) {
|
|
|
586
586
|
update: updateHighlights
|
|
587
587
|
};
|
|
588
588
|
}
|
|
589
|
-
function selectRange(_range) {
|
|
590
|
-
const sel = window.getSelection();
|
|
591
|
-
if (sel) {
|
|
592
|
-
try {
|
|
593
|
-
sel.removeAllRanges();
|
|
594
|
-
const r = document.createRange();
|
|
595
|
-
r.setStart(_range.startContainer, _range.startOffset);
|
|
596
|
-
r.setEnd(_range.endContainer, _range.endOffset);
|
|
597
|
-
sel.addRange(r);
|
|
598
|
-
}
|
|
599
|
-
catch (e) {
|
|
600
|
-
console.log(e);
|
|
601
|
-
}
|
|
602
|
-
}
|
|
603
|
-
}
|
|
604
589
|
function highlightRange(range, useCustom, tagName = 'mark', attributes = {}) {
|
|
605
|
-
|
|
590
|
+
{
|
|
606
591
|
const ret = _internalHighlightRange(range, tagName, attributes);
|
|
607
592
|
return {
|
|
608
593
|
range: range,
|
|
@@ -621,46 +606,6 @@ async function webviewPreloads(ctx) {
|
|
|
621
606
|
}
|
|
622
607
|
};
|
|
623
608
|
}
|
|
624
|
-
else {
|
|
625
|
-
window.document.execCommand('hiliteColor', false, matchColor);
|
|
626
|
-
const cloneRange = window.getSelection().getRangeAt(0).cloneRange();
|
|
627
|
-
const _range = {
|
|
628
|
-
collapsed: cloneRange.collapsed,
|
|
629
|
-
commonAncestorContainer: cloneRange.commonAncestorContainer,
|
|
630
|
-
endContainer: cloneRange.endContainer,
|
|
631
|
-
endOffset: cloneRange.endOffset,
|
|
632
|
-
startContainer: cloneRange.startContainer,
|
|
633
|
-
startOffset: cloneRange.startOffset
|
|
634
|
-
};
|
|
635
|
-
return {
|
|
636
|
-
range: _range,
|
|
637
|
-
dispose: () => {
|
|
638
|
-
selectRange(_range);
|
|
639
|
-
try {
|
|
640
|
-
document.designMode = 'On';
|
|
641
|
-
window.document.execCommand('removeFormat', false, undefined);
|
|
642
|
-
document.designMode = 'Off';
|
|
643
|
-
window.getSelection()?.removeAllRanges();
|
|
644
|
-
}
|
|
645
|
-
catch (e) {
|
|
646
|
-
console.log(e);
|
|
647
|
-
}
|
|
648
|
-
},
|
|
649
|
-
update: (color, className) => {
|
|
650
|
-
selectRange(_range);
|
|
651
|
-
try {
|
|
652
|
-
document.designMode = 'On';
|
|
653
|
-
window.document.execCommand('removeFormat', false, undefined);
|
|
654
|
-
window.document.execCommand('hiliteColor', false, color);
|
|
655
|
-
document.designMode = 'Off';
|
|
656
|
-
window.getSelection()?.removeAllRanges();
|
|
657
|
-
}
|
|
658
|
-
catch (e) {
|
|
659
|
-
console.log(e);
|
|
660
|
-
}
|
|
661
|
-
}
|
|
662
|
-
};
|
|
663
|
-
}
|
|
664
609
|
}
|
|
665
610
|
function createEmitter(listenerChange = () => undefined) {
|
|
666
611
|
const listeners = ( new Set());
|
|
@@ -554,12 +554,12 @@ let KernelPickerMRUStrategy = class KernelPickerMRUStrategy extends KernelPicker
|
|
|
554
554
|
const runningActions = notebookKernelService.getRunningSourceActions(notebook);
|
|
555
555
|
const updateActionFromSourceAction = (sourceAction, running) => {
|
|
556
556
|
const sAction = sourceAction.action;
|
|
557
|
-
action.class =
|
|
557
|
+
action.class = ThemeIcon.asClassName(ThemeIcon.modify(executingStateIcon, 'spin')) ;
|
|
558
558
|
action.label = sAction.label;
|
|
559
559
|
action.enabled = true;
|
|
560
560
|
};
|
|
561
561
|
if (runningActions.length) {
|
|
562
|
-
return updateActionFromSourceAction(runningActions[0]
|
|
562
|
+
return updateActionFromSourceAction(runningActions[0] );
|
|
563
563
|
}
|
|
564
564
|
const { selected } = notebookKernelHistoryService.getKernels(notebook);
|
|
565
565
|
if (selected) {
|
|
@@ -56,15 +56,11 @@ function getColorStyleContent(colorTheme, editor) {
|
|
|
56
56
|
const colorClass = getColorClass(colorKey);
|
|
57
57
|
const color = colorTheme.getColor(colorKey);
|
|
58
58
|
if (color) {
|
|
59
|
-
|
|
59
|
+
{
|
|
60
60
|
css += (`.monaco-workbench .show-file-icons .predefined-file-icon.terminal-tab.${colorClass}::before,` +
|
|
61
61
|
`.monaco-workbench .show-file-icons .file-icon.terminal-tab.${colorClass}::before` +
|
|
62
62
|
`{ color: ${color} !important; }`);
|
|
63
63
|
}
|
|
64
|
-
else {
|
|
65
|
-
css += (`.monaco-workbench .${colorClass} .codicon:first-child:not(.codicon-split-horizontal):not(.codicon-trashcan):not(.file-icon)` +
|
|
66
|
-
`{ color: ${color} !important; }`);
|
|
67
|
-
}
|
|
68
64
|
}
|
|
69
65
|
}
|
|
70
66
|
return css;
|