Leading whitespace fixes
This commit is contained in:
parent
f4d81bc7e1
commit
8883fcd03b
|
@ -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/);
|
||||
|
|
|
@ -2,6 +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';
|
||||
|
||||
import * as Proto from '../protocol';
|
||||
|
|
25
gulpfile.js
25
gulpfile.js
|
@ -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() {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -8,52 +8,52 @@
|
|||
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> {
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue