@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
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
import '../../../../platform/update/common/update.config.contribution.js';
|
|
2
|
-
import { localize2WithPath, localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
3
|
-
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
4
|
-
import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
5
|
-
import { Categories } from 'vscode/vscode/vs/platform/action/common/actionCommonCategories';
|
|
6
|
-
import { registerAction2, Action2, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
7
|
-
import { ProductContribution, UpdateContribution, SwitchProductQualityContribution, DOWNLOAD_URL, RELEASE_NOTES_URL, showReleaseNotesInEditor, CONTEXT_UPDATE_STATE } from './update.js';
|
|
8
|
-
import product from 'vscode/vscode/vs/platform/product/common/product';
|
|
9
|
-
import { IUpdateService } from 'vscode/vscode/vs/platform/update/common/update';
|
|
10
|
-
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
11
|
-
import { isWindows } from 'vscode/vscode/vs/base/common/platform';
|
|
12
|
-
import '../../../../../../../override/vs/platform/dialogs/common/dialogs.js';
|
|
13
|
-
import { mnemonicButtonLabel } from 'vscode/vscode/vs/base/common/labels';
|
|
14
|
-
import { ShowCurrentReleaseNotesActionId, ShowCurrentReleaseNotesFromCurrentFileActionId } from 'vscode/vscode/vs/workbench/contrib/update/common/update';
|
|
15
|
-
import { IsWebContext } from 'vscode/vscode/vs/platform/contextkey/common/contextkeys';
|
|
16
|
-
import { IOpenerService } from 'vscode/vscode/vs/platform/opener/common/opener';
|
|
17
|
-
import { IProductService } from 'vscode/vscode/vs/platform/product/common/productService';
|
|
18
|
-
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
19
|
-
import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
20
|
-
import { IFileDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs';
|
|
21
|
-
|
|
22
|
-
const workbench = ( Registry.as(Extensions.Workbench));
|
|
23
|
-
workbench.registerWorkbenchContribution(ProductContribution, 3 );
|
|
24
|
-
workbench.registerWorkbenchContribution(UpdateContribution, 3 );
|
|
25
|
-
workbench.registerWorkbenchContribution(SwitchProductQualityContribution, 3 );
|
|
26
|
-
class ShowCurrentReleaseNotesAction extends Action2 {
|
|
27
|
-
constructor() {
|
|
28
|
-
super({
|
|
29
|
-
id: ShowCurrentReleaseNotesActionId,
|
|
30
|
-
title: {
|
|
31
|
-
...( localize2WithPath(
|
|
32
|
-
'vs/workbench/contrib/update/browser/update.contribution',
|
|
33
|
-
'showReleaseNotes',
|
|
34
|
-
"Show Release Notes"
|
|
35
|
-
)),
|
|
36
|
-
mnemonicTitle: ( localizeWithPath(
|
|
37
|
-
'vs/workbench/contrib/update/browser/update.contribution',
|
|
38
|
-
{ key: 'mshowReleaseNotes', comment: ['&& denotes a mnemonic'] },
|
|
39
|
-
"Show &&Release Notes"
|
|
40
|
-
)),
|
|
41
|
-
},
|
|
42
|
-
category: { value: product.nameShort, original: product.nameShort },
|
|
43
|
-
f1: true,
|
|
44
|
-
precondition: RELEASE_NOTES_URL,
|
|
45
|
-
menu: [{
|
|
46
|
-
id: MenuId.MenubarHelpMenu,
|
|
47
|
-
group: '1_welcome',
|
|
48
|
-
order: 5,
|
|
49
|
-
when: RELEASE_NOTES_URL,
|
|
50
|
-
}]
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
async run(accessor) {
|
|
54
|
-
const instantiationService = accessor.get(IInstantiationService);
|
|
55
|
-
const productService = accessor.get(IProductService);
|
|
56
|
-
const openerService = accessor.get(IOpenerService);
|
|
57
|
-
try {
|
|
58
|
-
await showReleaseNotesInEditor(instantiationService, productService.version, false);
|
|
59
|
-
}
|
|
60
|
-
catch (err) {
|
|
61
|
-
if (productService.releaseNotesUrl) {
|
|
62
|
-
await openerService.open(( URI.parse(productService.releaseNotesUrl)));
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
throw new Error(localizeWithPath('vs/workbench/contrib/update/browser/update.contribution', 'update.noReleaseNotesOnline', "This version of {0} does not have release notes online", productService.nameLong));
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
class ShowCurrentReleaseNotesFromCurrentFileAction extends Action2 {
|
|
71
|
-
constructor() {
|
|
72
|
-
super({
|
|
73
|
-
id: ShowCurrentReleaseNotesFromCurrentFileActionId,
|
|
74
|
-
title: {
|
|
75
|
-
...( localize2WithPath(
|
|
76
|
-
'vs/workbench/contrib/update/browser/update.contribution',
|
|
77
|
-
'showReleaseNotesCurrentFile',
|
|
78
|
-
"Open Current File as Release Notes"
|
|
79
|
-
)),
|
|
80
|
-
mnemonicTitle: ( localizeWithPath(
|
|
81
|
-
'vs/workbench/contrib/update/browser/update.contribution',
|
|
82
|
-
{ key: 'mshowReleaseNotes', comment: ['&& denotes a mnemonic'] },
|
|
83
|
-
"Show &&Release Notes"
|
|
84
|
-
)),
|
|
85
|
-
},
|
|
86
|
-
category: ( localize2WithPath(
|
|
87
|
-
'vs/workbench/contrib/update/browser/update.contribution',
|
|
88
|
-
'developerCategory',
|
|
89
|
-
"Developer"
|
|
90
|
-
)),
|
|
91
|
-
f1: true,
|
|
92
|
-
precondition: RELEASE_NOTES_URL
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
async run(accessor) {
|
|
96
|
-
const instantiationService = accessor.get(IInstantiationService);
|
|
97
|
-
const productService = accessor.get(IProductService);
|
|
98
|
-
try {
|
|
99
|
-
await showReleaseNotesInEditor(instantiationService, productService.version, true);
|
|
100
|
-
}
|
|
101
|
-
catch (err) {
|
|
102
|
-
throw new Error(localizeWithPath('vs/workbench/contrib/update/browser/update.contribution', 'releaseNotesFromFileNone', "Cannot open the current file as Release Notes"));
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
registerAction2(ShowCurrentReleaseNotesAction);
|
|
107
|
-
registerAction2(ShowCurrentReleaseNotesFromCurrentFileAction);
|
|
108
|
-
class CheckForUpdateAction extends Action2 {
|
|
109
|
-
constructor() {
|
|
110
|
-
super({
|
|
111
|
-
id: 'update.checkForUpdate',
|
|
112
|
-
title: ( localize2WithPath(
|
|
113
|
-
'vs/workbench/contrib/update/browser/update.contribution',
|
|
114
|
-
'checkForUpdates',
|
|
115
|
-
'Check for Updates...'
|
|
116
|
-
)),
|
|
117
|
-
category: { value: product.nameShort, original: product.nameShort },
|
|
118
|
-
f1: true,
|
|
119
|
-
precondition: ( CONTEXT_UPDATE_STATE.isEqualTo("idle" )),
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
async run(accessor) {
|
|
123
|
-
const updateService = accessor.get(IUpdateService);
|
|
124
|
-
return updateService.checkForUpdates(true);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
class DownloadUpdateAction extends Action2 {
|
|
128
|
-
constructor() {
|
|
129
|
-
super({
|
|
130
|
-
id: 'update.downloadUpdate',
|
|
131
|
-
title: ( localize2WithPath(
|
|
132
|
-
'vs/workbench/contrib/update/browser/update.contribution',
|
|
133
|
-
'downloadUpdate',
|
|
134
|
-
'Download Update'
|
|
135
|
-
)),
|
|
136
|
-
category: { value: product.nameShort, original: product.nameShort },
|
|
137
|
-
f1: true,
|
|
138
|
-
precondition: ( CONTEXT_UPDATE_STATE.isEqualTo("available for download" ))
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
async run(accessor) {
|
|
142
|
-
await accessor.get(IUpdateService).downloadUpdate();
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
class InstallUpdateAction extends Action2 {
|
|
146
|
-
constructor() {
|
|
147
|
-
super({
|
|
148
|
-
id: 'update.installUpdate',
|
|
149
|
-
title: ( localize2WithPath(
|
|
150
|
-
'vs/workbench/contrib/update/browser/update.contribution',
|
|
151
|
-
'installUpdate',
|
|
152
|
-
'Install Update'
|
|
153
|
-
)),
|
|
154
|
-
category: { value: product.nameShort, original: product.nameShort },
|
|
155
|
-
f1: true,
|
|
156
|
-
precondition: ( CONTEXT_UPDATE_STATE.isEqualTo("downloaded" ))
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
async run(accessor) {
|
|
160
|
-
await accessor.get(IUpdateService).applyUpdate();
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
class RestartToUpdateAction extends Action2 {
|
|
164
|
-
constructor() {
|
|
165
|
-
super({
|
|
166
|
-
id: 'update.restartToUpdate',
|
|
167
|
-
title: ( localize2WithPath(
|
|
168
|
-
'vs/workbench/contrib/update/browser/update.contribution',
|
|
169
|
-
'restartToUpdate',
|
|
170
|
-
'Restart to Update'
|
|
171
|
-
)),
|
|
172
|
-
category: { value: product.nameShort, original: product.nameShort },
|
|
173
|
-
f1: true,
|
|
174
|
-
precondition: ( CONTEXT_UPDATE_STATE.isEqualTo("ready" ))
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
async run(accessor) {
|
|
178
|
-
await accessor.get(IUpdateService).quitAndInstall();
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
class DownloadAction extends Action2 {
|
|
182
|
-
static { this.ID = 'workbench.action.download'; }
|
|
183
|
-
constructor() {
|
|
184
|
-
super({
|
|
185
|
-
id: DownloadAction.ID,
|
|
186
|
-
title: ( localize2WithPath(
|
|
187
|
-
'vs/workbench/contrib/update/browser/update.contribution',
|
|
188
|
-
'openDownloadPage',
|
|
189
|
-
"Download {0}",
|
|
190
|
-
product.nameLong
|
|
191
|
-
)),
|
|
192
|
-
precondition: ( ContextKeyExpr.and(IsWebContext, DOWNLOAD_URL)),
|
|
193
|
-
f1: true,
|
|
194
|
-
menu: [{
|
|
195
|
-
id: MenuId.StatusBarWindowIndicatorMenu,
|
|
196
|
-
when: ( ContextKeyExpr.and(IsWebContext, DOWNLOAD_URL))
|
|
197
|
-
}]
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
run(accessor) {
|
|
201
|
-
const productService = accessor.get(IProductService);
|
|
202
|
-
const openerService = accessor.get(IOpenerService);
|
|
203
|
-
if (productService.downloadUrl) {
|
|
204
|
-
openerService.open(( URI.parse(productService.downloadUrl)));
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
registerAction2(DownloadAction);
|
|
209
|
-
registerAction2(CheckForUpdateAction);
|
|
210
|
-
registerAction2(DownloadUpdateAction);
|
|
211
|
-
registerAction2(InstallUpdateAction);
|
|
212
|
-
registerAction2(RestartToUpdateAction);
|
|
213
|
-
if (isWindows) {
|
|
214
|
-
class DeveloperApplyUpdateAction extends Action2 {
|
|
215
|
-
constructor() {
|
|
216
|
-
super({
|
|
217
|
-
id: '_update.applyupdate',
|
|
218
|
-
title: ( localize2WithPath(
|
|
219
|
-
'vs/workbench/contrib/update/browser/update.contribution',
|
|
220
|
-
'applyUpdate',
|
|
221
|
-
'Apply Update...'
|
|
222
|
-
)),
|
|
223
|
-
category: Categories.Developer,
|
|
224
|
-
f1: true,
|
|
225
|
-
precondition: ( CONTEXT_UPDATE_STATE.isEqualTo("idle" ))
|
|
226
|
-
});
|
|
227
|
-
}
|
|
228
|
-
async run(accessor) {
|
|
229
|
-
const updateService = accessor.get(IUpdateService);
|
|
230
|
-
const fileDialogService = accessor.get(IFileDialogService);
|
|
231
|
-
const updatePath = await fileDialogService.showOpenDialog({
|
|
232
|
-
title: ( localizeWithPath(
|
|
233
|
-
'vs/workbench/contrib/update/browser/update.contribution',
|
|
234
|
-
'pickUpdate',
|
|
235
|
-
"Apply Update"
|
|
236
|
-
)),
|
|
237
|
-
filters: [{ name: 'Setup', extensions: ['exe'] }],
|
|
238
|
-
canSelectFiles: true,
|
|
239
|
-
openLabel: mnemonicButtonLabel(( localizeWithPath(
|
|
240
|
-
'vs/workbench/contrib/update/browser/update.contribution',
|
|
241
|
-
{ key: 'updateButton', comment: ['&& denotes a mnemonic'] },
|
|
242
|
-
"&&Update"
|
|
243
|
-
)))
|
|
244
|
-
});
|
|
245
|
-
if (!updatePath || !updatePath[0]) {
|
|
246
|
-
return;
|
|
247
|
-
}
|
|
248
|
-
await updateService._applySpecificUpdate(updatePath[0].fsPath);
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
registerAction2(DeveloperApplyUpdateAction);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
export { CheckForUpdateAction, ShowCurrentReleaseNotesAction, ShowCurrentReleaseNotesFromCurrentFileAction };
|