Leading whitespace fixes

This commit is contained in:
Alex Dima 2015-11-19 12:56:08 +01:00
parent f4d81bc7e1
commit 8883fcd03b
84 changed files with 639 additions and 626 deletions

View file

@ -15,7 +15,6 @@ module.exports = function (opts) {
if (opts.whitespace) {
var lines = contents.split(/\r\n|\r|\n/);
var hadErrorLineNumber = 0;
for (var i = 0, len = lines.length; i < len; i++) {
var line = lines[i];
if (line.length === 0) {
@ -33,15 +32,9 @@ module.exports = function (opts) {
// empty line
continue;
} else {
// console.log(file.path + '(' + hadErrorLineNumber + ',1): Mixed whitespace indentation');
hadErrorLineNumber = i + 1;
break;
console.log(file.path + '(' + (i + 1) + ',1): Mixed whitespace indentation');
}
}
if (hadErrorLineNumber) {
console.log(file.path + '(' + hadErrorLineNumber + ',1): Mixed whitespace indentation');
}
}
} else {
var lines = contents.split(/\r\n|\r|\n/);

View file

@ -2,7 +2,7 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
'use strict';
'use strict';
import { workspace, TextDocument, TextDocumentChangeEvent, TextDocumentContentChangeEvent, Disposable } from 'vscode';
import * as Proto from '../protocol';

View file

@ -2,7 +2,7 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
'use strict';
'use strict';
import { workspace } from 'vscode';

View file

@ -2,7 +2,7 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
'use strict';
'use strict';
import { workspace, DefinitionProvider, TextDocument, Position, Range, CancellationToken, Location } from 'vscode';

View file

@ -2,7 +2,7 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
'use strict';
'use strict';
import { workspace, DocumentHighlightProvider, DocumentHighlight, DocumentHighlightKind, TextDocument, Position, Range, CancellationToken } from 'vscode';

View file

@ -2,7 +2,7 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
'use strict';
'use strict';
import { workspace, DocumentSymbolProvider, SymbolInformation, SymbolKind, TextDocument, Position, Range, CancellationToken } from 'vscode';

View file

@ -2,7 +2,7 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
'use strict';
'use strict';
import { workspace, DocumentRangeFormattingEditProvider, OnTypeFormattingEditProvider, FormattingOptions, TextDocument, Position, Range, CancellationToken, TextEdit } from 'vscode';

View file

@ -2,7 +2,7 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
'use strict';
'use strict';
import { workspace, HoverProvider, Hover, TextDocument, Position, Range, CancellationToken } from 'vscode';

View file

@ -2,7 +2,8 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
'use strict';
'use strict';
import * as Proto from '../protocol';

View file

@ -2,7 +2,7 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
'use strict';
'use strict';
import { workspace, ReferenceProvider, Location, TextDocument, Position, Range, CancellationToken } from 'vscode';

View file

@ -2,7 +2,7 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
'use strict';
'use strict';
import { workspace, RenameProvider, WorkspaceEdit, TextDocument, Position, Range, CancellationToken } from 'vscode';

View file

@ -2,7 +2,7 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
'use strict';
'use strict';
import { workspace, SignatureHelpProvider, SignatureHelp, SignatureInformation, ParameterInformation, TextDocument, Position, CancellationToken } from 'vscode';

View file

@ -2,7 +2,7 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
'use strict';
'use strict';
import { workspace, Uri, WorkspaceSymbolProvider, SymbolInformation, SymbolKind, TextDocument, Position, Range, CancellationToken } from 'vscode';

View file

@ -134,13 +134,32 @@ gulp.task('fix-eol-style', function() {
return gulp.src(LINE_FEED_FILES, { base: '.' }).pipe(style({})).pipe(gulp.dest('.'));
});
var WHITESPACE_FILES = LINE_FEED_FILES.concat([
'!**/lib/**'
'!**/lib/**',
'!**/*.d.ts',
'!extensions/typescript/server/**',
'!test/assert.js',
'!**/octicons/**',
'!**/vs/languages/sass/test/common/example.scss',
'!**/vs/languages/less/common/parser/less.grammar.txt',
'!**/vs/languages/css/common/buildscripts/css-schema.xml',
'!**/vs/languages/markdown/common/raw.marked.js',
'!**/vs/base/common/winjs.base.raw.js',
'!**/vs/base/node/terminateProcess.sh',
'!extensions/csharp-o/gulpfile.js',
'!**/vs/base/node/terminateProcess.sh',
'!**/vs/text.js',
'!**/vs/nls.js',
'!**/vs/css.js',
'!**/vs/loader.js',
'!extensions/**/snippets/**',
'!extensions/**/syntaxes/**',
'!extensions/**/themes/**',
]);
gulp.task('whitespace-style', function() {
return gulp.src(LINE_FEED_FILES).pipe(style({complain:true, whitespace:true}));
return gulp.src(WHITESPACE_FILES).pipe(style({complain:true, whitespace:true}));
});
gulp.task('fix-whitespace-style', function() {
return gulp.src(LINE_FEED_FILES, { base: '.' }).pipe(style({whitespace:true})).pipe(gulp.dest('.'));
return gulp.src(WHITESPACE_FILES, { base: '.' }).pipe(style({whitespace:true})).pipe(gulp.dest('.'));
});
gulp.task('copyrights', function() {

View file

@ -3,21 +3,21 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
.monaco-resource-viewer img {
.monaco-resource-viewer img {
border: 1px solid;
max-width: 100%;
max-height: 100%;
}
}
.vs .monaco-resource-viewer img {
.vs .monaco-resource-viewer img {
border-color: #F3F3F3;
}
}
.vs-dark .monaco-resource-viewer img {
.vs-dark .monaco-resource-viewer img {
border-color: #252526;
}
}
.monaco-resource-viewer video {
.monaco-resource-viewer video {
max-width: 100%;
max-height: 100%;
}
}

View file

@ -25,10 +25,10 @@ export function leftRotate(value: number, bits: number, totalBits: number = 32):
export function multiply64(a: number, b: number): number[] {
/* A1 A0 => A
B1 B0 => B
B0 * A1 B0 * A0
B1 * A1 B1 * A0
C3 C2 C1 C0 => C
* B1 B0 => B
* B0 * A1 B0 * A0
* B1 * A1 B1 * A0
* C3 C2 C1 C0 => C
*/
var a0 = a & 0xffff, a1 = a >>> 16;

View file

@ -121,23 +121,23 @@ export class Emitter<T> {
* Creates an Event which is backed-up by the event emitter. This allows
* to use the existing eventing pattern and is likely using less memeory.
* Sample:
class Document {
private _eventbus = new EventEmitter();
public onDidChange = fromEventEmitter(this._eventbus, 'changed');
// getter-style
// get onDidChange(): Event<(value:string)=>any> {
// cache fromEventEmitter result and return
// }
private _doIt() {
// ...
this._eventbus.emit('changed', value)
}
}
*
* class Document {
*
* private _eventbus = new EventEmitter();
*
* public onDidChange = fromEventEmitter(this._eventbus, 'changed');
*
* // getter-style
* // get onDidChange(): Event<(value:string)=>any> {
* // cache fromEventEmitter result and return
* // }
*
* private _doIt() {
* // ...
* this._eventbus.emit('changed', value)
* }
* }
*/
export function fromEventEmitter<T>(emitter: EventEmitter, eventType: string): Event<T> {
return function (listener: (e: T) => any, thisArgs?: any, disposables?: IDisposable[]): IDisposable {

View file

@ -2,7 +2,7 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
'use strict';
import NLS = require('vs/nls');

View file

@ -9,9 +9,9 @@
line-height: 19px;
color: #333;
/*
WORKAROUND:
Because of bug https://monacotools.visualstudio.com/DefaultCollection/Monaco/_workitems/edit/13254
we are *not* using the color white (or #ffffff, rgba(255,255,255)) but something very close to white.
* WORKAROUND:
* Because of bug https://monacotools.visualstudio.com/DefaultCollection/Monaco/_workitems/edit/13254
* we are *not* using the color white (or #ffffff, rgba(255,255,255)) but something very close to white.
*/
background: #fffffe;
}

View file

@ -99,7 +99,7 @@
}
/* Dark theme */
.monaco-editor.vs-dark .quickfix-widget {
.monaco-editor.vs-dark .quickfix-widget {
background-color: #2D2D30;
border: 1px solid rgb(69, 69, 69);
}
@ -110,7 +110,7 @@
/* High Contrast Theming */
.monaco-editor.hc-black .quickfix-widget {
.monaco-editor.hc-black .quickfix-widget {
background-color: #0C141F;
border: 2px solid #6FC3DF;
}

View file

@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
/* Suggest */
.monaco-editor .suggest-widget {
.monaco-editor .suggest-widget {
background-color: #F3F3F3;
font-size: 12px;
border: 1px solid rgb(200, 200, 200);
@ -145,7 +145,7 @@
}
/* Dark theme */
.monaco-editor.vs-dark .suggest-widget {
.monaco-editor.vs-dark .suggest-widget {
background-color: #2D2D30;
border: 1px solid rgb(69, 69, 69);
}
@ -190,7 +190,7 @@
/* High Contrast Theming */
.monaco-editor.hc-black .suggest-widget {
.monaco-editor.hc-black .suggest-widget {
background-color: #0C141F;
border: 2px solid #6FC3DF;
}

View file

@ -8,53 +8,53 @@
import {ILanguage} from './types';
/*
Ruby language definition
Quite a complex language due to elaborate escape sequences
and quoting of literate strings/regular expressions, and
an 'end' keyword that does not always apply to modifiers like until and while,
and a 'do' keyword that sometimes starts a block, but sometimes is part of
another statement (like 'while').
(1) end blocks:
'end' may end declarations like if or until, but sometimes 'if' or 'until'
are modifiers where there is no 'end'. Also, 'do' sometimes starts a block
that is ended by 'end', but sometimes it is part of a 'while', 'for', or 'until'
To do proper brace matching we do some elaborate state manipulation.
some examples:
until bla do
work until tired
list.each do
something if test
end
end
or
if test
something (if test then x end)
bar if bla
end
or, how about using class as a property..
class Test
def endpoint
self.class.endpoint || routes
end
end
(2) quoting:
there are many kinds of strings and escape sequences. But also, one can
start many string-like things as '%qx' where q specifies the kind of string
(like a command, escape expanded, regular expression, symbol etc.), and x is
some character and only another 'x' ends the sequence. Except for brackets
where the closing bracket ends the sequence.. and except for a nested bracket
inside the string like entity. Also, such strings can contain interpolated
ruby expressions again (and span multiple lines). Moreover, expanded
regular expression can also contain comments.
*/
* Ruby language definition
*
* Quite a complex language due to elaborate escape sequences
* and quoting of literate strings/regular expressions, and
* an 'end' keyword that does not always apply to modifiers like until and while,
* and a 'do' keyword that sometimes starts a block, but sometimes is part of
* another statement (like 'while').
*
* (1) end blocks:
* 'end' may end declarations like if or until, but sometimes 'if' or 'until'
* are modifiers where there is no 'end'. Also, 'do' sometimes starts a block
* that is ended by 'end', but sometimes it is part of a 'while', 'for', or 'until'
* To do proper brace matching we do some elaborate state manipulation.
* some examples:
*
* until bla do
* work until tired
* list.each do
* something if test
* end
* end
*
* or
*
* if test
* something (if test then x end)
* bar if bla
* end
*
* or, how about using class as a property..
*
* class Test
* def endpoint
* self.class.endpoint || routes
* end
* end
*
* (2) quoting:
* there are many kinds of strings and escape sequences. But also, one can
* start many string-like things as '%qx' where q specifies the kind of string
* (like a command, escape expanded, regular expression, symbol etc.), and x is
* some character and only another 'x' ends the sequence. Except for brackets
* where the closing bracket ends the sequence.. and except for a nested bracket
* inside the string like entity. Also, such strings can contain interpolated
* ruby expressions again (and span multiple lines). Moreover, expanded
* regular expression can also contain comments.
*/
export var language = <ILanguage> {
displayName: '',

View file

@ -245,9 +245,9 @@ class ServicesMap {
if (actualFirstServiceIndex !== Number.MAX_VALUE
&& actualFirstServiceIndex !== expectedFirstServiceIndex) {
let msg = `[createInstance] constructor '${descriptor.ctor.name}' has first\
service dependency at position ${actualFirstServiceIndex + 1} but is called with\
${expectedFirstServiceIndex - 1} static arguments that are expected to come first`;
let msg = `[createInstance] constructor '${descriptor.ctor.name}' has first` +
` service dependency at position ${actualFirstServiceIndex + 1} but is called with` +
` ${expectedFirstServiceIndex - 1} static arguments that are expected to come first`;
// throw new Error(msg);
console.warn(msg);

View file

@ -2,7 +2,7 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
'use strict';
import Errors = require('vs/base/common/errors');
import Types = require('vs/base/common/types');

View file

@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/* Editor Container Styles */
/* Editor Container Styles */
.monaco-workbench.vs .editor > .content.dragged {
background-color: #F3F3F3;
@ -17,7 +17,7 @@
border-right: 1px solid #444;
}
.monaco-workbench .editor > .content > .one-editor-container {
.monaco-workbench .editor > .content > .one-editor-container {
position: absolute;
/* use border box to be able to draw a border as separator between editors */

View file

@ -2,7 +2,7 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
'use strict';
import * as nls from 'vs/nls';
import * as Objects from 'vs/base/common/objects';