Skip to content

Commit e89ea5c

Browse files
author
pi1024e
committed
Revert "respelling WhiteSpace as Whitespace, as Whitespace is one word"
This reverts commit d60b16c82e3ab83d6b1f2787a176d5a2e38b829b.
1 parent 467fe58 commit e89ea5c

4 files changed

Lines changed: 20 additions & 21 deletions

File tree

extensions/emmet/src/abbreviationActions.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ function doWrapping(individualLines: boolean, args: any) {
8484

8585
const firstLineOfSelection = editor.document.lineAt(rangeToReplace.start).text.substr(rangeToReplace.start.character);
8686
const matches = firstLineOfSelection.match(/^(\s*)/);
87-
const extraWhitespaveSelected = matches ? matches[1].length : 0;
88-
rangeToReplace = new vscode.Range(rangeToReplace.start.line, rangeToReplace.start.character + extraWhitespaveSelected, rangeToReplace.end.line, rangeToReplace.end.character);
87+
const extraWhiteSpaceSelected = matches ? matches[1].length : 0;
88+
rangeToReplace = new vscode.Range(rangeToReplace.start.line, rangeToReplace.start.character + extraWhiteSpaceSelected, rangeToReplace.end.line, rangeToReplace.end.character);
8989

9090
let textToWrapInPreview: string[];
9191
let textToReplace = editor.document.getText(rangeToReplace);
@@ -94,8 +94,8 @@ function doWrapping(individualLines: boolean, args: any) {
9494
} else {
9595
const wholeFirstLine = editor.document.lineAt(rangeToReplace.start).text;
9696
const otherMatches = wholeFirstLine.match(/^(\s*)/);
97-
const preceedingWhitespave = otherMatches ? otherMatches[1] : '';
98-
textToWrapInPreview = rangeToReplace.isSingleLine ? [textToReplace] : ['\n\t' + textToReplace.split('\n' + preceedingWhitespave).join('\n\t') + '\n'];
97+
const preceedingWhiteSpace = otherMatches ? otherMatches[1] : '';
98+
textToWrapInPreview = rangeToReplace.isSingleLine ? [textToReplace] : ['\n\t' + textToReplace.split('\n' + preceedingWhiteSpace).join('\n\t') + '\n'];
9999
}
100100
textToWrapInPreview = textToWrapInPreview.map(e => e.replace(/(\$\d)/g, '\\$1'));
101101

src/vs/base/common/json.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -374,12 +374,12 @@ export function createScanner(text: string, ignoreTrivia: boolean = false): JSON
374374

375375
let code = text.charCodeAt(pos);
376376
// trivia: whitespace
377-
if (isWhitespave(code)) {
377+
if (isWhiteSpace(code)) {
378378
do {
379379
pos++;
380380
value += String.fromCharCode(code);
381381
code = text.charCodeAt(pos);
382-
} while (isWhitespave(code));
382+
} while (isWhiteSpace(code));
383383

384384
return token = SyntaxKind.Trivia;
385385
}
@@ -517,7 +517,7 @@ export function createScanner(text: string, ignoreTrivia: boolean = false): JSON
517517
}
518518

519519
function isUnknownContentCharacter(code: CharacterCodes) {
520-
if (isWhitespave(code) || isLineBreak(code)) {
520+
if (isWhiteSpace(code) || isLineBreak(code)) {
521521
return false;
522522
}
523523
switch (code) {
@@ -530,9 +530,8 @@ export function createScanner(text: string, ignoreTrivia: boolean = false): JSON
530530
case CharacterCodes.comma:
531531
case CharacterCodes.slash:
532532
return false;
533-
default:
534-
return true;
535533
}
534+
return true;
536535
}
537536

538537

@@ -556,7 +555,7 @@ export function createScanner(text: string, ignoreTrivia: boolean = false): JSON
556555
};
557556
}
558557

559-
function isWhitespave(ch: number): boolean {
558+
function isWhiteSpace(ch: number): boolean {
560559
return ch === CharacterCodes.space || ch === CharacterCodes.tab || ch === CharacterCodes.verticalTab || ch === CharacterCodes.formFeed ||
561560
ch === CharacterCodes.nonBreakingSpace || ch === CharacterCodes.ogham || ch >= CharacterCodes.enQuad && ch <= CharacterCodes.zeroWidthSpace ||
562561
ch === CharacterCodes.narrowNoBreakSpace || ch === CharacterCodes.mathematicalSpace || ch === CharacterCodes.ideographicSpace || ch === CharacterCodes.byteOrderMark;

src/vs/editor/contrib/indentation/indentation.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -589,13 +589,13 @@ export class AutoIndentOnPaste implements IEditorContribution {
589589

590590
private shouldIgnoreLine(model: ITextModel, lineNumber: number): boolean {
591591
model.forceTokenization(lineNumber);
592-
let nonWhitespaveColumn = model.getLineFirstNonWhitespaceColumn(lineNumber);
593-
if (nonWhitespaveColumn === 0) {
592+
let nonWhiteSpaceColumn = model.getLineFirstNonWhitespaceColumn(lineNumber);
593+
if (nonWhiteSpaceColumn === 0) {
594594
return true;
595595
}
596596
let tokens = model.getLineTokens(lineNumber);
597597
if (tokens.getCount() > 0) {
598-
let firstNonWhitespaceTokenIndex = tokens.findTokenIndexAtOffset(nonWhitespaveColumn);
598+
let firstNonWhitespaceTokenIndex = tokens.findTokenIndexAtOffset(nonWhiteSpaceColumn);
599599
if (firstNonWhitespaceTokenIndex >= 0 && tokens.getStandardTokenType(firstNonWhitespaceTokenIndex) === StandardTokenType.Comment) {
600600
return true;
601601
}

src/vs/editor/test/browser/controller/cursorMoveCommand.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,23 +132,23 @@ suite('Cursor move command test', () => {
132132
test('move to first non white space character of line from middle', () => {
133133
moveTo(thisCursor, 1, 8);
134134

135-
moveToLineFirstNonWhitespaveCharacter(thisCursor);
135+
moveToLineFirstNonWhiteSpaceCharacter(thisCursor);
136136

137137
cursorEqual(thisCursor, 1, 6);
138138
});
139139

140140
test('move to first non white space character of line from first non white space character', () => {
141141
moveTo(thisCursor, 1, 6);
142142

143-
moveToLineFirstNonWhitespaveCharacter(thisCursor);
143+
moveToLineFirstNonWhiteSpaceCharacter(thisCursor);
144144

145145
cursorEqual(thisCursor, 1, 6);
146146
});
147147

148148
test('move to first non white space character of line from first character', () => {
149149
moveTo(thisCursor, 1, 1);
150150

151-
moveToLineFirstNonWhitespaveCharacter(thisCursor);
151+
moveToLineFirstNonWhiteSpaceCharacter(thisCursor);
152152

153153
cursorEqual(thisCursor, 1, 6);
154154
});
@@ -180,23 +180,23 @@ suite('Cursor move command test', () => {
180180
test('move to last non white space character from middle', () => {
181181
moveTo(thisCursor, 1, 8);
182182

183-
moveToLineLastNonWhitespaveCharacter(thisCursor);
183+
moveToLineLastNonWhiteSpaceCharacter(thisCursor);
184184

185185
cursorEqual(thisCursor, 1, 19);
186186
});
187187

188188
test('move to last non white space character from last non white space character', () => {
189189
moveTo(thisCursor, 1, 19);
190190

191-
moveToLineLastNonWhitespaveCharacter(thisCursor);
191+
moveToLineLastNonWhiteSpaceCharacter(thisCursor);
192192

193193
cursorEqual(thisCursor, 1, 19);
194194
});
195195

196196
test('move to last non white space character from line end', () => {
197197
moveTo(thisCursor, 1, 21);
198198

199-
moveToLineLastNonWhitespaveCharacter(thisCursor);
199+
moveToLineLastNonWhiteSpaceCharacter(thisCursor);
200200

201201
cursorEqual(thisCursor, 1, 19);
202202
});
@@ -415,7 +415,7 @@ function moveToLineStart(cursor: Cursor) {
415415
move(cursor, { to: CursorMove.RawDirection.WrappedLineStart });
416416
}
417417

418-
function moveToLineFirstNonWhitespaveCharacter(cursor: Cursor) {
418+
function moveToLineFirstNonWhiteSpaceCharacter(cursor: Cursor) {
419419
move(cursor, { to: CursorMove.RawDirection.WrappedLineFirstNonWhitespaceCharacter });
420420
}
421421

@@ -427,7 +427,7 @@ function moveToLineEnd(cursor: Cursor) {
427427
move(cursor, { to: CursorMove.RawDirection.WrappedLineEnd });
428428
}
429429

430-
function moveToLineLastNonWhitespaveCharacter(cursor: Cursor) {
430+
function moveToLineLastNonWhiteSpaceCharacter(cursor: Cursor) {
431431
move(cursor, { to: CursorMove.RawDirection.WrappedLineLastNonWhitespaceCharacter });
432432
}
433433

0 commit comments

Comments
 (0)