@codingame/monaco-vscode-update-service-override 3.2.3 → 4.1.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/update.js +1 -1
- package/external/rollup-plugin-styles/dist/runtime/inject-css.js +0 -3
- package/external/tslib/tslib.es6.js +0 -11
- package/override/vs/platform/dialogs/common/dialogs.js +0 -8
- package/vscode/src/vs/platform/update/common/update.config.contribution.js +0 -99
- package/vscode/src/vs/workbench/contrib/markdown/browser/markdownSettingRenderer.js +0 -350
- package/vscode/src/vs/workbench/contrib/update/browser/media/releasenoteseditor.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/update/browser/releaseNotesEditor.js +0 -520
- package/vscode/src/vs/workbench/contrib/update/browser/update.contribution.js +0 -254
- package/vscode/src/vs/workbench/contrib/update/browser/update.js +0 -656
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-update-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -18,6 +18,6 @@
|
|
|
18
18
|
"module": "index.js",
|
|
19
19
|
"types": "index.d.ts",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"vscode": "npm:@codingame/monaco-vscode-api@
|
|
21
|
+
"vscode": "npm:@codingame/monaco-vscode-api@4.1.0"
|
|
22
22
|
}
|
|
23
23
|
}
|
package/update.js
CHANGED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=( Object.keys(r.attributes)),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
|
|
2
|
-
|
|
3
|
-
export { n as default };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
function __decorate(decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
}
|
|
7
|
-
function __param(paramIndex, decorator) {
|
|
8
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export { __decorate, __param };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
var ConfirmResult;
|
|
2
|
-
( (function(ConfirmResult) {
|
|
3
|
-
ConfirmResult[ConfirmResult["SAVE"] = 0] = "SAVE";
|
|
4
|
-
ConfirmResult[ConfirmResult["DONT_SAVE"] = 1] = "DONT_SAVE";
|
|
5
|
-
ConfirmResult[ConfirmResult["CANCEL"] = 2] = "CANCEL";
|
|
6
|
-
})(ConfirmResult || (ConfirmResult = {})));
|
|
7
|
-
|
|
8
|
-
export { ConfirmResult };
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { isWindows, isWeb } from 'vscode/vscode/vs/base/common/platform';
|
|
2
|
-
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
3
|
-
import { Extensions } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
4
|
-
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
5
|
-
|
|
6
|
-
const configurationRegistry = ( Registry.as(Extensions.Configuration));
|
|
7
|
-
configurationRegistry.registerConfiguration({
|
|
8
|
-
id: 'update',
|
|
9
|
-
order: 15,
|
|
10
|
-
title: ( localizeWithPath(
|
|
11
|
-
'vs/platform/update/common/update.config.contribution',
|
|
12
|
-
'updateConfigurationTitle',
|
|
13
|
-
"Update"
|
|
14
|
-
)),
|
|
15
|
-
type: 'object',
|
|
16
|
-
properties: {
|
|
17
|
-
'update.mode': {
|
|
18
|
-
type: 'string',
|
|
19
|
-
enum: ['none', 'manual', 'start', 'default'],
|
|
20
|
-
default: 'default',
|
|
21
|
-
scope: 1 ,
|
|
22
|
-
description: ( localizeWithPath(
|
|
23
|
-
'vs/platform/update/common/update.config.contribution',
|
|
24
|
-
'updateMode',
|
|
25
|
-
"Configure whether you receive automatic updates. Requires a restart after change. The updates are fetched from a Microsoft online service."
|
|
26
|
-
)),
|
|
27
|
-
tags: ['usesOnlineServices'],
|
|
28
|
-
enumDescriptions: [
|
|
29
|
-
( localizeWithPath(
|
|
30
|
-
'vs/platform/update/common/update.config.contribution',
|
|
31
|
-
'none',
|
|
32
|
-
"Disable updates."
|
|
33
|
-
)),
|
|
34
|
-
( localizeWithPath(
|
|
35
|
-
'vs/platform/update/common/update.config.contribution',
|
|
36
|
-
'manual',
|
|
37
|
-
"Disable automatic background update checks. Updates will be available if you manually check for updates."
|
|
38
|
-
)),
|
|
39
|
-
( localizeWithPath(
|
|
40
|
-
'vs/platform/update/common/update.config.contribution',
|
|
41
|
-
'start',
|
|
42
|
-
"Check for updates only on startup. Disable automatic background update checks."
|
|
43
|
-
)),
|
|
44
|
-
( localizeWithPath(
|
|
45
|
-
'vs/platform/update/common/update.config.contribution',
|
|
46
|
-
'default',
|
|
47
|
-
"Enable automatic update checks. Code will check for updates automatically and periodically."
|
|
48
|
-
))
|
|
49
|
-
],
|
|
50
|
-
policy: {
|
|
51
|
-
name: 'UpdateMode',
|
|
52
|
-
minimumVersion: '1.67',
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
'update.channel': {
|
|
56
|
-
type: 'string',
|
|
57
|
-
default: 'default',
|
|
58
|
-
scope: 1 ,
|
|
59
|
-
description: ( localizeWithPath(
|
|
60
|
-
'vs/platform/update/common/update.config.contribution',
|
|
61
|
-
'updateMode',
|
|
62
|
-
"Configure whether you receive automatic updates. Requires a restart after change. The updates are fetched from a Microsoft online service."
|
|
63
|
-
)),
|
|
64
|
-
deprecationMessage: ( localizeWithPath(
|
|
65
|
-
'vs/platform/update/common/update.config.contribution',
|
|
66
|
-
'deprecated',
|
|
67
|
-
"This setting is deprecated, please use '{0}' instead.",
|
|
68
|
-
'update.mode'
|
|
69
|
-
))
|
|
70
|
-
},
|
|
71
|
-
'update.enableWindowsBackgroundUpdates': {
|
|
72
|
-
type: 'boolean',
|
|
73
|
-
default: true,
|
|
74
|
-
scope: 1 ,
|
|
75
|
-
title: ( localizeWithPath(
|
|
76
|
-
'vs/platform/update/common/update.config.contribution',
|
|
77
|
-
'enableWindowsBackgroundUpdatesTitle',
|
|
78
|
-
"Enable Background Updates on Windows"
|
|
79
|
-
)),
|
|
80
|
-
description: ( localizeWithPath(
|
|
81
|
-
'vs/platform/update/common/update.config.contribution',
|
|
82
|
-
'enableWindowsBackgroundUpdates',
|
|
83
|
-
"Enable to download and install new VS Code versions in the background on Windows."
|
|
84
|
-
)),
|
|
85
|
-
included: isWindows && !isWeb
|
|
86
|
-
},
|
|
87
|
-
'update.showReleaseNotes': {
|
|
88
|
-
type: 'boolean',
|
|
89
|
-
default: true,
|
|
90
|
-
scope: 1 ,
|
|
91
|
-
description: ( localizeWithPath(
|
|
92
|
-
'vs/platform/update/common/update.config.contribution',
|
|
93
|
-
'showReleaseNotes',
|
|
94
|
-
"Show Release Notes after an update. The Release Notes are fetched from a Microsoft online service."
|
|
95
|
-
)),
|
|
96
|
-
tags: ['usesOnlineServices']
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
});
|
|
@@ -1,350 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
3
|
-
import { IPreferencesService } from 'vscode/vscode/vs/workbench/services/preferences/common/preferences';
|
|
4
|
-
import { settingKeyToDisplayFormat } from 'vscode/vscode/vs/workbench/contrib/preferences/browser/settingsTreeModels';
|
|
5
|
-
import { Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
6
|
-
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
7
|
-
import { DefaultSettings } from 'vscode/vscode/vs/workbench/services/preferences/common/preferencesModels';
|
|
8
|
-
import { IContextMenuService } from 'vscode/vscode/vs/platform/contextview/browser/contextView';
|
|
9
|
-
import { ActionViewItem } from 'vscode/vscode/vs/base/browser/ui/actionbar/actionViewItems';
|
|
10
|
-
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry';
|
|
11
|
-
import { IClipboardService } from 'vscode/vscode/vs/platform/clipboard/common/clipboardService';
|
|
12
|
-
|
|
13
|
-
const codeSettingRegex = /^<code (codesetting)="([^\s"\:]+)(?::([^"]+))?">/;
|
|
14
|
-
const codeFeatureRegex = /^<span (codefeature)="([^\s"\:]+)(?::([^"]+))?">/;
|
|
15
|
-
let SimpleSettingRenderer = class SimpleSettingRenderer {
|
|
16
|
-
constructor(_configurationService, _contextMenuService, _preferencesService, _telemetryService, _clipboardService) {
|
|
17
|
-
this._configurationService = _configurationService;
|
|
18
|
-
this._contextMenuService = _contextMenuService;
|
|
19
|
-
this._preferencesService = _preferencesService;
|
|
20
|
-
this._telemetryService = _telemetryService;
|
|
21
|
-
this._clipboardService = _clipboardService;
|
|
22
|
-
this._updatedSettings = ( new Map());
|
|
23
|
-
this._encounteredSettings = ( new Map());
|
|
24
|
-
this._featuredSettings = ( new Map());
|
|
25
|
-
this.settingsGroups = undefined;
|
|
26
|
-
this._defaultSettings = ( new DefaultSettings([], 2 ));
|
|
27
|
-
}
|
|
28
|
-
get featuredSettingStates() {
|
|
29
|
-
const result = ( new Map());
|
|
30
|
-
for (const [settingId, value] of this._featuredSettings) {
|
|
31
|
-
result.set(settingId, this._configurationService.getValue(settingId) === value);
|
|
32
|
-
}
|
|
33
|
-
return result;
|
|
34
|
-
}
|
|
35
|
-
getHtmlRenderer() {
|
|
36
|
-
return (html) => {
|
|
37
|
-
const match = codeSettingRegex.exec(html) ?? codeFeatureRegex.exec(html);
|
|
38
|
-
if (match && match.length === 4) {
|
|
39
|
-
const settingId = match[2];
|
|
40
|
-
const rendered = this.render(settingId, match[3], match[1] === 'codefeature');
|
|
41
|
-
if (rendered) {
|
|
42
|
-
html = html.replace(codeSettingRegex, rendered);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return html;
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
settingToUriString(settingId, value) {
|
|
49
|
-
return `${Schemas.codeSetting}://${settingId}${value ? `/${value}` : ''}`;
|
|
50
|
-
}
|
|
51
|
-
featureToUriString(settingId, value) {
|
|
52
|
-
return `${Schemas.codeFeature}://${settingId}${value ? `/${value}` : ''}`;
|
|
53
|
-
}
|
|
54
|
-
getSetting(settingId) {
|
|
55
|
-
if (!this.settingsGroups) {
|
|
56
|
-
this.settingsGroups = this._defaultSettings.getSettingsGroups();
|
|
57
|
-
}
|
|
58
|
-
if (( this._encounteredSettings.has(settingId))) {
|
|
59
|
-
return this._encounteredSettings.get(settingId);
|
|
60
|
-
}
|
|
61
|
-
for (const group of this.settingsGroups) {
|
|
62
|
-
for (const section of group.sections) {
|
|
63
|
-
for (const setting of section.settings) {
|
|
64
|
-
if (setting.key === settingId) {
|
|
65
|
-
this._encounteredSettings.set(settingId, setting);
|
|
66
|
-
return setting;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return undefined;
|
|
72
|
-
}
|
|
73
|
-
parseValue(settingId, value) {
|
|
74
|
-
if (value === 'undefined' || value === '') {
|
|
75
|
-
return undefined;
|
|
76
|
-
}
|
|
77
|
-
const setting = this.getSetting(settingId);
|
|
78
|
-
if (!setting) {
|
|
79
|
-
return value;
|
|
80
|
-
}
|
|
81
|
-
switch (setting.type) {
|
|
82
|
-
case 'boolean':
|
|
83
|
-
return value === 'true';
|
|
84
|
-
case 'number':
|
|
85
|
-
return parseInt(value, 10);
|
|
86
|
-
case 'string':
|
|
87
|
-
default:
|
|
88
|
-
return value;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
render(settingId, newValue, asFeature) {
|
|
92
|
-
const setting = this.getSetting(settingId);
|
|
93
|
-
if (!setting) {
|
|
94
|
-
return '';
|
|
95
|
-
}
|
|
96
|
-
if (asFeature) {
|
|
97
|
-
return this.renderFeature(setting, newValue);
|
|
98
|
-
}
|
|
99
|
-
else {
|
|
100
|
-
return this.renderSetting(setting, newValue);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
viewInSettingsMessage(settingId, alreadyDisplayed) {
|
|
104
|
-
if (alreadyDisplayed) {
|
|
105
|
-
return ( localizeWithPath(
|
|
106
|
-
'vs/workbench/contrib/markdown/browser/markdownSettingRenderer',
|
|
107
|
-
'viewInSettings',
|
|
108
|
-
"View in Settings"
|
|
109
|
-
));
|
|
110
|
-
}
|
|
111
|
-
else {
|
|
112
|
-
const displayName = settingKeyToDisplayFormat(settingId);
|
|
113
|
-
return ( localizeWithPath(
|
|
114
|
-
'vs/workbench/contrib/markdown/browser/markdownSettingRenderer',
|
|
115
|
-
'viewInSettingsDetailed',
|
|
116
|
-
"View \"{0}: {1}\" in Settings",
|
|
117
|
-
displayName.category,
|
|
118
|
-
displayName.label
|
|
119
|
-
));
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
restorePreviousSettingMessage(settingId) {
|
|
123
|
-
const displayName = settingKeyToDisplayFormat(settingId);
|
|
124
|
-
return ( localizeWithPath(
|
|
125
|
-
'vs/workbench/contrib/markdown/browser/markdownSettingRenderer',
|
|
126
|
-
'restorePreviousValue',
|
|
127
|
-
"Restore value of \"{0}: {1}\"",
|
|
128
|
-
displayName.category,
|
|
129
|
-
displayName.label
|
|
130
|
-
));
|
|
131
|
-
}
|
|
132
|
-
booleanSettingMessage(setting, booleanValue) {
|
|
133
|
-
const currentValue = this._configurationService.getValue(setting.key);
|
|
134
|
-
if (currentValue === booleanValue || (currentValue === undefined && setting.value === booleanValue)) {
|
|
135
|
-
return undefined;
|
|
136
|
-
}
|
|
137
|
-
const displayName = settingKeyToDisplayFormat(setting.key);
|
|
138
|
-
if (booleanValue) {
|
|
139
|
-
return ( localizeWithPath(
|
|
140
|
-
'vs/workbench/contrib/markdown/browser/markdownSettingRenderer',
|
|
141
|
-
'trueMessage',
|
|
142
|
-
"Enable \"{0}: {1}\"",
|
|
143
|
-
displayName.category,
|
|
144
|
-
displayName.label
|
|
145
|
-
));
|
|
146
|
-
}
|
|
147
|
-
else {
|
|
148
|
-
return ( localizeWithPath(
|
|
149
|
-
'vs/workbench/contrib/markdown/browser/markdownSettingRenderer',
|
|
150
|
-
'falseMessage',
|
|
151
|
-
"Disable \"{0}: {1}\"",
|
|
152
|
-
displayName.category,
|
|
153
|
-
displayName.label
|
|
154
|
-
));
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
stringSettingMessage(setting, stringValue) {
|
|
158
|
-
const currentValue = this._configurationService.getValue(setting.key);
|
|
159
|
-
if (currentValue === stringValue || (currentValue === undefined && setting.value === stringValue)) {
|
|
160
|
-
return undefined;
|
|
161
|
-
}
|
|
162
|
-
const displayName = settingKeyToDisplayFormat(setting.key);
|
|
163
|
-
return ( localizeWithPath(
|
|
164
|
-
'vs/workbench/contrib/markdown/browser/markdownSettingRenderer',
|
|
165
|
-
'stringValue',
|
|
166
|
-
"Set \"{0}: {1}\" to \"{2}\"",
|
|
167
|
-
displayName.category,
|
|
168
|
-
displayName.label,
|
|
169
|
-
stringValue
|
|
170
|
-
));
|
|
171
|
-
}
|
|
172
|
-
numberSettingMessage(setting, numberValue) {
|
|
173
|
-
const currentValue = this._configurationService.getValue(setting.key);
|
|
174
|
-
if (currentValue === numberValue || (currentValue === undefined && setting.value === numberValue)) {
|
|
175
|
-
return undefined;
|
|
176
|
-
}
|
|
177
|
-
const displayName = settingKeyToDisplayFormat(setting.key);
|
|
178
|
-
return ( localizeWithPath(
|
|
179
|
-
'vs/workbench/contrib/markdown/browser/markdownSettingRenderer',
|
|
180
|
-
'numberValue',
|
|
181
|
-
"Set \"{0}: {1}\" to {2}",
|
|
182
|
-
displayName.category,
|
|
183
|
-
displayName.label,
|
|
184
|
-
numberValue
|
|
185
|
-
));
|
|
186
|
-
}
|
|
187
|
-
renderSetting(setting, newValue) {
|
|
188
|
-
const href = this.settingToUriString(setting.key, newValue);
|
|
189
|
-
const title = ( localizeWithPath(
|
|
190
|
-
'vs/workbench/contrib/markdown/browser/markdownSettingRenderer',
|
|
191
|
-
'changeSettingTitle',
|
|
192
|
-
"View or change setting"
|
|
193
|
-
));
|
|
194
|
-
return `<code tabindex="0"><a href="${href}" class="codesetting" title="${title}" aria-role="button"><svg width="14" height="14" viewBox="0 0 15 15" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M9.1 4.4L8.6 2H7.4l-.5 2.4-.7.3-2-1.3-.9.8 1.3 2-.2.7-2.4.5v1.2l2.4.5.3.8-1.3 2 .8.8 2-1.3.8.3.4 2.3h1.2l.5-2.4.8-.3 2 1.3.8-.8-1.3-2 .3-.8 2.3-.4V7.4l-2.4-.5-.3-.8 1.3-2-.8-.8-2 1.3-.7-.2zM9.4 1l.5 2.4L12 2.1l2 2-1.4 2.1 2.4.4v2.8l-2.4.5L14 12l-2 2-2.1-1.4-.5 2.4H6.6l-.5-2.4L4 13.9l-2-2 1.4-2.1L1 9.4V6.6l2.4-.5L2.1 4l2-2 2.1 1.4.4-2.4h2.8zm.6 7c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zM8 9c.6 0 1-.4 1-1s-.4-1-1-1-1 .4-1 1 .4 1 1 1z"/></svg>
|
|
195
|
-
<span class="separator"></span>
|
|
196
|
-
<span class="setting-name">${setting.key}</span>
|
|
197
|
-
</a></code><code>`;
|
|
198
|
-
}
|
|
199
|
-
renderFeature(setting, newValue) {
|
|
200
|
-
const href = this.featureToUriString(setting.key, newValue);
|
|
201
|
-
const parsedValue = this.parseValue(setting.key, newValue);
|
|
202
|
-
const isChecked = this._configurationService.getValue(setting.key) === parsedValue;
|
|
203
|
-
this._featuredSettings.set(setting.key, parsedValue);
|
|
204
|
-
const title = ( localizeWithPath(
|
|
205
|
-
'vs/workbench/contrib/markdown/browser/markdownSettingRenderer',
|
|
206
|
-
'changeFeatureTitle',
|
|
207
|
-
"Toggle feature with setting {0}",
|
|
208
|
-
setting.key
|
|
209
|
-
));
|
|
210
|
-
return `<span><div class="codefeature-container"><input id="${setting.key}" class="hiddenCheck" type="checkbox" ${isChecked ? 'checked' : ''}><span class="codefeature"><a href="${href}" class="toggle" title="${title}" role="checkbox" aria-checked="${isChecked ? 'true' : 'false'}"></a></span><span class="title"></span></div>`;
|
|
211
|
-
}
|
|
212
|
-
getSettingMessage(setting, newValue) {
|
|
213
|
-
if (setting.type === 'boolean') {
|
|
214
|
-
return this.booleanSettingMessage(setting, newValue);
|
|
215
|
-
}
|
|
216
|
-
else if (setting.type === 'string') {
|
|
217
|
-
return this.stringSettingMessage(setting, newValue);
|
|
218
|
-
}
|
|
219
|
-
else if (setting.type === 'number') {
|
|
220
|
-
return this.numberSettingMessage(setting, newValue);
|
|
221
|
-
}
|
|
222
|
-
return undefined;
|
|
223
|
-
}
|
|
224
|
-
async restoreSetting(settingId) {
|
|
225
|
-
const userOriginalSettingValue = this._updatedSettings.get(settingId);
|
|
226
|
-
this._updatedSettings.delete(settingId);
|
|
227
|
-
return this._configurationService.updateValue(settingId, userOriginalSettingValue, 2 );
|
|
228
|
-
}
|
|
229
|
-
async setSetting(settingId, currentSettingValue, newSettingValue) {
|
|
230
|
-
this._updatedSettings.set(settingId, currentSettingValue);
|
|
231
|
-
return this._configurationService.updateValue(settingId, newSettingValue, 2 );
|
|
232
|
-
}
|
|
233
|
-
getActions(uri) {
|
|
234
|
-
if (uri.scheme !== Schemas.codeSetting) {
|
|
235
|
-
return;
|
|
236
|
-
}
|
|
237
|
-
const actions = [];
|
|
238
|
-
const settingId = uri.authority;
|
|
239
|
-
const newSettingValue = this.parseValue(uri.authority, uri.path.substring(1));
|
|
240
|
-
const currentSettingValue = this._configurationService.inspect(settingId).userValue;
|
|
241
|
-
if ((newSettingValue !== undefined) && newSettingValue === currentSettingValue && ( this._updatedSettings.has(settingId))) {
|
|
242
|
-
const restoreMessage = this.restorePreviousSettingMessage(settingId);
|
|
243
|
-
actions.push({
|
|
244
|
-
class: undefined,
|
|
245
|
-
id: 'restoreSetting',
|
|
246
|
-
enabled: true,
|
|
247
|
-
tooltip: restoreMessage,
|
|
248
|
-
label: restoreMessage,
|
|
249
|
-
run: () => {
|
|
250
|
-
return this.restoreSetting(settingId);
|
|
251
|
-
}
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
else if (newSettingValue !== undefined) {
|
|
255
|
-
const setting = this.getSetting(settingId);
|
|
256
|
-
const trySettingMessage = setting ? this.getSettingMessage(setting, newSettingValue) : undefined;
|
|
257
|
-
if (setting && trySettingMessage) {
|
|
258
|
-
actions.push({
|
|
259
|
-
class: undefined,
|
|
260
|
-
id: 'trySetting',
|
|
261
|
-
enabled: currentSettingValue !== newSettingValue,
|
|
262
|
-
tooltip: trySettingMessage,
|
|
263
|
-
label: trySettingMessage,
|
|
264
|
-
run: () => {
|
|
265
|
-
this.setSetting(settingId, currentSettingValue, newSettingValue);
|
|
266
|
-
}
|
|
267
|
-
});
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
const viewInSettingsMessage = this.viewInSettingsMessage(settingId, actions.length > 0);
|
|
271
|
-
actions.push({
|
|
272
|
-
class: undefined,
|
|
273
|
-
enabled: true,
|
|
274
|
-
id: 'viewInSettings',
|
|
275
|
-
tooltip: viewInSettingsMessage,
|
|
276
|
-
label: viewInSettingsMessage,
|
|
277
|
-
run: () => {
|
|
278
|
-
return this._preferencesService.openApplicationSettings({ query: `@id:${settingId}` });
|
|
279
|
-
}
|
|
280
|
-
});
|
|
281
|
-
actions.push({
|
|
282
|
-
class: undefined,
|
|
283
|
-
enabled: true,
|
|
284
|
-
id: 'copySettingId',
|
|
285
|
-
tooltip: ( localizeWithPath(
|
|
286
|
-
'vs/workbench/contrib/markdown/browser/markdownSettingRenderer',
|
|
287
|
-
'copySettingId',
|
|
288
|
-
"Copy Setting ID"
|
|
289
|
-
)),
|
|
290
|
-
label: ( localizeWithPath(
|
|
291
|
-
'vs/workbench/contrib/markdown/browser/markdownSettingRenderer',
|
|
292
|
-
'copySettingId',
|
|
293
|
-
"Copy Setting ID"
|
|
294
|
-
)),
|
|
295
|
-
run: () => {
|
|
296
|
-
this._clipboardService.writeText(settingId);
|
|
297
|
-
}
|
|
298
|
-
});
|
|
299
|
-
return actions;
|
|
300
|
-
}
|
|
301
|
-
showContextMenu(uri, x, y) {
|
|
302
|
-
const actions = this.getActions(uri);
|
|
303
|
-
if (!actions) {
|
|
304
|
-
return;
|
|
305
|
-
}
|
|
306
|
-
this._contextMenuService.showContextMenu({
|
|
307
|
-
getAnchor: () => ({ x, y }),
|
|
308
|
-
getActions: () => actions,
|
|
309
|
-
getActionViewItem: (action) => {
|
|
310
|
-
return ( new ActionViewItem(action, action, { label: true }));
|
|
311
|
-
},
|
|
312
|
-
});
|
|
313
|
-
}
|
|
314
|
-
async setFeatureState(uri) {
|
|
315
|
-
const settingId = uri.authority;
|
|
316
|
-
const newSettingValue = this.parseValue(uri.authority, uri.path.substring(1));
|
|
317
|
-
let valueToSetSetting;
|
|
318
|
-
if (( this._updatedSettings.has(settingId))) {
|
|
319
|
-
valueToSetSetting = this._updatedSettings.get(settingId);
|
|
320
|
-
this._updatedSettings.delete(settingId);
|
|
321
|
-
}
|
|
322
|
-
else if (newSettingValue !== this._configurationService.getValue(settingId)) {
|
|
323
|
-
valueToSetSetting = newSettingValue;
|
|
324
|
-
}
|
|
325
|
-
else {
|
|
326
|
-
valueToSetSetting = undefined;
|
|
327
|
-
}
|
|
328
|
-
await this._configurationService.updateValue(settingId, valueToSetSetting, 2 );
|
|
329
|
-
}
|
|
330
|
-
async updateSetting(uri, x, y) {
|
|
331
|
-
if (uri.scheme === Schemas.codeSetting) {
|
|
332
|
-
this._telemetryService.publicLog2('releaseNotesSettingAction', {
|
|
333
|
-
settingId: uri.authority
|
|
334
|
-
});
|
|
335
|
-
return this.showContextMenu(uri, x, y);
|
|
336
|
-
}
|
|
337
|
-
else if (uri.scheme === Schemas.codeFeature) {
|
|
338
|
-
return this.setFeatureState(uri);
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
};
|
|
342
|
-
SimpleSettingRenderer = ( __decorate([
|
|
343
|
-
( __param(0, IConfigurationService)),
|
|
344
|
-
( __param(1, IContextMenuService)),
|
|
345
|
-
( __param(2, IPreferencesService)),
|
|
346
|
-
( __param(3, ITelemetryService)),
|
|
347
|
-
( __param(4, IClipboardService))
|
|
348
|
-
], SimpleSettingRenderer));
|
|
349
|
-
|
|
350
|
-
export { SimpleSettingRenderer };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import n from '../../../../../../../../external/rollup-plugin-styles/dist/runtime/inject-css.js';
|
|
2
|
-
|
|
3
|
-
var css = ".file-icons-enabled .show-file-icons .webview-vs_code_release_notes-name-file-icon.file-icon:before{background-image:url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiPjxwYXRoIGQ9Ik0xMDI0IDEwMjRIMFYwaDEwMjR2MTAyNHoiIHN0eWxlPSJmaWxsOiNmNmY2ZjY7ZmlsbC1vcGFjaXR5OjAiIGZpbGw9Im5vbmUiLz48cGF0aCBkPSJNMTAyNCA4NS4zMzN2ODUzLjMzM0gwVjg1LjMzM2gxMDI0eiIgc3R5bGU9ImZpbGw6I2ZmZiIvPjxwYXRoIGQ9Ik0wIDg1LjMzM2gyOTguNjY3djg1My4zMzNIMFY4NS4zMzN6bTEwMjQgMHY4NTMuMzMzSDM4NFY4NS4zMzNoNjQwem0tNTU0LjY2NyAxNjBoMzQxLjMzM3YtNjRINDY5LjMzM3Y2NHptMzQxLjMzNCA1MzMuMzM0SDQ2OS4zMzN2NjRoMzQxLjMzM2wuMDAxLTY0em0xMjgtMTQ5LjMzNEg1OTcuMzMzdjY0aDM0MS4zMzNsLjAwMS02NHptMC0xNDkuMzMzSDU5Ny4zMzN2NjRoMzQxLjMzM2wuMDAxLTY0em0wLTE0OS4zMzNINTk3LjMzM3Y2NGgzNDEuMzMzbC4wMDEtNjR6IiBzdHlsZT0iZmlsbDojMTY3YWJmIi8+PC9zdmc+\");content:\" \"}";
|
|
4
|
-
n(css,{});
|
|
5
|
-
|
|
6
|
-
export { css, css as default };
|