@codingame/monaco-vscode-walkthrough-service-override 5.3.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.contribution.js +18 -15
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.js +29 -27
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService._contribution.js +4 -3
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService.js +10 -8
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/startupPage.js +18 -13
- package/vscode/src/vs/workbench/contrib/welcomeWalkthrough/browser/walkThroughActions.js +10 -8
- package/vscode/src/vs/workbench/contrib/welcomeWalkthrough/browser/walkThroughInput.js +2 -1
- package/vscode/src/vs/workbench/contrib/welcomeWalkthrough/browser/walkThroughPart.js +13 -11
- package/vscode/src/vs/workbench/contrib/welcomeWalkthrough/common/walkThroughContentProvider.js +3 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-walkthrough-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"vscode": "npm:@codingame/monaco-vscode-api@
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@6.0.0"
|
|
30
30
|
}
|
|
31
31
|
}
|
package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.contribution.js
CHANGED
|
@@ -9,19 +9,21 @@ import { ContextKeyExpr, RawContextKey } from 'vscode/vscode/vs/platform/context
|
|
|
9
9
|
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
10
10
|
import { SIDE_GROUP } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
11
11
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
12
|
+
import { KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
|
|
13
|
+
import { KeyCode } from 'vscode/vscode/vs/base/common/keyCodes';
|
|
12
14
|
import { EditorPaneDescriptor } from 'vscode/vscode/vs/workbench/browser/editor';
|
|
13
15
|
import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
|
|
14
16
|
import { IWalkthroughsService } from 'vscode/vscode/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService.service';
|
|
15
17
|
import { GettingStartedInput } from './gettingStartedInput.js';
|
|
16
|
-
import { registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
17
|
-
import { Extensions } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
18
|
+
import { registerWorkbenchContribution2, WorkbenchPhase } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
19
|
+
import { Extensions, ConfigurationScope } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
18
20
|
import { workbenchConfigurationNodeBase } from 'vscode/vscode/vs/workbench/common/configuration';
|
|
19
21
|
import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
20
22
|
import { CommandsRegistry } from 'vscode/vscode/vs/platform/commands/common/commands';
|
|
21
23
|
import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands.service';
|
|
22
24
|
import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/quickInput.service';
|
|
23
25
|
import { IRemoteAgentService } from 'vscode/vscode/vs/workbench/services/remote/common/remoteAgentService.service';
|
|
24
|
-
import { isMacintosh, isLinux, isWindows } from 'vscode/vscode/vs/base/common/platform';
|
|
26
|
+
import { OperatingSystem, isMacintosh, isLinux, isWindows } from 'vscode/vscode/vs/base/common/platform';
|
|
25
27
|
import { IExtensionManagementServerService } from 'vscode/vscode/vs/workbench/services/extensionManagement/common/extensionManagement.service';
|
|
26
28
|
import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
27
29
|
import { StartupPageEditorResolverContribution, StartupPageRunnerContribution } from './startupPage.js';
|
|
@@ -94,9 +96,10 @@ registerAction2(class extends Action2 {
|
|
|
94
96
|
}]);
|
|
95
97
|
}
|
|
96
98
|
else {
|
|
99
|
+
const options = { selectedCategory: selectedCategory, selectedStep: selectedStep, preserveFocus: toSide ?? false };
|
|
97
100
|
editorService.openEditor({
|
|
98
101
|
resource: GettingStartedInput.RESOURCE,
|
|
99
|
-
options
|
|
102
|
+
options
|
|
100
103
|
}, toSide ? SIDE_GROUP : undefined).then((editor) => {
|
|
101
104
|
editor?.makeCategoryVisibleWhenAvailable(selectedCategory, selectedStep);
|
|
102
105
|
});
|
|
@@ -122,8 +125,8 @@ registerAction2(class extends Action2 {
|
|
|
122
125
|
title: ( localize2WithPath(_moduleId, 3, 'Go Back')),
|
|
123
126
|
category,
|
|
124
127
|
keybinding: {
|
|
125
|
-
weight:
|
|
126
|
-
primary:
|
|
128
|
+
weight: KeybindingWeight.EditorContrib,
|
|
129
|
+
primary: KeyCode.Escape,
|
|
127
130
|
when: inWelcomeContext
|
|
128
131
|
},
|
|
129
132
|
precondition: ( (ContextKeyExpr.equals('activeEditor', 'gettingStartedPage'))),
|
|
@@ -247,9 +250,9 @@ let WorkspacePlatformContribution = class WorkspacePlatformContribution {
|
|
|
247
250
|
this.contextService = contextService;
|
|
248
251
|
this.remoteAgentService.getEnvironment().then(env => {
|
|
249
252
|
const remoteOS = env?.os;
|
|
250
|
-
const remotePlatform = remoteOS ===
|
|
251
|
-
: remoteOS ===
|
|
252
|
-
: remoteOS ===
|
|
253
|
+
const remotePlatform = remoteOS === OperatingSystem.Macintosh ? 'mac'
|
|
254
|
+
: remoteOS === OperatingSystem.Windows ? 'windows'
|
|
255
|
+
: remoteOS === OperatingSystem.Linux ? 'linux'
|
|
253
256
|
: undefined;
|
|
254
257
|
if (remotePlatform) {
|
|
255
258
|
WorkspacePlatform.bindTo(this.contextService).set(remotePlatform);
|
|
@@ -284,7 +287,7 @@ configurationRegistry.registerConfiguration({
|
|
|
284
287
|
...workbenchConfigurationNodeBase,
|
|
285
288
|
properties: {
|
|
286
289
|
'workbench.welcomePage.walkthroughs.openOnInstall': {
|
|
287
|
-
scope:
|
|
290
|
+
scope: ConfigurationScope.MACHINE,
|
|
288
291
|
type: 'boolean',
|
|
289
292
|
default: true,
|
|
290
293
|
description: ( localizeWithPath(
|
|
@@ -294,7 +297,7 @@ configurationRegistry.registerConfiguration({
|
|
|
294
297
|
))
|
|
295
298
|
},
|
|
296
299
|
'workbench.startupEditor': {
|
|
297
|
-
'scope':
|
|
300
|
+
'scope': ConfigurationScope.RESOURCE,
|
|
298
301
|
'type': 'string',
|
|
299
302
|
'enum': ['none', 'welcomePage', 'readme', 'newUntitledFile', 'welcomePageInEmptyWorkbench', 'terminal'],
|
|
300
303
|
'enumDescriptions': [
|
|
@@ -325,7 +328,7 @@ configurationRegistry.registerConfiguration({
|
|
|
325
328
|
))
|
|
326
329
|
},
|
|
327
330
|
'workbench.welcomePage.preferReducedMotion': {
|
|
328
|
-
scope:
|
|
331
|
+
scope: ConfigurationScope.APPLICATION,
|
|
329
332
|
type: 'boolean',
|
|
330
333
|
default: false,
|
|
331
334
|
deprecationMessage: ( localizeWithPath(_moduleId, 17, "Deprecated, use the global `workbench.reduceMotion`.")),
|
|
@@ -333,8 +336,8 @@ configurationRegistry.registerConfiguration({
|
|
|
333
336
|
}
|
|
334
337
|
}
|
|
335
338
|
});
|
|
336
|
-
registerWorkbenchContribution2(WorkspacePlatformContribution.ID, WorkspacePlatformContribution,
|
|
337
|
-
registerWorkbenchContribution2(StartupPageEditorResolverContribution.ID, StartupPageEditorResolverContribution,
|
|
338
|
-
registerWorkbenchContribution2(StartupPageRunnerContribution.ID, StartupPageRunnerContribution,
|
|
339
|
+
registerWorkbenchContribution2(WorkspacePlatformContribution.ID, WorkspacePlatformContribution, WorkbenchPhase.AfterRestored);
|
|
340
|
+
registerWorkbenchContribution2(StartupPageEditorResolverContribution.ID, StartupPageEditorResolverContribution, WorkbenchPhase.BlockRestore);
|
|
341
|
+
registerWorkbenchContribution2(StartupPageRunnerContribution.ID, StartupPageRunnerContribution, WorkbenchPhase.AfterRestored);
|
|
339
342
|
|
|
340
343
|
export { WorkspacePlatform };
|
|
@@ -6,10 +6,11 @@ import { Button } from 'vscode/vscode/vs/base/browser/ui/button/button';
|
|
|
6
6
|
import { renderLabelWithIcons } from 'vscode/vscode/vs/base/browser/ui/iconLabel/iconLabels';
|
|
7
7
|
import { DomScrollableElement } from 'vscode/vscode/vs/base/browser/ui/scrollbar/scrollableElement';
|
|
8
8
|
import { Toggle } from 'vscode/vscode/vs/base/browser/ui/toggle/toggle';
|
|
9
|
-
import { equals,
|
|
9
|
+
import { equals, coalesce } from 'vscode/vscode/vs/base/common/arrays';
|
|
10
10
|
import { Throttler, Delayer } from 'vscode/vscode/vs/base/common/async';
|
|
11
11
|
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
12
12
|
import { onUnexpectedError } from 'vscode/vscode/vs/base/common/errors';
|
|
13
|
+
import { KeyCode } from 'vscode/vscode/vs/base/common/keyCodes';
|
|
13
14
|
import { splitRecentLabel } from 'vscode/vscode/vs/base/common/labels';
|
|
14
15
|
import { DisposableStore, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
15
16
|
import { parse } from 'vscode/vscode/vs/base/common/marshalling';
|
|
@@ -25,21 +26,23 @@ import { MarkdownRenderer } from 'vscode/vscode/vs/editor/browser/widget/markdow
|
|
|
25
26
|
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
26
27
|
import { IAccessibilityService } from 'vscode/vscode/vs/platform/accessibility/common/accessibility.service';
|
|
27
28
|
import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands.service';
|
|
29
|
+
import { ConfigurationTarget } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
28
30
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
29
31
|
import { RawContextKey, ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
30
32
|
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
31
33
|
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
|
|
32
34
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
33
35
|
import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding.service';
|
|
36
|
+
import { Verbosity } from 'vscode/vscode/vs/platform/label/common/label';
|
|
34
37
|
import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label.service';
|
|
35
38
|
import { INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification.service';
|
|
36
39
|
import { Link } from 'vscode/vscode/vs/platform/opener/browser/link';
|
|
37
40
|
import { IOpenerService } from 'vscode/vscode/vs/platform/opener/common/opener.service';
|
|
38
41
|
import { IProductService } from 'vscode/vscode/vs/platform/product/common/productService.service';
|
|
39
42
|
import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/quickInput.service';
|
|
40
|
-
import { WillSaveStateReason } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
43
|
+
import { WillSaveStateReason, StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
41
44
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
|
|
42
|
-
import { firstSessionDateStorageKey } from 'vscode/vscode/vs/platform/telemetry/common/telemetry';
|
|
45
|
+
import { firstSessionDateStorageKey, TelemetryLevel } from 'vscode/vscode/vs/platform/telemetry/common/telemetry';
|
|
43
46
|
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
44
47
|
import { getTelemetryLevel } from 'vscode/vscode/vs/platform/telemetry/common/telemetryUtils';
|
|
45
48
|
import { defaultToggleStyles, defaultButtonStyles } from 'vscode/vscode/vs/platform/theme/browser/defaultStyles';
|
|
@@ -60,6 +63,7 @@ import { hiddenEntriesConfigurationKey, parseDescription } from './gettingStarte
|
|
|
60
63
|
import { IWalkthroughsService } from 'vscode/vscode/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService.service';
|
|
61
64
|
import { restoreWalkthroughsConfigurationKey } from './startupPage.js';
|
|
62
65
|
import { startEntries } from '../common/gettingStartedContent.js';
|
|
66
|
+
import { GroupDirection, GroupsOrder } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService';
|
|
63
67
|
import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
64
68
|
import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
65
69
|
import { IHostService } from 'vscode/vscode/vs/workbench/services/host/browser/host.service';
|
|
@@ -221,7 +225,7 @@ let GettingStartedPage = class GettingStartedPage extends EditorPane {
|
|
|
221
225
|
return;
|
|
222
226
|
}
|
|
223
227
|
const restoreData = { folder: UNKNOWN_EMPTY_WINDOW_WORKSPACE.id, category: this.editorInput.selectedCategory, step: this.editorInput.selectedStep };
|
|
224
|
-
this.storageService.store(restoreWalkthroughsConfigurationKey, JSON.stringify(restoreData),
|
|
228
|
+
this.storageService.store(restoreWalkthroughsConfigurationKey, JSON.stringify(restoreData), StorageScope.PROFILE, StorageTarget.MACHINE);
|
|
225
229
|
}));
|
|
226
230
|
}
|
|
227
231
|
shouldAnimate() {
|
|
@@ -272,8 +276,8 @@ let GettingStartedPage = class GettingStartedPage extends EditorPane {
|
|
|
272
276
|
const keyboardEvent = ( (new StandardKeyboardEvent(e)));
|
|
273
277
|
e.stopPropagation();
|
|
274
278
|
switch (keyboardEvent.keyCode) {
|
|
275
|
-
case
|
|
276
|
-
case
|
|
279
|
+
case KeyCode.Enter:
|
|
280
|
+
case KeyCode.Space:
|
|
277
281
|
this.runDispatchCommand(command, argument);
|
|
278
282
|
return;
|
|
279
283
|
}
|
|
@@ -416,12 +420,12 @@ let GettingStartedPage = class GettingStartedPage extends EditorPane {
|
|
|
416
420
|
getHiddenCategories() {
|
|
417
421
|
return (
|
|
418
422
|
(new Set(
|
|
419
|
-
JSON.parse(this.storageService.get(hiddenEntriesConfigurationKey,
|
|
423
|
+
JSON.parse(this.storageService.get(hiddenEntriesConfigurationKey, StorageScope.PROFILE, '[]'))
|
|
420
424
|
))
|
|
421
425
|
);
|
|
422
426
|
}
|
|
423
427
|
setHiddenCategories(hidden) {
|
|
424
|
-
this.storageService.store(hiddenEntriesConfigurationKey, JSON.stringify(hidden),
|
|
428
|
+
this.storageService.store(hiddenEntriesConfigurationKey, JSON.stringify(hidden), StorageScope.PROFILE, StorageTarget.USER);
|
|
425
429
|
}
|
|
426
430
|
async buildMediaComponent(stepId, forceRebuild = false) {
|
|
427
431
|
if (!this.currentWalkthrough) {
|
|
@@ -463,9 +467,9 @@ let GettingStartedPage = class GettingStartedPage extends EditorPane {
|
|
|
463
467
|
mediaElement.setAttribute('alt', media.altText);
|
|
464
468
|
this.updateMediaSourceForColorMode(mediaElement, media.path);
|
|
465
469
|
this.stepDisposables.add(addDisposableListener(this.stepMediaComponent, 'click', () => {
|
|
466
|
-
const hrefs =
|
|
470
|
+
const hrefs = ( (stepToExpand.description.map(
|
|
467
471
|
lt => ( (lt.nodes.filter((node) => typeof node !== 'string').map(node => node.href)))
|
|
468
|
-
))));
|
|
472
|
+
))).flat();
|
|
469
473
|
if (hrefs.length === 1) {
|
|
470
474
|
const href = hrefs[0];
|
|
471
475
|
if (href.startsWith('http')) {
|
|
@@ -490,9 +494,9 @@ let GettingStartedPage = class GettingStartedPage extends EditorPane {
|
|
|
490
494
|
}
|
|
491
495
|
}));
|
|
492
496
|
this.stepDisposables.add(addDisposableListener(this.stepMediaComponent, 'click', () => {
|
|
493
|
-
const hrefs =
|
|
497
|
+
const hrefs = ( (stepToExpand.description.map(
|
|
494
498
|
lt => ( (lt.nodes.filter((node) => typeof node !== 'string').map(node => node.href)))
|
|
495
|
-
))));
|
|
499
|
+
))).flat();
|
|
496
500
|
if (hrefs.length === 1) {
|
|
497
501
|
const href = hrefs[0];
|
|
498
502
|
if (href.startsWith('http')) {
|
|
@@ -526,9 +530,7 @@ let GettingStartedPage = class GettingStartedPage extends EditorPane {
|
|
|
526
530
|
};
|
|
527
531
|
if (serializedContextKeyExprs) {
|
|
528
532
|
const contextKeyExprs = coalesce(( (serializedContextKeyExprs.map(expr => ContextKeyExpr.deserialize(expr)))));
|
|
529
|
-
const watchingKeys = ( (new Set(
|
|
530
|
-
flatten(( (contextKeyExprs.map(expr => ( (expr.keys()))))))
|
|
531
|
-
)));
|
|
533
|
+
const watchingKeys = ( (new Set(contextKeyExprs.flatMap(expr => ( (expr.keys()))))));
|
|
532
534
|
this.stepDisposables.add(this.contextService.onDidChangeContext(e => {
|
|
533
535
|
if (e.affectsSome(watchingKeys)) {
|
|
534
536
|
postTrueKeysMessage();
|
|
@@ -574,7 +576,7 @@ let GettingStartedPage = class GettingStartedPage extends EditorPane {
|
|
|
574
576
|
const themeId = message.slice('setTheme:'.length);
|
|
575
577
|
const theme = (await this.themeService.getColorThemes()).find(theme => theme.settingsId === themeId);
|
|
576
578
|
if (theme) {
|
|
577
|
-
this.themeService.setColorTheme(theme.id,
|
|
579
|
+
this.themeService.setColorTheme(theme.id, ConfigurationTarget.USER);
|
|
578
580
|
}
|
|
579
581
|
}
|
|
580
582
|
else {
|
|
@@ -772,7 +774,7 @@ let GettingStartedPage = class GettingStartedPage extends EditorPane {
|
|
|
772
774
|
footer.appendChild(telemetryNotice);
|
|
773
775
|
}
|
|
774
776
|
else if (!this.productService.openToWelcomeMainPage && !someStepsComplete && !this.hasScrolledToFirstCategory && this.showFeaturedWalkthrough) {
|
|
775
|
-
const firstSessionDateString = this.storageService.get(firstSessionDateStorageKey,
|
|
777
|
+
const firstSessionDateString = this.storageService.get(firstSessionDateStorageKey, StorageScope.APPLICATION) || ( (new Date())).toUTCString();
|
|
776
778
|
const daysSinceFirstSession = ((+( (new Date()))) - (+( (new Date(firstSessionDateString))))) / 1000 / 60 / 60 / 24;
|
|
777
779
|
const fistContentBehaviour = daysSinceFirstSession < 1 ? 'openToFirstCategory' : 'index';
|
|
778
780
|
if (fistContentBehaviour === 'openToFirstCategory') {
|
|
@@ -795,10 +797,10 @@ let GettingStartedPage = class GettingStartedPage extends EditorPane {
|
|
|
795
797
|
let windowOpenable;
|
|
796
798
|
if (isRecentFolder(recent)) {
|
|
797
799
|
windowOpenable = { folderUri: recent.folderUri };
|
|
798
|
-
fullPath = recent.label || this.labelService.getWorkspaceLabel(recent.folderUri, { verbose:
|
|
800
|
+
fullPath = recent.label || this.labelService.getWorkspaceLabel(recent.folderUri, { verbose: Verbosity.LONG });
|
|
799
801
|
}
|
|
800
802
|
else {
|
|
801
|
-
fullPath = recent.label || this.labelService.getWorkspaceLabel(recent.workspace, { verbose:
|
|
803
|
+
fullPath = recent.label || this.labelService.getWorkspaceLabel(recent.workspace, { verbose: Verbosity.LONG });
|
|
802
804
|
windowOpenable = { workspaceUri: recent.workspace.configPath };
|
|
803
805
|
}
|
|
804
806
|
const { name, parentPath } = splitRecentLabel(fullPath);
|
|
@@ -1078,13 +1080,13 @@ let GettingStartedPage = class GettingStartedPage extends EditorPane {
|
|
|
1078
1080
|
return;
|
|
1079
1081
|
}
|
|
1080
1082
|
if (this.groupsService.count === 1) {
|
|
1081
|
-
const sideGroup = this.groupsService.addGroup(this.groupsService.groups[0],
|
|
1083
|
+
const sideGroup = this.groupsService.addGroup(this.groupsService.groups[0], GroupDirection.RIGHT);
|
|
1082
1084
|
this.groupsService.activateGroup(sideGroup);
|
|
1083
1085
|
const gettingStartedSize = Math.floor(fullSize.width / 2);
|
|
1084
|
-
const gettingStartedGroup = this.groupsService.getGroups(
|
|
1086
|
+
const gettingStartedGroup = this.groupsService.getGroups(GroupsOrder.MOST_RECENTLY_ACTIVE).find(group => (group.activeEditor instanceof GettingStartedInput));
|
|
1085
1087
|
this.groupsService.setSize(assertIsDefined(gettingStartedGroup), { width: gettingStartedSize, height: fullSize.height });
|
|
1086
1088
|
}
|
|
1087
|
-
const nonGettingStartedGroup = this.groupsService.getGroups(
|
|
1089
|
+
const nonGettingStartedGroup = this.groupsService.getGroups(GroupsOrder.MOST_RECENTLY_ACTIVE).find(group => !(group.activeEditor instanceof GettingStartedInput));
|
|
1088
1090
|
if (nonGettingStartedGroup) {
|
|
1089
1091
|
this.groupsService.activateGroup(nonGettingStartedGroup);
|
|
1090
1092
|
nonGettingStartedGroup.focus();
|
|
@@ -1122,7 +1124,7 @@ let GettingStartedPage = class GettingStartedPage extends EditorPane {
|
|
|
1122
1124
|
selectedStepIndex > -1 &&
|
|
1123
1125
|
this.currentWalkthrough?.steps.slice(selectedStepIndex + 1).some(step => !step.done)) {
|
|
1124
1126
|
const restoreData = { folder: UNKNOWN_EMPTY_WINDOW_WORKSPACE.id, category: this.editorInput.selectedCategory, step: this.editorInput.selectedStep };
|
|
1125
|
-
this.storageService.store(restoreWalkthroughsConfigurationKey, JSON.stringify(restoreData),
|
|
1127
|
+
this.storageService.store(restoreWalkthroughsConfigurationKey, JSON.stringify(restoreData), StorageScope.PROFILE, StorageTarget.MACHINE);
|
|
1126
1128
|
}
|
|
1127
1129
|
}
|
|
1128
1130
|
this.commandService.executeCommand(commandURI.path, ...args).then(result => {
|
|
@@ -1133,7 +1135,7 @@ let GettingStartedPage = class GettingStartedPage extends EditorPane {
|
|
|
1133
1135
|
return;
|
|
1134
1136
|
}
|
|
1135
1137
|
const restoreData = { folder: ( (toOpen.toString())), category: this.editorInput.selectedCategory, step: this.editorInput.selectedStep };
|
|
1136
|
-
this.storageService.store(restoreWalkthroughsConfigurationKey, JSON.stringify(restoreData),
|
|
1138
|
+
this.storageService.store(restoreWalkthroughsConfigurationKey, JSON.stringify(restoreData), StorageScope.PROFILE, StorageTarget.MACHINE);
|
|
1137
1139
|
this.hostService.openWindow([{ folderUri: toOpen }]);
|
|
1138
1140
|
}
|
|
1139
1141
|
});
|
|
@@ -1220,13 +1222,13 @@ let GettingStartedPage = class GettingStartedPage extends EditorPane {
|
|
|
1220
1222
|
this.detailsPageDisposables.add(addDisposableListener(stepListContainer, 'keydown', (e) => {
|
|
1221
1223
|
const event = ( (new StandardKeyboardEvent(e)));
|
|
1222
1224
|
const currentStepIndex = () => category.steps.findIndex(e => e.id === this.editorInput.selectedStep);
|
|
1223
|
-
if (event.keyCode ===
|
|
1225
|
+
if (event.keyCode === KeyCode.UpArrow) {
|
|
1224
1226
|
const toExpand = category.steps.filter((step, index) => index < currentStepIndex() && this.contextService.contextMatchesRules(step.when));
|
|
1225
1227
|
if (toExpand.length) {
|
|
1226
1228
|
this.selectStep(toExpand[toExpand.length - 1].id, false);
|
|
1227
1229
|
}
|
|
1228
1230
|
}
|
|
1229
|
-
if (event.keyCode ===
|
|
1231
|
+
if (event.keyCode === KeyCode.DownArrow) {
|
|
1230
1232
|
const toExpand = category.steps.find((step, index) => index > currentStepIndex() && this.contextService.contextMatchesRules(step.when));
|
|
1231
1233
|
if (toExpand) {
|
|
1232
1234
|
this.selectStep(toExpand.id, false);
|
|
@@ -1284,7 +1286,7 @@ let GettingStartedPage = class GettingStartedPage extends EditorPane {
|
|
|
1284
1286
|
this.detailsScrollbar = this._register(( (new DomScrollableElement(stepsContainer, { className: 'steps-container' }))));
|
|
1285
1287
|
const stepListComponent = this.detailsScrollbar.getDomNode();
|
|
1286
1288
|
const categoryFooter = $('.getting-started-footer');
|
|
1287
|
-
if (this.editorInput.showTelemetryNotice && getTelemetryLevel(this.configurationService) !==
|
|
1289
|
+
if (this.editorInput.showTelemetryNotice && getTelemetryLevel(this.configurationService) !== TelemetryLevel.NONE && this.productService.enableTelemetry) {
|
|
1288
1290
|
this.buildTelemetryFooter(categoryFooter);
|
|
1289
1291
|
}
|
|
1290
1292
|
reset(this.stepsContent, categoryDescriptorComponent, stepListComponent, this.stepMediaComponent, categoryFooter);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { localize2WithPath } from 'vscode/vscode/vs/nls';
|
|
2
2
|
import { registerAction2, Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
3
|
+
import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
3
4
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
|
|
4
5
|
import { Memento } from 'vscode/vscode/vs/workbench/common/memento';
|
|
5
6
|
import { hiddenEntriesConfigurationKey, walkthroughMetadataConfigurationKey } from './gettingStartedService.js';
|
|
@@ -25,10 +26,10 @@ registerAction2(class extends Action2 {
|
|
|
25
26
|
run(accessor) {
|
|
26
27
|
const gettingStartedService = accessor.get(IWalkthroughsService);
|
|
27
28
|
const storageService = accessor.get(IStorageService);
|
|
28
|
-
storageService.store(hiddenEntriesConfigurationKey, JSON.stringify([]),
|
|
29
|
-
storageService.store(walkthroughMetadataConfigurationKey, JSON.stringify([]),
|
|
29
|
+
storageService.store(hiddenEntriesConfigurationKey, JSON.stringify([]), StorageScope.PROFILE, StorageTarget.USER);
|
|
30
|
+
storageService.store(walkthroughMetadataConfigurationKey, JSON.stringify([]), StorageScope.PROFILE, StorageTarget.USER);
|
|
30
31
|
const memento = ( (new Memento('gettingStartedService', accessor.get(IStorageService))));
|
|
31
|
-
const record = memento.getMemento(
|
|
32
|
+
const record = memento.getMemento(StorageScope.PROFILE, StorageTarget.USER);
|
|
32
33
|
for (const key in record) {
|
|
33
34
|
if (Object.prototype.hasOwnProperty.call(record, key)) {
|
|
34
35
|
try {
|
package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
2
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
3
3
|
import { Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
4
|
+
import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
4
5
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
|
|
5
6
|
import { Memento } from 'vscode/vscode/vs/workbench/common/memento';
|
|
6
7
|
import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands.service';
|
|
@@ -19,8 +20,9 @@ import { IHostService } from 'vscode/vscode/vs/workbench/services/host/browser/h
|
|
|
19
20
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
20
21
|
import { parseLinkedText } from 'vscode/vscode/vs/base/common/linkedText';
|
|
21
22
|
import { walkthroughsExtensionPoint } from './gettingStartedExtensionPoint.js';
|
|
23
|
+
import 'vscode/vscode/vs/platform/instantiation/common/extensions';
|
|
22
24
|
import { dirname } from 'vscode/vscode/vs/base/common/path';
|
|
23
|
-
import { coalesce
|
|
25
|
+
import { coalesce } from 'vscode/vscode/vs/base/common/arrays';
|
|
24
26
|
import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService.service';
|
|
25
27
|
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
26
28
|
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
@@ -68,10 +70,10 @@ let WalkthroughsService = class WalkthroughsService extends Disposable {
|
|
|
68
70
|
this.stepCompletionContextKeyExpressions = ( (new Set()));
|
|
69
71
|
this.stepCompletionContextKeys = ( (new Set()));
|
|
70
72
|
this.metadata = ( (new Map(
|
|
71
|
-
JSON.parse(this.storageService.get(walkthroughMetadataConfigurationKey,
|
|
73
|
+
JSON.parse(this.storageService.get(walkthroughMetadataConfigurationKey, StorageScope.PROFILE, '[]'))
|
|
72
74
|
)));
|
|
73
75
|
this.memento = ( (new Memento('gettingStartedService', this.storageService)));
|
|
74
|
-
this.stepProgress = this.memento.getMemento(
|
|
76
|
+
this.stepProgress = this.memento.getMemento(StorageScope.PROFILE, StorageTarget.USER);
|
|
75
77
|
this.initCompletionEventListeners();
|
|
76
78
|
HasMultipleNewFileEntries.bindTo(this.contextService).set(false);
|
|
77
79
|
this.registerWalkthroughs();
|
|
@@ -164,7 +166,7 @@ let WalkthroughsService = class WalkthroughsService extends Disposable {
|
|
|
164
166
|
if (prior && walkthrough) {
|
|
165
167
|
this.metadata.set(id, { ...prior, manaullyOpened: true, stepIDs: ( (walkthrough.steps.map(s => s.id))) });
|
|
166
168
|
}
|
|
167
|
-
this.storageService.store(walkthroughMetadataConfigurationKey, JSON.stringify([...this.metadata.entries()]),
|
|
169
|
+
this.storageService.store(walkthroughMetadataConfigurationKey, JSON.stringify([...this.metadata.entries()]), StorageScope.PROFILE, StorageTarget.USER);
|
|
168
170
|
}
|
|
169
171
|
async registerExtensionWalkthroughContributions(extension) {
|
|
170
172
|
const convertExtensionPathToFileURI = (path) => path.startsWith('https://')
|
|
@@ -280,7 +282,7 @@ let WalkthroughsService = class WalkthroughsService extends Disposable {
|
|
|
280
282
|
this._registerWalkthrough(walkthoughDescriptor);
|
|
281
283
|
this._onDidAddWalkthrough.fire(this.resolveWalkthrough(walkthoughDescriptor));
|
|
282
284
|
}));
|
|
283
|
-
this.storageService.store(walkthroughMetadataConfigurationKey, JSON.stringify([...this.metadata.entries()]),
|
|
285
|
+
this.storageService.store(walkthroughMetadataConfigurationKey, JSON.stringify([...this.metadata.entries()]), StorageScope.PROFILE, StorageTarget.USER);
|
|
284
286
|
if (sectionToOpen && this.configurationService.getValue('workbench.welcomePage.walkthroughs.openOnInstall')) {
|
|
285
287
|
this.telemetryService.publicLog2('gettingStarted.didAutoOpenWalkthrough', { id: sectionToOpen });
|
|
286
288
|
this.commandService.executeCommand('workbench.action.openWalkthrough', sectionToOpen, true);
|
|
@@ -410,9 +412,9 @@ let WalkthroughsService = class WalkthroughsService extends Disposable {
|
|
|
410
412
|
return;
|
|
411
413
|
}
|
|
412
414
|
if (!step.completionEvents.length) {
|
|
413
|
-
step.completionEvents = coalesce(
|
|
415
|
+
step.completionEvents = coalesce(step.description
|
|
414
416
|
.filter(linkedText => linkedText.nodes.length === 1)
|
|
415
|
-
.
|
|
417
|
+
.flatMap(linkedText => ( (linkedText.nodes
|
|
416
418
|
.filter(((node) => typeof node !== 'string'))
|
|
417
419
|
.map(({ href }) => {
|
|
418
420
|
if (href.startsWith('command:')) {
|
|
@@ -422,7 +424,7 @@ let WalkthroughsService = class WalkthroughsService extends Disposable {
|
|
|
422
424
|
return 'onLink:' + href;
|
|
423
425
|
}
|
|
424
426
|
return undefined;
|
|
425
|
-
})))))
|
|
427
|
+
})))));
|
|
426
428
|
}
|
|
427
429
|
if (!step.completionEvents.length) {
|
|
428
430
|
step.completionEvents.push('stepSelected');
|
|
@@ -4,24 +4,28 @@ import { coalesce } from 'vscode/vscode/vs/base/common/arrays';
|
|
|
4
4
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
5
5
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
6
6
|
import { onUnexpectedError } from 'vscode/vscode/vs/base/common/errors';
|
|
7
|
-
import { UNKNOWN_EMPTY_WINDOW_WORKSPACE } from 'vscode/vscode/vs/platform/workspace/common/workspace';
|
|
7
|
+
import { UNKNOWN_EMPTY_WINDOW_WORKSPACE, WorkbenchState } from 'vscode/vscode/vs/platform/workspace/common/workspace';
|
|
8
8
|
import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace.service';
|
|
9
9
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
10
10
|
import { IWorkingCopyBackupService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyBackup.service';
|
|
11
|
+
import { LifecyclePhase, StartupKind } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
|
|
11
12
|
import { ILifecycleService } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle.service';
|
|
12
13
|
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
|
|
13
14
|
import { joinPath } from 'vscode/vscode/vs/base/common/resources';
|
|
14
15
|
import { IWorkbenchLayoutService } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService.service';
|
|
15
16
|
import { GettingStartedInput, gettingStartedInputTypeId } from './gettingStartedInput.js';
|
|
16
17
|
import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService.service';
|
|
18
|
+
import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
17
19
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
|
|
18
20
|
import { getTelemetryLevel } from 'vscode/vscode/vs/platform/telemetry/common/telemetryUtils';
|
|
21
|
+
import { TelemetryLevel } from 'vscode/vscode/vs/platform/telemetry/common/telemetry';
|
|
19
22
|
import { IProductService } from 'vscode/vscode/vs/platform/product/common/productService.service';
|
|
20
23
|
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
|
|
21
24
|
import { INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification.service';
|
|
22
25
|
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
23
26
|
import { RegisteredEditorPriority } from 'vscode/vscode/vs/workbench/services/editor/common/editorResolverService';
|
|
24
27
|
import { IEditorResolverService } from 'vscode/vscode/vs/workbench/services/editor/common/editorResolverService.service';
|
|
28
|
+
import { TerminalCommandId } from 'vscode/vscode/vs/workbench/contrib/terminal/common/terminal';
|
|
25
29
|
|
|
26
30
|
const _moduleId = "vs/workbench/contrib/welcomeGettingStarted/browser/startupPage";
|
|
27
31
|
const restoreWalkthroughsConfigurationKey = 'workbench.welcomePage.restorableWalkthroughs';
|
|
@@ -75,13 +79,13 @@ let StartupPageRunnerContribution = class StartupPageRunnerContribution {
|
|
|
75
79
|
this.run().then(undefined, onUnexpectedError);
|
|
76
80
|
}
|
|
77
81
|
async run() {
|
|
78
|
-
await this.lifecycleService.when(
|
|
82
|
+
await this.lifecycleService.when(LifecyclePhase.Restored);
|
|
79
83
|
if (this.productService.enableTelemetry
|
|
80
84
|
&& this.productService.showTelemetryOptOut
|
|
81
|
-
&& getTelemetryLevel(this.configurationService) !==
|
|
85
|
+
&& getTelemetryLevel(this.configurationService) !== TelemetryLevel.NONE
|
|
82
86
|
&& !this.environmentService.skipWelcome
|
|
83
|
-
&& !this.storageService.get(telemetryOptOutStorageKey,
|
|
84
|
-
this.storageService.store(telemetryOptOutStorageKey, true,
|
|
87
|
+
&& !this.storageService.get(telemetryOptOutStorageKey, StorageScope.PROFILE)) {
|
|
88
|
+
this.storageService.store(telemetryOptOutStorageKey, true, StorageScope.PROFILE, StorageTarget.USER);
|
|
85
89
|
await this.openGettingStarted(true);
|
|
86
90
|
return;
|
|
87
91
|
}
|
|
@@ -89,7 +93,7 @@ let StartupPageRunnerContribution = class StartupPageRunnerContribution {
|
|
|
89
93
|
return;
|
|
90
94
|
}
|
|
91
95
|
const enabled = isStartupPageEnabled(this.configurationService, this.contextService, this.environmentService);
|
|
92
|
-
if (enabled && this.lifecycleService.startupKind !==
|
|
96
|
+
if (enabled && this.lifecycleService.startupKind !== StartupKind.ReloadedWindow) {
|
|
93
97
|
const hasBackups = await this.workingCopyBackupService.hasBackups();
|
|
94
98
|
if (hasBackups) {
|
|
95
99
|
return;
|
|
@@ -110,13 +114,13 @@ let StartupPageRunnerContribution = class StartupPageRunnerContribution {
|
|
|
110
114
|
await this.openGettingStarted();
|
|
111
115
|
}
|
|
112
116
|
else if (startupEditorSetting.value === 'terminal') {
|
|
113
|
-
this.commandService.executeCommand(
|
|
117
|
+
this.commandService.executeCommand(TerminalCommandId.CreateTerminalEditor);
|
|
114
118
|
}
|
|
115
119
|
}
|
|
116
120
|
}
|
|
117
121
|
}
|
|
118
122
|
tryOpenWalkthroughForFolder() {
|
|
119
|
-
const toRestore = this.storageService.get(restoreWalkthroughsConfigurationKey,
|
|
123
|
+
const toRestore = this.storageService.get(restoreWalkthroughsConfigurationKey, StorageScope.PROFILE);
|
|
120
124
|
if (!toRestore) {
|
|
121
125
|
return false;
|
|
122
126
|
}
|
|
@@ -124,11 +128,12 @@ let StartupPageRunnerContribution = class StartupPageRunnerContribution {
|
|
|
124
128
|
const restoreData = JSON.parse(toRestore);
|
|
125
129
|
const currentWorkspace = this.contextService.getWorkspace();
|
|
126
130
|
if (restoreData.folder === UNKNOWN_EMPTY_WINDOW_WORKSPACE.id || restoreData.folder === ( (currentWorkspace.folders[0].uri.toString()))) {
|
|
131
|
+
const options = { selectedCategory: restoreData.category, selectedStep: restoreData.step, pinned: false };
|
|
127
132
|
this.editorService.openEditor({
|
|
128
133
|
resource: GettingStartedInput.RESOURCE,
|
|
129
|
-
options
|
|
134
|
+
options
|
|
130
135
|
});
|
|
131
|
-
this.storageService.remove(restoreWalkthroughsConfigurationKey,
|
|
136
|
+
this.storageService.remove(restoreWalkthroughsConfigurationKey, StorageScope.PROFILE);
|
|
132
137
|
return true;
|
|
133
138
|
}
|
|
134
139
|
}
|
|
@@ -173,11 +178,11 @@ let StartupPageRunnerContribution = class StartupPageRunnerContribution {
|
|
|
173
178
|
if (editor?.typeId === startupEditorTypeID || ( (this.editorService.editors.some(e => e.typeId === startupEditorTypeID)))) {
|
|
174
179
|
return;
|
|
175
180
|
}
|
|
176
|
-
const options = editor ? { pinned: false, index: 0 } : { pinned: false };
|
|
181
|
+
const options = editor ? { pinned: false, index: 0, showTelemetryNotice } : { pinned: false, showTelemetryNotice };
|
|
177
182
|
{
|
|
178
183
|
this.editorService.openEditor({
|
|
179
184
|
resource: GettingStartedInput.RESOURCE,
|
|
180
|
-
options
|
|
185
|
+
options,
|
|
181
186
|
});
|
|
182
187
|
}
|
|
183
188
|
}
|
|
@@ -210,7 +215,7 @@ function isStartupPageEnabled(configurationService, contextService, environmentS
|
|
|
210
215
|
}
|
|
211
216
|
return startupEditor.value === 'welcomePage'
|
|
212
217
|
|| startupEditor.value === 'readme' && (startupEditor.userValue === 'readme' || startupEditor.defaultValue === 'readme')
|
|
213
|
-
|| (contextService.getWorkbenchState() ===
|
|
218
|
+
|| (contextService.getWorkbenchState() === WorkbenchState.EMPTY && startupEditor.value === 'welcomePageInEmptyWorkbench')
|
|
214
219
|
|| startupEditor.value === 'terminal';
|
|
215
220
|
}
|
|
216
221
|
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
2
2
|
import { WALK_THROUGH_FOCUS, WalkThroughPart } from './walkThroughPart.js';
|
|
3
|
+
import { KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
|
|
3
4
|
import { EditorContextKeys } from 'vscode/vscode/vs/editor/common/editorContextKeys';
|
|
4
5
|
import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
6
|
+
import { KeyCode } from 'vscode/vscode/vs/base/common/keyCodes';
|
|
5
7
|
|
|
6
8
|
const WalkThroughArrowUp = {
|
|
7
9
|
id: 'workbench.action.interactivePlayground.arrowUp',
|
|
8
|
-
weight:
|
|
10
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
9
11
|
when: ( ContextKeyExpr.and(WALK_THROUGH_FOCUS, ( EditorContextKeys.editorTextFocus.toNegated()))),
|
|
10
|
-
primary:
|
|
12
|
+
primary: KeyCode.UpArrow,
|
|
11
13
|
handler: accessor => {
|
|
12
14
|
const editorService = accessor.get(IEditorService);
|
|
13
15
|
const activeEditorPane = editorService.activeEditorPane;
|
|
@@ -18,9 +20,9 @@ const WalkThroughArrowUp = {
|
|
|
18
20
|
};
|
|
19
21
|
const WalkThroughArrowDown = {
|
|
20
22
|
id: 'workbench.action.interactivePlayground.arrowDown',
|
|
21
|
-
weight:
|
|
23
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
22
24
|
when: ( ContextKeyExpr.and(WALK_THROUGH_FOCUS, ( EditorContextKeys.editorTextFocus.toNegated()))),
|
|
23
|
-
primary:
|
|
25
|
+
primary: KeyCode.DownArrow,
|
|
24
26
|
handler: accessor => {
|
|
25
27
|
const editorService = accessor.get(IEditorService);
|
|
26
28
|
const activeEditorPane = editorService.activeEditorPane;
|
|
@@ -31,9 +33,9 @@ const WalkThroughArrowDown = {
|
|
|
31
33
|
};
|
|
32
34
|
const WalkThroughPageUp = {
|
|
33
35
|
id: 'workbench.action.interactivePlayground.pageUp',
|
|
34
|
-
weight:
|
|
36
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
35
37
|
when: ( ContextKeyExpr.and(WALK_THROUGH_FOCUS, ( EditorContextKeys.editorTextFocus.toNegated()))),
|
|
36
|
-
primary:
|
|
38
|
+
primary: KeyCode.PageUp,
|
|
37
39
|
handler: accessor => {
|
|
38
40
|
const editorService = accessor.get(IEditorService);
|
|
39
41
|
const activeEditorPane = editorService.activeEditorPane;
|
|
@@ -44,9 +46,9 @@ const WalkThroughPageUp = {
|
|
|
44
46
|
};
|
|
45
47
|
const WalkThroughPageDown = {
|
|
46
48
|
id: 'workbench.action.interactivePlayground.pageDown',
|
|
47
|
-
weight:
|
|
49
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
48
50
|
when: ( ContextKeyExpr.and(WALK_THROUGH_FOCUS, ( EditorContextKeys.editorTextFocus.toNegated()))),
|
|
49
|
-
primary:
|
|
51
|
+
primary: KeyCode.PageDown,
|
|
50
52
|
handler: accessor => {
|
|
51
53
|
const editorService = accessor.get(IEditorService);
|
|
52
54
|
const activeEditorPane = editorService.activeEditorPane;
|
|
@@ -5,6 +5,7 @@ import { ITextModelService } from 'vscode/vscode/vs/editor/common/services/resol
|
|
|
5
5
|
import marked_1 from 'vscode/external/vscode-marked/lib/marked.esm.js';
|
|
6
6
|
import { isEqual } from 'vscode/vscode/vs/base/common/resources';
|
|
7
7
|
import { requireToContent } from '../common/walkThroughContentProvider.js';
|
|
8
|
+
import { EditorInputCapabilities } from 'vscode/vscode/vs/workbench/common/editor';
|
|
8
9
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
9
10
|
import { Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
10
11
|
|
|
@@ -28,7 +29,7 @@ class WalkThroughModel extends EditorModel {
|
|
|
28
29
|
}
|
|
29
30
|
let WalkThroughInput = WalkThroughInput_1 = class WalkThroughInput extends EditorInput {
|
|
30
31
|
get capabilities() {
|
|
31
|
-
return
|
|
32
|
+
return EditorInputCapabilities.Singleton | super.capabilities;
|
|
32
33
|
}
|
|
33
34
|
get resource() { return this.options.resource; }
|
|
34
35
|
constructor(options, instantiationService, textModelResolverService) {
|
|
@@ -3,6 +3,7 @@ import '../common/walkThroughUtils.js';
|
|
|
3
3
|
import './media/walkThroughPart.css.js';
|
|
4
4
|
import { DomScrollableElement } from 'vscode/vscode/vs/base/browser/ui/scrollbar/scrollableElement';
|
|
5
5
|
import { Gesture, EventType } from 'vscode/vscode/vs/base/browser/touch';
|
|
6
|
+
import { ScrollbarVisibility } from 'vscode/vscode/vs/base/common/scrollable';
|
|
6
7
|
import { escape } from 'vscode/vscode/vs/base/common/strings';
|
|
7
8
|
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
8
9
|
import { DisposableStore, toDisposable, dispose } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
@@ -21,12 +22,13 @@ import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/
|
|
|
21
22
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
22
23
|
import { isObject } from 'vscode/vscode/vs/base/common/types';
|
|
23
24
|
import { CommandsRegistry } from 'vscode/vscode/vs/platform/commands/common/commands';
|
|
25
|
+
import { EditorOption } from 'vscode/vscode/vs/editor/common/config/editorOptions';
|
|
24
26
|
import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService.service';
|
|
25
27
|
import { UILabelProvider } from 'vscode/vscode/vs/base/common/keybindingLabels';
|
|
26
|
-
import { OS } from 'vscode/vscode/vs/base/common/platform';
|
|
28
|
+
import { OS, OperatingSystem } from 'vscode/vscode/vs/base/common/platform';
|
|
27
29
|
import { deepClone } from 'vscode/vscode/vs/base/common/objects';
|
|
28
30
|
import { INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification.service';
|
|
29
|
-
import { size, safeInnerHtml, addDisposableListener } from 'vscode/vscode/vs/base/browser/dom';
|
|
31
|
+
import { isHTMLElement, isHTMLAnchorElement, isHTMLButtonElement, size, safeInnerHtml, addDisposableListener } from 'vscode/vscode/vs/base/browser/dom';
|
|
30
32
|
import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
31
33
|
import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
32
34
|
|
|
@@ -58,8 +60,8 @@ let WalkThroughPart = class WalkThroughPart extends EditorPane {
|
|
|
58
60
|
this.content.tabIndex = 0;
|
|
59
61
|
this.content.style.outlineStyle = 'none';
|
|
60
62
|
this.scrollbar = ( (new DomScrollableElement(this.content, {
|
|
61
|
-
horizontal:
|
|
62
|
-
vertical:
|
|
63
|
+
horizontal: ScrollbarVisibility.Auto,
|
|
64
|
+
vertical: ScrollbarVisibility.Auto
|
|
63
65
|
})));
|
|
64
66
|
this.disposables.add(this.scrollbar);
|
|
65
67
|
container.appendChild(this.scrollbar.getDomNode());
|
|
@@ -98,12 +100,12 @@ let WalkThroughPart = class WalkThroughPart extends EditorPane {
|
|
|
98
100
|
this.editorFocus.reset();
|
|
99
101
|
}));
|
|
100
102
|
this.disposables.add(this.addEventListener(this.content, 'focusin', (e) => {
|
|
101
|
-
if (e.target
|
|
103
|
+
if (isHTMLElement(e.target) && e.target.classList.contains('zone-widget-container')) {
|
|
102
104
|
const scrollPosition = this.scrollbar.getScrollPosition();
|
|
103
105
|
this.content.scrollTop = scrollPosition.scrollTop;
|
|
104
106
|
this.content.scrollLeft = scrollPosition.scrollLeft;
|
|
105
107
|
}
|
|
106
|
-
if (e.target
|
|
108
|
+
if (isHTMLElement(e.target)) {
|
|
107
109
|
this.lastFocus = e.target;
|
|
108
110
|
}
|
|
109
111
|
}));
|
|
@@ -111,7 +113,7 @@ let WalkThroughPart = class WalkThroughPart extends EditorPane {
|
|
|
111
113
|
registerClickHandler() {
|
|
112
114
|
this.content.addEventListener('click', event => {
|
|
113
115
|
for (let node = event.target; node; node = node.parentNode) {
|
|
114
|
-
if (node
|
|
116
|
+
if (isHTMLAnchorElement(node) && node.href) {
|
|
115
117
|
const baseElement = node.ownerDocument.getElementsByTagName('base')[0] || this.window.location;
|
|
116
118
|
if (baseElement && node.href.indexOf(baseElement.href) >= 0 && node.hash) {
|
|
117
119
|
const scrollTarget = this.content.querySelector(node.hash);
|
|
@@ -128,7 +130,7 @@ let WalkThroughPart = class WalkThroughPart extends EditorPane {
|
|
|
128
130
|
event.preventDefault();
|
|
129
131
|
break;
|
|
130
132
|
}
|
|
131
|
-
else if (node
|
|
133
|
+
else if (isHTMLButtonElement(node)) {
|
|
132
134
|
const href = node.getAttribute('data-href');
|
|
133
135
|
if (href) {
|
|
134
136
|
this.open(( (URI.parse(href))));
|
|
@@ -263,7 +265,7 @@ let WalkThroughPart = class WalkThroughPart extends EditorPane {
|
|
|
263
265
|
editor.setModel(model);
|
|
264
266
|
this.contentDisposables.push(editor);
|
|
265
267
|
const updateHeight = (initial) => {
|
|
266
|
-
const lineHeight = editor.getOption(
|
|
268
|
+
const lineHeight = editor.getOption(EditorOption.lineHeight);
|
|
267
269
|
const height = `${Math.max(model.getLineCount() + 1, 4) * lineHeight}px`;
|
|
268
270
|
if (div.style.height !== height) {
|
|
269
271
|
div.style.height = height;
|
|
@@ -280,7 +282,7 @@ let WalkThroughPart = class WalkThroughPart extends EditorPane {
|
|
|
280
282
|
if (innerContent) {
|
|
281
283
|
const targetTop = div.getBoundingClientRect().top;
|
|
282
284
|
const containerTop = innerContent.getBoundingClientRect().top;
|
|
283
|
-
const lineHeight = editor.getOption(
|
|
285
|
+
const lineHeight = editor.getOption(EditorOption.lineHeight);
|
|
284
286
|
const lineTop = (targetTop + (e.position.lineNumber - 1) * lineHeight) - containerTop;
|
|
285
287
|
const lineBottom = lineTop + lineHeight;
|
|
286
288
|
const scrollDimensions = this.scrollbar.getScrollDimensions();
|
|
@@ -363,7 +365,7 @@ let WalkThroughPart = class WalkThroughPart extends EditorPane {
|
|
|
363
365
|
multiCursorModifier() {
|
|
364
366
|
const labels = UILabelProvider.modifierLabels[OS];
|
|
365
367
|
const value = this.configurationService.getValue('editor.multiCursorModifier');
|
|
366
|
-
const modifier = labels[value === 'ctrlCmd' ? (OS ===
|
|
368
|
+
const modifier = labels[value === 'ctrlCmd' ? (OS === OperatingSystem.Macintosh ? 'metaKey' : 'ctrlKey') : 'altKey'];
|
|
367
369
|
const keys = this.content.querySelectorAll('.multi-cursor-modifier');
|
|
368
370
|
Array.prototype.forEach.call(keys, (key) => {
|
|
369
371
|
while (key.firstChild) {
|
package/vscode/src/vs/workbench/contrib/welcomeWalkthrough/common/walkThroughContentProvider.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
2
|
import { ITextModelService } from 'vscode/vscode/vs/editor/common/services/resolverService';
|
|
3
3
|
import { IModelService } from 'vscode/vscode/vs/editor/common/services/model';
|
|
4
|
+
import { DefaultEndOfLine, EndOfLinePreference } from 'vscode/vscode/vs/editor/common/model';
|
|
4
5
|
import { ILanguageService } from 'vscode/vscode/vs/editor/common/languages/language';
|
|
5
6
|
import marked_1 from 'vscode/external/vscode-marked/lib/marked.esm.js';
|
|
6
7
|
import { FileAccess, Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
@@ -57,10 +58,10 @@ let WalkThroughSnippetContentProvider = class WalkThroughSnippetContentProvider
|
|
|
57
58
|
}
|
|
58
59
|
return '';
|
|
59
60
|
};
|
|
60
|
-
const textBuffer = factory.create(
|
|
61
|
+
const textBuffer = factory.create(DefaultEndOfLine.LF).textBuffer;
|
|
61
62
|
const lineCount = textBuffer.getLineCount();
|
|
62
63
|
const range = ( new Range(1, 1, lineCount, textBuffer.getLineLength(lineCount) + 1));
|
|
63
|
-
const markdown = textBuffer.getValueInRange(range,
|
|
64
|
+
const markdown = textBuffer.getValueInRange(range, EndOfLinePreference.TextDefined);
|
|
64
65
|
marked_1(markdown, { renderer });
|
|
65
66
|
}
|
|
66
67
|
return assertIsDefined(codeEditorModel);
|