Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for "whiteSpace" typo: Parameter name and word is one command word spelled "whitespace". #77758

Merged
merged 26 commits into from Jul 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions extensions/css-language-features/server/src/pathCompletion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@ function pathToReplaceRange(valueBeforeCursor: string, fullValue: string, fullVa
const valueAfterLastSlash = fullValue.slice(lastIndexOfSlash + 1);
const startPos = shiftPosition(fullValueRange.end, -valueAfterLastSlash.length);
// If whitespace exists, replace until it
const whiteSpaceIndex = valueAfterLastSlash.indexOf(' ');
const whitespaceIndex = valueAfterLastSlash.indexOf(' ');
let endPos;
if (whiteSpaceIndex !== -1) {
endPos = shiftPosition(startPos, whiteSpaceIndex);
if (whitespaceIndex !== -1) {
endPos = shiftPosition(startPos, whitespaceIndex);
} else {
endPos = fullValueRange.end;
}
Expand Down
8 changes: 4 additions & 4 deletions extensions/emmet/src/abbreviationActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ function doWrapping(individualLines: boolean, args: any) {

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,12 @@ function pathToSuggestion(p: string, valueBeforeCursor: string, fullValue: strin
// Find the last slash before cursor, and calculate the start of replace range from there
const valueAfterLastSlash = fullValue.slice(lastIndexOfSlash + 1);
const startPos = shiftPosition(range.end, -1 - valueAfterLastSlash.length);
// If whitespace exists, replace until it
const whiteSpaceIndex = valueAfterLastSlash.indexOf(' ');

// If whitespace exists, replace until there is no more
const whitespaceIndex = valueAfterLastSlash.indexOf(' ');
let endPos;
if (whiteSpaceIndex !== -1) {
endPos = shiftPosition(startPos, whiteSpaceIndex);
if (whitespaceIndex !== -1) {
endPos = shiftPosition(startPos, whitespaceIndex);
} else {
endPos = shiftPosition(range.end, -1);
}
Expand Down
2 changes: 1 addition & 1 deletion src/vs/base/browser/ui/list/listWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ class KeyboardController<T> implements IDisposable {
private view: ListView<T>,
options: IListOptions<T>
) {
const multipleSelectionSupport = !(options.multipleSelectionSupport === false);
const multipleSelectionSupport = options.multipleSelectionSupport !== false;
This conversation was marked as resolved.
Show resolved Hide resolved

this.openController = options.openController || DefaultOpenController;

Expand Down
2 changes: 1 addition & 1 deletion src/vs/base/browser/ui/list/rangeMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,4 +190,4 @@ export class RangeMap {
dispose() {
this.groups = null!; // StrictNullOverride: nulling out ok in dispose
}
}
}
1 change: 0 additions & 1 deletion src/vs/base/common/glob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,6 @@ function wrapRelativePattern(parsedPattern: ParsedStringPattern, arg2: string |
if (!extpath.isEqualOrParent(path, arg2.base)) {
return null;
}

return parsedPattern(paths.relative(arg2.base, path), basename);
};
}
Expand Down
8 changes: 4 additions & 4 deletions src/vs/base/common/json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,12 +374,12 @@ export function createScanner(text: string, ignoreTrivia: boolean = false): JSON

let code = text.charCodeAt(pos);
// trivia: whitespace
if (isWhiteSpace(code)) {
if (isWhitespace(code)) {
do {
pos++;
value += String.fromCharCode(code);
code = text.charCodeAt(pos);
} while (isWhiteSpace(code));
} while (isWhitespace(code));

return token = SyntaxKind.Trivia;
}
Expand Down Expand Up @@ -517,7 +517,7 @@ export function createScanner(text: string, ignoreTrivia: boolean = false): JSON
}

function isUnknownContentCharacter(code: CharacterCodes) {
if (isWhiteSpace(code) || isLineBreak(code)) {
if (isWhitespace(code) || isLineBreak(code)) {
return false;
}
switch (code) {
Expand Down Expand Up @@ -555,7 +555,7 @@ export function createScanner(text: string, ignoreTrivia: boolean = false): JSON
};
}

function isWhiteSpace(ch: number): boolean {
function isWhitespace(ch: number): boolean {
return ch === CharacterCodes.space || ch === CharacterCodes.tab || ch === CharacterCodes.verticalTab || ch === CharacterCodes.formFeed ||
ch === CharacterCodes.nonBreakingSpace || ch === CharacterCodes.ogham || ch >= CharacterCodes.enQuad && ch <= CharacterCodes.zeroWidthSpace ||
ch === CharacterCodes.narrowNoBreakSpace || ch === CharacterCodes.mathematicalSpace || ch === CharacterCodes.ideographicSpace || ch === CharacterCodes.byteOrderMark;
Expand Down
2 changes: 1 addition & 1 deletion src/vs/editor/common/config/commonEditorConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ const editorConfiguration: IConfigurationNode = {
'enum': ['none', 'boundary', 'selection', 'all'],
'enumDescriptions': [
'',
nls.localize('renderWhiteSpace.boundary', "Render whitespace characters except for single spaces between words."),
nls.localize('renderWhitespace.boundary', "Render whitespace characters except for single spaces between words."),
nls.localize('renderWhitespace.selection', "Render whitespace characters only on selected text."),
''
],
Expand Down
6 changes: 3 additions & 3 deletions src/vs/editor/contrib/indentation/indentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -589,13 +589,13 @@ export class AutoIndentOnPaste implements IEditorContribution {

private shouldIgnoreLine(model: ITextModel, lineNumber: number): boolean {
model.forceTokenization(lineNumber);
let nonWhiteSpaceColumn = model.getLineFirstNonWhitespaceColumn(lineNumber);
if (nonWhiteSpaceColumn === 0) {
let nonWhitespaceColumn = model.getLineFirstNonWhitespaceColumn(lineNumber);
if (nonWhitespaceColumn === 0) {
return true;
}
let tokens = model.getLineTokens(lineNumber);
if (tokens.getCount() > 0) {
let firstNonWhitespaceTokenIndex = tokens.findTokenIndexAtOffset(nonWhiteSpaceColumn);
let firstNonWhitespaceTokenIndex = tokens.findTokenIndexAtOffset(nonWhitespaceColumn);
if (firstNonWhitespaceTokenIndex >= 0 && tokens.getStandardTokenType(firstNonWhitespaceTokenIndex) === StandardTokenType.Comment) {
return true;
}
Expand Down
16 changes: 8 additions & 8 deletions src/vs/editor/test/browser/controller/cursorMoveCommand.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,23 +132,23 @@ suite('Cursor move command test', () => {
test('move to first non white space character of line from middle', () => {
moveTo(thisCursor, 1, 8);

moveToLineFirstNonWhiteSpaceCharacter(thisCursor);
moveToLineFirstNonWhitespaceCharacter(thisCursor);

cursorEqual(thisCursor, 1, 6);
});

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

moveToLineFirstNonWhiteSpaceCharacter(thisCursor);
moveToLineFirstNonWhitespaceCharacter(thisCursor);

cursorEqual(thisCursor, 1, 6);
});

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

moveToLineFirstNonWhiteSpaceCharacter(thisCursor);
moveToLineFirstNonWhitespaceCharacter(thisCursor);

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

moveToLineLastNonWhiteSpaceCharacter(thisCursor);
moveToLineLastNonWhitespaceCharacter(thisCursor);

cursorEqual(thisCursor, 1, 19);
});

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

moveToLineLastNonWhiteSpaceCharacter(thisCursor);
moveToLineLastNonWhitespaceCharacter(thisCursor);

cursorEqual(thisCursor, 1, 19);
});

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

moveToLineLastNonWhiteSpaceCharacter(thisCursor);
moveToLineLastNonWhitespaceCharacter(thisCursor);

cursorEqual(thisCursor, 1, 19);
});
Expand Down Expand Up @@ -415,7 +415,7 @@ function moveToLineStart(cursor: Cursor) {
move(cursor, { to: CursorMove.RawDirection.WrappedLineStart });
}

function moveToLineFirstNonWhiteSpaceCharacter(cursor: Cursor) {
function moveToLineFirstNonWhitespaceCharacter(cursor: Cursor) {
move(cursor, { to: CursorMove.RawDirection.WrappedLineFirstNonWhitespaceCharacter });
}

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

function moveToLineLastNonWhiteSpaceCharacter(cursor: Cursor) {
function moveToLineLastNonWhitespaceCharacter(cursor: Cursor) {
move(cursor, { to: CursorMove.RawDirection.WrappedLineLastNonWhitespaceCharacter });
}

Expand Down