Skip to content

Commit

Permalink
Merge pull request #2 from Microsoft/master
Browse files Browse the repository at this point in the history
Update fork
  • Loading branch information
tht13 committed Feb 26, 2016
2 parents f529dd3 + 20d655f commit dcefd51
Show file tree
Hide file tree
Showing 54 changed files with 864 additions and 380 deletions.
39 changes: 1 addition & 38 deletions OSSREADME.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,41 +191,4 @@
"IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN",
"CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
]
},
// START CSharp/Omnisharp
{
"name": "Omnisharp-roslyn",
"repositoryURL": "https://github.com/OmniSharp/omnisharp-roslyn",
"version": "1.6.7.9",
"license": "MIT",
"isProd": true
},
{
"name": "ScriptCS",
"repositoryURL": "https://github.com/scriptcs/scriptcs",
"version": "0.16.0",
"license": "Apache2",
"licenseDetail": [
"Copyright 2013 Glenn Block, Justin Rusbatch, Filip Wojcieszyn",
"",
"Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file ",
"except in compliance with the License. You may obtain a copy of the License at",
"",
"http://www.apache.org/licenses/LICENSE-2.0",
"",
"Unless required by applicable law or agreed to in writing, software distributed under the ",
"License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, ",
"either express or implied. See the License for the specific language governing permissions ",
"and limitations under the License."
],
"isProd": true
},
{
"name": "language-csharp",
"version": "0.11.0",
"license": "Dual-licensed under MIT and GPL",
"repositoryURL": "https://github.com/atom/language-csharp",
"isProd": true
}
// END CSharp/Omnisharp
]
}]
15 changes: 9 additions & 6 deletions build/gulpfile.vscode.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,15 @@ function packageTask(platform, arch, opts) {
.pipe(filter(['**', '!LICENSE', '!LICENSES.chromium.html', '!version']));

if (platform === 'win32') {
var shortcutFilter = filter('bin/*.cmd', { restore: true });
result = es.merge(result, gulp.src('resources/win32/bin/code.js', { base: 'resources/win32' }));

result = es.merge(result, gulp.src('resources/win32/bin/**', { base: 'resources/win32' }))
.pipe(shortcutFilter)
.pipe(rename(function (f) { f.basename = product.applicationName; }))
.pipe(shortcutFilter.restore);
result = es.merge(result, gulp.src('resources/win32/bin/code.cmd', { base: 'resources/win32' })
.pipe(replace('@@NAME@@', product.nameShort))
.pipe(rename(function (f) { f.basename = product.applicationName; })));

result = es.merge(result, gulp.src('resources/win32/bin/code.sh', { base: 'resources/win32' })
.pipe(replace('@@NAME@@', product.nameShort))
.pipe(rename(function (f) { f.basename = product.applicationName; f.extname = ''; })));
}

return result.pipe(symdest(destination));
Expand Down Expand Up @@ -307,7 +310,7 @@ gulp.task('clean-vscode-linux-arm', util.rimraf(path.join(path.dirname(root), 'V
gulp.task('clean-vscode-linux-ia32-deb', util.rimraf('.build/linux/i386'));
gulp.task('clean-vscode-linux-x64-deb', util.rimraf('.build/linux/amd64'));

gulp.task('vscode-win32', ['optimize-vscode', 'clean-vscode-win32'], packageTask('win32'));
gulp.task('vscode-win32', [/*'optimize-vscode', */'clean-vscode-win32'], packageTask('win32'));
gulp.task('vscode-darwin', ['optimize-vscode', 'clean-vscode-darwin'], packageTask('darwin'));
gulp.task('vscode-linux-ia32', ['optimize-vscode', 'clean-vscode-linux-ia32'], packageTask('linux', 'ia32'));
gulp.task('vscode-linux-x64', ['optimize-vscode', 'clean-vscode-linux-x64'], packageTask('linux', 'x64'));
Expand Down
16 changes: 11 additions & 5 deletions extensions/javascript-migration/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,23 @@
import * as vscode from 'vscode';
import * as cp from 'child_process';


export function activate(context: vscode.ExtensionContext) {
const releaseNotesShown = 'javascript.releasenotesshown';

if (!context.globalState.get(releaseNotesShown)) {
// cheating with nls, this is a temporary extenion only, that doesn't need be localized
vscode.window.showInformationMessage('The JavaScript infrastructure has changed, please read the change notes.', 'Change Notes').then(selection => {
if (selection) {
open('http://go.microsoft.com/fwlink/?LinkId=733559');
vscode.window.showInformationMessage(
'Our JavaScript support has been enhanced, would you like to view the Release Notes?',
'No',
'Yes'
).then(selection => {
switch (selection) {
case 'Yes':
open('http://go.microsoft.com/fwlink/?LinkId=733559');
case 'No':
context.globalState.update(releaseNotesShown, true);
break;
}
context.globalState.update(releaseNotesShown, true);
});
}
}
Expand Down
4 changes: 4 additions & 0 deletions extensions/javascript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@
{
"language": "javascript",
"path": "./snippets/javascript.json"
},
{
"language": "javascriptreact",
"path": "./snippets/javascriptreact.json"
}
],
"jsonValidation": [
Expand Down
141 changes: 141 additions & 0 deletions extensions/javascript/snippets/javascriptreact.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
{
"define module": {
"prefix": "define",
"body": [
"define([",
"\t'require',",
"\t'${dependency}'",
"], function(require, ${factory}) {",
"\t'use strict';",
"\t$0",
"});"
],
"description": "define module"
},
"For Loop": {
"prefix": "for",
"body": [
"for (var ${index} = 0; ${index} < ${array}.length; ${index}++) {",
"\tvar ${element} = ${array}[${index}];",
"\t$0",
"}"
],
"description": "For Loop"
},
"For-Each Loop": {
"prefix": "foreach",
"body": [
"${array}.forEach(function(${element}) {",
"\t$0",
"}, this);"
],
"description": "For-Each Loop"
},
"For-In Loop": {
"prefix": "forin",
"body": [
"for (var ${key} in ${object}) {",
"\tif (${object}.hasOwnProperty(${key})) {",
"\t\tvar ${element} = ${object}[${key}];",
"\t\t$0",
"\t}",
"}"
],
"description": "For-In Loop"
},
"Function Statement": {
"prefix": "function",
"body": [
"function ${name}(${params}) {",
"\t$0",
"}"
],
"description": "Function Statement"
},
"If Statement": {
"prefix": "if",
"body": [
"if (${condition}) {",
"\t$0",
"}"
],
"description": "If Statement"
},
"If-Else Statement": {
"prefix": "ifelse",
"body": [
"if (${condition}) {",
"\t$0",
"} else {",
"\t",
"}"
],
"description": "If-Else Statement"
},
"New Statement": {
"prefix": "new",
"body": [
"var ${name} = new ${type}(${arguments});$0"
],
"description": "New Statement"
},
"Switch Statement": {
"prefix": "switch",
"body": [
"switch (${key}) {",
"\tcase ${value}:",
"\t\t$0",
"\t\tbreak;",
"",
"\tdefault:",
"\t\tbreak;",
"}"
],
"description": "Switch Statement"
},
"While Statement": {
"prefix": "while",
"body": [
"while (${condition}) {",
"\t$0",
"}"
],
"description": "While Statement"
},
"Do-While Statement": {
"prefix": "dowhile",
"body": [
"do {",
"\t$0",
"} while (${condition});"
],
"description": "Do-While Statement"
},
"Try-Catch Statement":{
"prefix": "trycatch",
"body": [
"try {",
"\t$0",
"} catch (${error}) {",
"\t",
"}"
],
"description": "Try-Catch Statement"
},
"Set Timeout Function": {
"prefix": "settimeout",
"body": [
"setTimeout(function() {",
"\t$0",
"}, ${timeout});"
],
"description": "Set Timeout Function"
},
"Relative Reference to another File": {
"prefix": "reference",
"body": [
"/// <reference path=\"$1\" />$0"
],
"description": "Relative Reference to another File"
}
}
2 changes: 1 addition & 1 deletion extensions/node-debug/node-debug.azure.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"account": "monacobuild",
"container": "debuggers",
"zip": "ce36f92/node-debug.zip",
"zip": "568060b/node-debug.zip",
"output": ""
}
7 changes: 5 additions & 2 deletions extensions/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,11 @@
"commands": [
{
"command": "typescript.reloadProjects",
"title": "%typescript.reloadProjects.title%",
"category": "TypeScript"
"title": "%typescript.reloadProjects.title%"
},
{
"command": "javascript.reloadProjects",
"title": "%javascript.reloadProjects.title%"
}
],
"debuggers": [
Expand Down
3 changes: 2 additions & 1 deletion extensions/typescript/package.nls.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"typescript.reloadProjects.title": "Reload Project",
"typescript.reloadProjects.title": "Reload TypeScript Project",
"javascript.reloadProjects.title": "Reload JavaScript Project",
"configuration.typescript": "TypeScript configuration",
"typescript.useCodeSnippetsOnMethodSuggest.dec": "Complete functions with their parameter signature.",
"typescript.tsdk.desc": "Specifies the folder path containing the tsserver and lib*.d.ts files to use."
Expand Down
4 changes: 4 additions & 0 deletions extensions/typescript/src/typescriptMain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ export function activate(context: ExtensionContext): void {
clientHost.reloadProjects();
}));

context.subscriptions.push(commands.registerCommand('javascript.reloadProjects', () => {
clientHost.reloadProjects();
}));

window.onDidChangeActiveTextEditor(VersionStatus.showHideStatus, null, context.subscriptions);

// Register the supports for both TS and TSX so that we can have separate grammars but share the mode
Expand Down
2 changes: 1 addition & 1 deletion resources/win32/bin/code.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
setlocal
set VSCODE_DEV=
set ATOM_SHELL_INTERNAL_RUN_AS_NODE=1
"%~dp0..\\Code.exe" "%~dp0code.js" %*
call "%~dp0..\@@NAME@@.exe" "%~dp0..\resources\\app\\out\\cli.js" %*
endlocal
3 changes: 0 additions & 3 deletions resources/win32/bin/code.js

This file was deleted.

11 changes: 11 additions & 0 deletions resources/win32/bin/code.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
#
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.

NAME="@@NAME@@"
VSCODE_PATH="$(dirname "$(dirname "$(realpath "$0")")")"
ELECTRON="$VSCODE_PATH/$NAME.exe"
CLI="$VSCODE_PATH/resources/app/out/cli.js"
ELECTRON_NO_ATTACH_CONSOLE=1 ATOM_SHELL_INTERNAL_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@"
exit $?
19 changes: 15 additions & 4 deletions src/vs/base/browser/touch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export namespace EventType {
export const Change = '-monaco-gesturechange';
export const Start = '-monaco-gesturestart';
export const End = '-monaco-gesturesend';
export const Contextmenu = '-monaco-gesturecontextmenu';
}

interface TouchData {
Expand Down Expand Up @@ -64,7 +65,7 @@ interface TouchEvent extends Event {

export class Gesture implements IDisposable {

private static HOLD_DELAY = 2000;
private static HOLD_DELAY = 700;
private static SCROLL_FRICTION = -0.005;

private targetElement: HTMLElement;
Expand Down Expand Up @@ -160,16 +161,26 @@ export class Gesture implements IDisposable {
let data = this.activeTouches[touch.identifier],
holdTime = Date.now() - data.initialTimeStamp;

if (holdTime < Gesture.HOLD_DELAY &&
Math.abs(data.initialPageX - arrays.tail(data.rollingPageX)) < 30 &&
Math.abs(data.initialPageY - arrays.tail(data.rollingPageY)) < 30) {
if (holdTime < Gesture.HOLD_DELAY
&& Math.abs(data.initialPageX - arrays.tail(data.rollingPageX)) < 30
&& Math.abs(data.initialPageY - arrays.tail(data.rollingPageY)) < 30) {

let evt = Gesture.newGestureEvent(EventType.Tap);
evt.initialTarget = data.initialTarget;
evt.pageX = arrays.tail(data.rollingPageX);
evt.pageY = arrays.tail(data.rollingPageY);
this.targetElement.dispatchEvent(evt);

} else if (holdTime >= Gesture.HOLD_DELAY
&& Math.abs(data.initialPageX - arrays.tail(data.rollingPageX)) < 30
&& Math.abs(data.initialPageY - arrays.tail(data.rollingPageY)) < 30) {

let evt = Gesture.newGestureEvent(EventType.Contextmenu);
evt.initialTarget = data.initialTarget;
evt.pageX = arrays.tail(data.rollingPageX);
evt.pageY = arrays.tail(data.rollingPageY);
this.targetElement.dispatchEvent(evt);

} else if (activeTouchCount === 1) {
let finalX = arrays.tail(data.rollingPageX);
let finalY = arrays.tail(data.rollingPageY);
Expand Down
Loading

0 comments on commit dcefd51

Please sign in to comment.