Skip to content

Commit

Permalink
Merge branch 'master' into isidorn/multiRootLaunch
Browse files Browse the repository at this point in the history
  • Loading branch information
isidorn committed Jan 23, 2018
2 parents 67880b3 + 486ad5e commit 40cd234
Show file tree
Hide file tree
Showing 129 changed files with 3,297 additions and 1,436 deletions.
13 changes: 12 additions & 1 deletion build/gulpfile.vscode.win32.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const _7z = require('7zip')['7z'];
const util = require('./lib/util');
const pkg = require('../package.json');
const product = require('../product.json');
const vfs = require('vinyl-fs');

const repoPath = path.dirname(__dirname);
const buildPath = arch => path.join(path.dirname(repoPath), `VSCode-win32-${arch}`);
Expand Down Expand Up @@ -77,7 +78,7 @@ gulp.task('vscode-win32-x64-setup', ['clean-vscode-win32-x64-setup'], buildWin32

function archiveWin32Setup(arch) {
return cb => {
const args = ['a', '-tzip', zipPath(arch), '.', '-r'];
const args = ['a', '-tzip', zipPath(arch), '.', '-r', '-x!inno_updater.exe'];

cp.spawn(_7z, args, { stdio: 'inherit', cwd: buildPath(arch) })
.on('error', cb)
Expand All @@ -90,3 +91,13 @@ gulp.task('vscode-win32-ia32-archive', ['clean-vscode-win32-ia32-archive'], arch

gulp.task('clean-vscode-win32-x64-archive', util.rimraf(zipDir('x64')));
gulp.task('vscode-win32-x64-archive', ['clean-vscode-win32-x64-archive'], archiveWin32Setup('x64'));

function copyInnoUpdater(arch) {
return () => {
return gulp.src('build/win32/inno_updater.exe', { base: 'build/win32' })
.pipe(vfs.dest(buildPath(arch)));
};
}

gulp.task('vscode-win32-ia32-copy-inno-updater', copyInnoUpdater('ia32'));
gulp.task('vscode-win32-x64-copy-inno-updater', copyInnoUpdater('x64'));
8 changes: 8 additions & 0 deletions build/tfs/common/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ interface Asset {
hash: string;
sha256hash: string;
size: number;
supportsFastUpdate?: boolean;
}

function createOrUpdate(commit: string, quality: string, platform: string, type: string, release: NewDocument, asset: Asset, isUpdate: boolean): Promise<void> {
Expand Down Expand Up @@ -234,6 +235,13 @@ async function publish(commit: string, quality: string, platform: string, type:
size
};

// Remove this if we ever need to rollback fast updates for windows
if (/win32/.test(platform)) {
asset.supportsFastUpdate = true;
}

console.log('Asset:', JSON.stringify(asset, null, ' '));

const release = {
id: commit,
timestamp: (new Date()).getTime(),
Expand Down
4 changes: 4 additions & 0 deletions build/tfs/win32/1_build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ step "Build minified" {
exec { & npm run gulp -- "vscode-win32-$global:arch-min" }
}

step "Copy Inno updater" {
exec { & npm run gulp -- "vscode-win32-$global:arch-copy-inno-updater" }
}

# step "Create loader snapshot" {
# exec { & node build\lib\snapshotLoader.js --arch=$global:arch }
# }
Expand Down
77 changes: 69 additions & 8 deletions build/win32/code.iss
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ OutputDir={#OutputDir}
OutputBaseFilename=VSCodeSetup
Compression=lzma
SolidCompression=yes
AppMutex={#AppMutex}
AppMutex={code:GetAppMutex}
SetupMutex={#AppMutex}setup
WizardImageFile={#RepoDir}\resources\win32\inno-big.bmp
WizardSmallImageFile={#RepoDir}\resources\win32\inno-small.bmp
Expand Down Expand Up @@ -47,11 +47,15 @@ Name: "simplifiedChinese"; MessagesFile: "{#RepoDir}\build\win32\i18n\Default.zh
Name: "traditionalChinese"; MessagesFile: "{#RepoDir}\build\win32\i18n\Default.zh-tw.isl,{#RepoDir}\build\win32\i18n\messages.zh-tw.isl" {#LocalizedLanguageFile("cht")}

[InstallDelete]
Type: filesandordirs; Name: {app}\resources\app\out
Type: filesandordirs; Name: {app}\resources\app\plugins
Type: filesandordirs; Name: {app}\resources\app\extensions
Type: filesandordirs; Name: {app}\resources\app\node_modules
Type: files; Name: {app}\resources\app\Credits_45.0.2454.85.html
Type: filesandordirs; Name: "{app}\resources\app\out"; Check: IsNotUpdate
Type: filesandordirs; Name: "{app}\resources\app\plugins"; Check: IsNotUpdate
Type: filesandordirs; Name: "{app}\resources\app\extensions"; Check: IsNotUpdate
Type: filesandordirs; Name: "{app}\resources\app\node_modules"; Check: IsNotUpdate
Type: files; Name: "{app}\resources\app\Credits_45.0.2454.85.html"; Check: IsNotUpdate

[UninstallDelete]
Type: filesandordirs; Name: "{app}\_"
Type: filesandordirs; Name: "{app}\old"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Expand All @@ -63,15 +67,16 @@ Name: "addtopath"; Description: "{cm:AddToPath}"; GroupDescription: "{cm:Other}"
Name: "runcode"; Description: "{cm:RunAfter,{#NameShort}}"; GroupDescription: "{cm:Other}"; Check: WizardSilent

[Files]
Source: "*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "*"; Excludes: "inno_updater.exe"; DestDir: "{code:GetDestDir}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "inno_updater.exe"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

[Icons]
Name: "{group}\{#NameLong}"; Filename: "{app}\{#ExeBasename}.exe"; AppUserModelID: "{#AppUserId}"
Name: "{commondesktop}\{#NameLong}"; Filename: "{app}\{#ExeBasename}.exe"; Tasks: desktopicon; AppUserModelID: "{#AppUserId}"
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#NameLong}"; Filename: "{app}\{#ExeBasename}.exe"; Tasks: quicklaunchicon; AppUserModelID: "{#AppUserId}"

[Run]
Filename: "{app}\{#ExeBasename}.exe"; Description: "{cm:LaunchProgram,{#NameLong}}"; Tasks: runcode; Flags: nowait postinstall; Check: WizardSilent
Filename: "{app}\{#ExeBasename}.exe"; Description: "{cm:LaunchProgram,{#NameLong}}"; Tasks: runcode; Flags: nowait postinstall; Check: ShouldRunAfterUpdate
Filename: "{app}\{#ExeBasename}.exe"; Description: "{cm:LaunchProgram,{#NameLong}}"; Flags: nowait postinstall; Check: WizardNotSilent

[Registry]
Expand Down Expand Up @@ -955,6 +960,62 @@ begin
Result := not WizardSilent();
end;
// Updates
function IsBackgroundUpdate(): Boolean;
begin
Result := ExpandConstant('{param:update|false}') <> 'false';
end;
function IsNotUpdate(): Boolean;
begin
Result := not IsBackgroundUpdate();
end;
function ShouldRunAfterUpdate(): Boolean;
begin
if IsBackgroundUpdate() then
// VS Code will create a flag file before the update starts (/update=C:\foo\bar)
// - if the file exists at this point, the user quit Code before the update finished, so don't start Code after update
// - otherwise, the user has accepted to apply the update and Code should start
Result := not FileExists(ExpandConstant('{param:update}'))
else
Result := True;
end;
function GetAppMutex(Value: string): string;
begin
if IsBackgroundUpdate() then
Result := ''
else
Result := '{#AppMutex}';
end;
function GetDestDir(Value: string): string;
begin
if IsBackgroundUpdate() then
Result := ExpandConstant('{app}\_')
else
Result := ExpandConstant('{app}');
end;
procedure CurStepChanged(CurStep: TSetupStep);
var
UpdateResultCode: Integer;
begin
if IsBackgroundUpdate() and (CurStep = ssPostInstall) then
begin
CreateMutex('{#AppMutex}-ready');
while (CheckForMutexes('{#AppMutex}')) do
begin
Log('Application is still running, waiting');
Sleep(1000);
end;
Exec(ExpandConstant('{app}\inno_updater.exe'), ExpandConstant('--apply-update _ "{app}\unins000.dat"'), '', SW_SHOW, ewWaitUntilTerminated, UpdateResultCode);
end;
end;
// http://stackoverflow.com/a/23838239/261019
procedure Explode(var Dest: TArrayOfString; Text: String; Separator: String);
var
Expand Down
Binary file added build/win32/inno_updater.exe
Binary file not shown.
10 changes: 5 additions & 5 deletions extensions/configuration-editing/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ function registerLocaleCompletionsInLanguageDocument(): vscode.Disposable {
function provideContributedLocalesProposals(range: vscode.Range): vscode.ProviderResult<vscode.CompletionItem[] | vscode.CompletionList> {
const contributedLocales: string[] = [];
for (const extension of vscode.extensions.all) {
if (extension.packageJSON && extension.packageJSON['contributes'] && extension.packageJSON['contributes']['locales'] && extension.packageJSON['contributes']['locales'].length) {
const locales: { locale: string }[] = extension.packageJSON['contributes']['locales'];
for (const locale of locales) {
if (contributedLocales.indexOf(locale.locale) === -1) {
contributedLocales.push(locale.locale);
if (extension.packageJSON && extension.packageJSON['contributes'] && extension.packageJSON['contributes']['localizations'] && extension.packageJSON['contributes']['localizations'].length) {
const localizations: { languageId: string }[] = extension.packageJSON['contributes']['localizations'];
for (const localization of localizations) {
if (contributedLocales.indexOf(localization.languageId) === -1) {
contributedLocales.push(localization.languageId);
}
}
}
Expand Down
9 changes: 4 additions & 5 deletions extensions/typescript/src/features/quickFixProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,8 @@ export default class TypeScriptQuickFixProvider implements vscode.CodeActionProv
diagnostic: vscode.Diagnostic,
tsAction: Proto.CodeFixAction
): vscode.CodeAction {
const codeAction = new vscode.CodeAction(
tsAction.description,
getEditForCodeAction(this.client, tsAction));

const codeAction = new vscode.CodeAction(tsAction.description, vscode.CodeActionKind.QuickFix);
codeAction.edit = getEditForCodeAction(this.client, tsAction);
codeAction.diagnostics = [diagnostic];
if (tsAction.commands) {
codeAction.command = {
Expand Down Expand Up @@ -172,7 +170,8 @@ export default class TypeScriptQuickFixProvider implements vscode.CodeActionProv

const codeAction = new vscode.CodeAction(
localize('fixAllInFileLabel', '{0} (Fix all in file)', tsAction.description),
createWorkspaceEditFromFileCodeEdits(this.client, combinedCodeFixesResponse.body.changes));
vscode.CodeActionKind.QuickFix);
codeAction.edit = createWorkspaceEditFromFileCodeEdits(this.client, combinedCodeFixesResponse.body.changes);
codeAction.diagnostics = [diagnostic];
if (tsAction.commands) {
codeAction.command = {
Expand Down
39 changes: 24 additions & 15 deletions extensions/typescript/src/features/refactorProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,17 @@ export default class TypeScriptRefactorProvider implements vscode.CodeActionProv
public async provideCodeActions(
document: vscode.TextDocument,
_range: vscode.Range,
_context: vscode.CodeActionContext,
context: vscode.CodeActionContext,
token: vscode.CancellationToken
): Promise<vscode.CodeAction[]> {
if (!this.client.apiVersion.has240Features()) {
return [];
}

if (context.only && !vscode.CodeActionKind.Refactor.contains(context.only)) {
return [];
}

if (!vscode.window.activeTextEditor) {
return [];
}
Expand All @@ -140,24 +144,22 @@ export default class TypeScriptRefactorProvider implements vscode.CodeActionProv
const actions: vscode.CodeAction[] = [];
for (const info of response.body) {
if (info.inlineable === false) {
actions.push({
const codeAction = new vscode.CodeAction(info.description, vscode.CodeActionKind.Refactor);
codeAction.command = {
title: info.description,
command: {
title: info.description,
command: SelectRefactorCommand.ID,
arguments: [document, file, info, range]
}
});
command: SelectRefactorCommand.ID,
arguments: [document, file, info, range]
};
actions.push(codeAction);
} else {
for (const action of info.actions) {
actions.push({
const codeAction = new vscode.CodeAction(action.description, TypeScriptRefactorProvider.getKind(action));
codeAction.command = {
title: action.description,
command: {
title: action.description,
command: ApplyRefactoringCommand.ID,
arguments: [document, file, info.name, action.name, range]
}
});
command: ApplyRefactoringCommand.ID,
arguments: [document, file, info.name, action.name, range]
};
actions.push(codeAction);
}
}
}
Expand All @@ -166,4 +168,11 @@ export default class TypeScriptRefactorProvider implements vscode.CodeActionProv
return [];
}
}

private static getKind(refactor: Proto.RefactorActionInfo) {
if (refactor.name.startsWith('function_')) {
return vscode.CodeActionKind.RefactorExtract.append('function');
}
return vscode.CodeActionKind.Refactor;
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "code-oss-dev",
"version": "1.20.0",
"distro": "3e04fd7a1141705f5e82fb1175edc03d0d4ddf9c",
"distro": "2478cca5311e147817eef29cb81c0995a3517842",
"author": {
"name": "Microsoft Corporation"
},
Expand Down Expand Up @@ -45,7 +45,7 @@
"vscode-debugprotocol": "1.25.0",
"vscode-ripgrep": "^0.7.1-patch.0",
"vscode-textmate": "^3.2.0",
"vscode-xterm": "3.1.0-beta5",
"vscode-xterm": "3.1.0-beta7",
"yauzl": "2.8.0"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions src/typings/iconv-lite.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
/// <reference path='./node.d.ts'/>

declare module 'iconv-lite' {
export function decode(buffer: NodeBuffer, encoding: string, options?: any): string;
export function decode(buffer: NodeBuffer, encoding: string): string;

export function encode(content: string, encoding: string, options?: any): NodeBuffer;
export function encode(content: string, encoding: string, options?: { addBOM?: boolean }): NodeBuffer;

export function encodingExists(encoding: string): boolean;

export function decodeStream(encoding: string): NodeJS.ReadWriteStream;

export function encodeStream(encoding: string): NodeJS.ReadWriteStream;
export function encodeStream(encoding: string, options?: { addBOM?: boolean }): NodeJS.ReadWriteStream;
}
1 change: 1 addition & 0 deletions src/typings/node.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1720,6 +1720,7 @@ declare module "child_process" {
uid?: number;
gid?: number;
shell?: boolean | string;
windowsVerbatimArguments?: boolean;
}
export function spawn(command: string, args?: string[], options?: SpawnOptions): ChildProcess;

Expand Down
2 changes: 2 additions & 0 deletions src/typings/windows-mutex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ declare module 'windows-mutex' {
isActive(): boolean;
release(): void;
}

export function isActive(name: string): boolean;
}
8 changes: 2 additions & 6 deletions src/vs/base/browser/ui/list/listPaging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import 'vs/css!./list';
import { IDisposable } from 'vs/base/common/lifecycle';
import { range } from 'vs/base/common/arrays';
import { IDelegate, IRenderer, IListEvent } from './list';
import { List, IListCreationOptions, IListStyles, IListOptions } from './listWidget';
import { List, IListStyles, IListOptions } from './listWidget';
import { IPagedModel } from 'vs/base/common/paging';
import Event, { mapEvent } from 'vs/base/common/event';

Expand Down Expand Up @@ -67,7 +67,7 @@ export class PagedList<T> {
container: HTMLElement,
delegate: IDelegate<number>,
renderers: IPagedRenderer<T, any>[],
options: IListCreationOptions<any> = {} // TODO@Joao: should be IListOptions<T>
options: IListOptions<any> = {}
) {
const pagedRenderers = renderers.map(r => new PagedRenderer<T, ITemplateData<T>>(r, () => this.model));
this.list = new List(container, delegate, pagedRenderers, options);
Expand Down Expand Up @@ -181,8 +181,4 @@ export class PagedList<T> {
style(styles: IListStyles): void {
this.list.style(styles);
}

updateOptions(options: IListOptions): void {
this.list.updateOptions(options);
}
}
Loading

0 comments on commit 40cd234

Please sign in to comment.