Skip to content

Commit fd42b23

Browse files
author
Benjamin Pasero
committed
Merge branch 'master' into ben/global-storage
2 parents 8fc4a0b + 7b20b40 commit fd42b23

31 files changed

Lines changed: 639 additions & 286 deletions

File tree

build/builtInExtensions.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
33
"name": "ms-vscode.node-debug",
4-
"version": "1.30.1",
4+
"version": "1.30.2",
55
"repo": "https://github.com/Microsoft/vscode-node-debug",
66
"metadata": {
77
"id": "b6ded8fb-a0a0-4c1c-acbd-ab2a3bc995a6",
@@ -31,7 +31,7 @@
3131
},
3232
{
3333
"name": "ms-vscode.references-view",
34-
"version": "0.0.14",
34+
"version": "0.0.15",
3535
"repo": "https://github.com/Microsoft/vscode-reference-view",
3636
"metadata": {
3737
"id": "dc489f46-520d-4556-ae85-1f9eab3c412d",

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@
7878
"documentdb": "^1.5.1",
7979
"electron-mksnapshot": "~2.0.0",
8080
"eslint": "^3.4.0",
81-
"event-stream": "^3.1.7",
81+
"event-stream": "3.3.4",
8282
"express": "^4.13.1",
8383
"glob": "^5.0.13",
8484
"gulp": "^3.8.9",
85-
"gulp-atom-electron": "^1.19.0",
86-
"gulp-azure-storage": "^0.7.0",
85+
"gulp-atom-electron": "^1.19.2",
86+
"gulp-azure-storage": "^0.8.2",
8787
"gulp-buffer": "0.0.2",
8888
"gulp-concat": "^2.6.0",
8989
"gulp-cssnano": "^2.1.0",
@@ -93,15 +93,15 @@
9393
"gulp-json-editor": "^2.2.1",
9494
"gulp-mocha": "^2.1.3",
9595
"gulp-plumber": "^1.2.0",
96-
"gulp-remote-src": "^0.4.0",
96+
"gulp-remote-src": "^0.4.4",
9797
"gulp-rename": "^1.2.0",
9898
"gulp-replace": "^0.5.4",
9999
"gulp-shell": "^0.5.2",
100100
"gulp-tsb": "2.0.5",
101101
"gulp-tslint": "^8.1.2",
102102
"gulp-uglify": "^3.0.0",
103103
"gulp-util": "^3.0.6",
104-
"gulp-vinyl-zip": "^1.2.2",
104+
"gulp-vinyl-zip": "^2.1.2",
105105
"husky": "^0.13.1",
106106
"innosetup-compiler": "^5.5.60",
107107
"is": "^3.1.0",

src/bootstrap-amd.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ loader.config({
1818
catchError: true,
1919
nodeRequire: require,
2020
nodeMain: __filename,
21-
'vs/nls': nlsConfig,
22-
nodeCachedDataDir: process.env['VSCODE_NODE_CACHED_DATA_DIR']
21+
'vs/nls': nlsConfig
2322
});
2423

2524
// Running in Electron
@@ -41,6 +40,16 @@ exports.load = function (entrypoint, onLoad, onError) {
4140
return;
4241
}
4342

43+
// cached data config
44+
if (process.env['VSCODE_NODE_CACHED_DATA_DIR']) {
45+
loader.config({
46+
nodeCachedData: {
47+
path: process.env['VSCODE_NODE_CACHED_DATA_DIR'],
48+
seed: entrypoint
49+
}
50+
});
51+
}
52+
4453
onLoad = onLoad || function () { };
4554
onError = onError || function (err) { console.error(err); };
4655

src/bootstrap-window.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,17 @@ exports.load = function (modulePaths, resultCallback, options) {
9191
const loaderConfig = {
9292
baseUrl: bootstrap.uriFromPath(configuration.appRoot) + '/out',
9393
'vs/nls': nlsConfig,
94-
nodeCachedDataDir: configuration.nodeCachedDataDir,
9594
nodeModules: [/*BUILD->INSERT_NODE_MODULES*/]
9695
};
9796

97+
// cached data config
98+
if (configuration.nodeCachedDataDir) {
99+
loaderConfig.nodeCachedData = {
100+
path: configuration.nodeCachedDataDir,
101+
seed: modulePaths.join('')
102+
};
103+
}
104+
98105
if (options && typeof options.beforeLoaderConfig === 'function') {
99106
options.beforeLoaderConfig(configuration, loaderConfig);
100107
}
@@ -197,4 +204,4 @@ function onUnexpectedError(error, enableDeveloperTools) {
197204
if (error.stack) {
198205
console.error(error.stack);
199206
}
200-
}
207+
}

src/vs/code/electron-browser/workbench/workbench.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,14 @@ bootstrapWindow.load([
3535
showPartsSplash(windowConfig);
3636
},
3737
beforeLoaderConfig: function (windowConfig, loaderConfig) {
38-
const onNodeCachedData = window['MonacoEnvironment'].onNodeCachedData = [];
39-
loaderConfig.onNodeCachedData = function () {
40-
onNodeCachedData.push(arguments);
41-
};
42-
4338
loaderConfig.recordStats = !!windowConfig.performance;
39+
if (loaderConfig.nodeCachedData) {
40+
const onNodeCachedData = window['MonacoEnvironment'].onNodeCachedData = [];
41+
loaderConfig.nodeCachedData.onData = function () {
42+
onNodeCachedData.push(arguments);
43+
};
44+
}
45+
4446
},
4547
beforeRequire: function () {
4648
perf.mark('willLoadWorkbenchMain');

src/vs/code/node/cliProcessMain.ts

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ import { localize } from 'vs/nls';
77
import product from 'vs/platform/node/product';
88
import pkg from 'vs/platform/node/package';
99
import * as path from 'path';
10-
import * as semver from 'semver';
1110

1211
import { TPromise } from 'vs/base/common/winjs.base';
1312
import { sequence } from 'vs/base/common/async';
14-
import { IPager } from 'vs/base/common/paging';
1513
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
1614
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
1715
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
@@ -39,7 +37,7 @@ import { ILogService, getLogLevel } from 'vs/platform/log/common/log';
3937
import { isPromiseCanceledError } from 'vs/base/common/errors';
4038
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
4139
import { CommandLineDialogService } from 'vs/platform/dialogs/node/dialogService';
42-
import { areSameExtensions, getGalleryExtensionIdFromLocal } from 'vs/platform/extensionManagement/common/extensionManagementUtil';
40+
import { areSameExtensions, getGalleryExtensionIdFromLocal, adoptToGalleryExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil';
4341
import Severity from 'vs/base/common/severity';
4442
import { URI } from 'vs/base/common/uri';
4543
import { getManifest } from 'vs/platform/extensionManagement/node/extensionManagementUtil';
@@ -56,6 +54,17 @@ function getId(manifest: IExtensionManifest, withVersion?: boolean): string {
5654
}
5755
}
5856

57+
const EXTENSION_ID_REGEX = /^([^.]+\..+)@(\d+\.\d+\.\d+(-.*)?)$/;
58+
59+
export function getIdAndVersion(id: string): [string, string] {
60+
const matches = EXTENSION_ID_REGEX.exec(id);
61+
if (matches && matches[1]) {
62+
return [adoptToGalleryExtensionId(matches[1]), matches[2]];
63+
}
64+
return [adoptToGalleryExtensionId(id), void 0];
65+
}
66+
67+
5968
type Task = { (): TPromise<void> };
6069

6170
class Main {
@@ -117,10 +126,11 @@ class Main {
117126

118127
const galleryTasks: Task[] = extensions
119128
.filter(e => !/\.vsix$/i.test(e))
120-
.map(id => () => {
129+
.map(e => () => {
130+
const [id, version] = getIdAndVersion(e);
121131
return this.extensionManagementService.getInstalled(LocalExtensionType.User)
122-
.then(installed => this.extensionGalleryService.query({ names: [id], source: 'cli' })
123-
.then<IPager<IGalleryExtension>>(null, err => {
132+
.then(installed => this.extensionGalleryService.getExtension({ id }, version)
133+
.then<IGalleryExtension>(null, err => {
124134
if (err.responseText) {
125135
try {
126136
const response = JSON.parse(err.responseText);
@@ -131,19 +141,16 @@ class Main {
131141
}
132142
return TPromise.wrapError(err);
133143
})
134-
.then(result => {
135-
const [extension] = result.firstPage;
136-
144+
.then(extension => {
137145
if (!extension) {
138-
return TPromise.wrapError(new Error(`${notFound(id)}\n${useId}`));
146+
return TPromise.wrapError(new Error(`${notFound(version ? `${id}@${version}` : id)}\n${useId}`));
139147
}
140148

141149
const [installedExtension] = installed.filter(e => areSameExtensions({ id: getGalleryExtensionIdFromLocal(e) }, { id }));
142150
if (installedExtension) {
143-
const outdated = semver.gt(extension.version, installedExtension.manifest.version);
144-
if (outdated) {
145-
if (force) {
146-
console.log(localize('updateMessage', "Updating the Extension '{0}' to a newer version {1}", id, extension.version));
151+
if (extension.version !== installedExtension.manifest.version) {
152+
if (version || force) {
153+
console.log(localize('updateMessage', "Updating the Extension '{0}' to the version {1}", id, extension.version));
147154
return this.installFromGallery(id, extension);
148155
} else {
149156
const updateMessage = localize('updateConfirmationMessage', "Extension '{0}' v{1} is already installed, but a newer version {2} is available in the marketplace. Would you like to update?", id, installedExtension.manifest.version, extension.version);
@@ -157,7 +164,7 @@ class Main {
157164
});
158165
}
159166
} else {
160-
console.log(localize('alreadyInstalled', "Extension '{0}' is already installed.", id));
167+
console.log(localize('alreadyInstalled', "Extension '{0}' is already installed.", version ? `${id}@${version}` : id));
161168
return TPromise.as(null);
162169
}
163170
} else {

src/vs/editor/contrib/goToDefinition/goToDefinitionCommands.ts

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegis
2727
import { INotificationService } from 'vs/platform/notification/common/notification';
2828
import { IProgressService } from 'vs/platform/progress/common/progress';
2929
import { getDefinitionsAtPosition, getImplementationsAtPosition, getTypeDefinitionsAtPosition, getDeclarationsAtPosition } from './goToDefinition';
30+
import { CommandsRegistry } from 'vs/platform/commands/common/commands';
3031

3132

3233
export class DefinitionActionConfig {
@@ -175,60 +176,65 @@ export class DefinitionAction extends EditorAction {
175176
}
176177
}
177178

178-
const goToDeclarationKb = platform.isWeb
179+
const goToDefinitionKb = platform.isWeb
179180
? KeyMod.CtrlCmd | KeyCode.F12
180181
: KeyCode.F12;
181182

182183
export class GoToDefinitionAction extends DefinitionAction {
183184

184-
public static readonly ID = 'editor.action.goToDeclaration';
185+
static readonly id = 'editor.action.revealDefinition';
185186

186187
constructor() {
187188
super(new DefinitionActionConfig(), {
188-
id: GoToDefinitionAction.ID,
189+
id: GoToDefinitionAction.id,
189190
label: nls.localize('actions.goToDecl.label', "Go to Definition"),
190191
alias: 'Go to Definition',
191192
precondition: ContextKeyExpr.and(
192193
EditorContextKeys.hasDefinitionProvider,
193194
EditorContextKeys.isInEmbeddedEditor.toNegated()),
194195
kbOpts: {
195196
kbExpr: EditorContextKeys.editorTextFocus,
196-
primary: goToDeclarationKb,
197+
primary: goToDefinitionKb,
197198
weight: KeybindingWeight.EditorContrib
198199
},
199200
menuOpts: {
200201
group: 'navigation',
201202
order: 1.1
202203
}
203204
});
205+
CommandsRegistry.registerCommandAlias('editor.action.goToDeclaration', GoToDefinitionAction.id);
204206
}
205207
}
206208

207209
export class OpenDefinitionToSideAction extends DefinitionAction {
208210

209-
public static readonly ID = 'editor.action.openDeclarationToTheSide';
211+
static readonly id = 'editor.action.revealDefinitionAside';
210212

211213
constructor() {
212214
super(new DefinitionActionConfig(true), {
213-
id: OpenDefinitionToSideAction.ID,
215+
id: OpenDefinitionToSideAction.id,
214216
label: nls.localize('actions.goToDeclToSide.label', "Open Definition to the Side"),
215217
alias: 'Open Definition to the Side',
216218
precondition: ContextKeyExpr.and(
217219
EditorContextKeys.hasDefinitionProvider,
218220
EditorContextKeys.isInEmbeddedEditor.toNegated()),
219221
kbOpts: {
220222
kbExpr: EditorContextKeys.editorTextFocus,
221-
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, goToDeclarationKb),
223+
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, goToDefinitionKb),
222224
weight: KeybindingWeight.EditorContrib
223225
}
224226
});
227+
CommandsRegistry.registerCommandAlias('editor.action.openDeclarationToTheSide', OpenDefinitionToSideAction.id);
225228
}
226229
}
227230

228231
export class PeekDefinitionAction extends DefinitionAction {
232+
233+
static readonly id = 'editor.action.peekDefinition';
234+
229235
constructor() {
230236
super(new DefinitionActionConfig(void 0, true, false), {
231-
id: 'editor.action.previewDeclaration',
237+
id: PeekDefinitionAction.id,
232238
label: nls.localize('actions.previewDecl.label', "Peek Definition"),
233239
alias: 'Peek Definition',
234240
precondition: ContextKeyExpr.and(
@@ -246,6 +252,7 @@ export class PeekDefinitionAction extends DefinitionAction {
246252
order: 1.2
247253
}
248254
});
255+
CommandsRegistry.registerCommandAlias('editor.action.previewDeclaration', PeekDefinitionAction.id);
249256
}
250257
}
251258

@@ -268,19 +275,19 @@ export class DeclarationAction extends DefinitionAction {
268275

269276
export class GoToDeclarationAction extends DeclarationAction {
270277

271-
public static readonly ID = 'editor.action.goToRealDeclaration';
278+
static readonly id = 'editor.action.revealDeclaration';
272279

273280
constructor() {
274281
super(new DefinitionActionConfig(), {
275-
id: GoToDeclarationAction.ID,
282+
id: GoToDeclarationAction.id,
276283
label: nls.localize('actions.goToDeclaration.label', "Go to Declaration"),
277284
alias: 'Go to Declaration',
278285
precondition: ContextKeyExpr.and(
279286
EditorContextKeys.hasDeclarationProvider,
280287
EditorContextKeys.isInEmbeddedEditor.toNegated()),
281288
kbOpts: {
282289
kbExpr: EditorContextKeys.editorTextFocus,
283-
primary: KeyMod.CtrlCmd | KeyCode.F12,
290+
primary: KeyMod.Shift | KeyMod.CtrlCmd | KeyCode.F12,
284291
weight: KeybindingWeight.EditorContrib
285292
},
286293
menuOpts: {
@@ -313,7 +320,7 @@ export class PeekDeclarationAction extends DeclarationAction {
313320
EditorContextKeys.isInEmbeddedEditor.toNegated()),
314321
kbOpts: {
315322
kbExpr: EditorContextKeys.editorTextFocus,
316-
primary: KeyMod.Alt | KeyCode.F12,
323+
primary: KeyMod.Shift | KeyMod.Alt | KeyCode.F12,
317324
linux: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.F10 },
318325
weight: KeybindingWeight.EditorContrib
319326
},

0 commit comments

Comments
 (0)