Skip to content

Commit c342eaa

Browse files
committed
Adding more explicit returns
1 parent 2a82bcd commit c342eaa

65 files changed

Lines changed: 124 additions & 55 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/vs/base/parts/ipc/test/node/ipc.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ suite('IPC', () => {
2525

2626
test('createChannel', () => {
2727
if (process.env['VSCODE_PID']) {
28-
return; // TODO@Ben find out why test fails when run from within VS Code
28+
return undefined; // TODO@Ben find out why test fails when run from within VS Code
2929
}
3030

3131
const client = createClient();
@@ -42,7 +42,7 @@ suite('IPC', () => {
4242

4343
test('cancellation', () => {
4444
if (process.env['VSCODE_PID']) {
45-
return; // TODO@Ben find out why test fails when run from within VS Code
45+
return undefined; // TODO@Ben find out why test fails when run from within VS Code
4646
}
4747

4848
const client = createClient();
@@ -62,7 +62,7 @@ suite('IPC', () => {
6262

6363
test('events', () => {
6464
if (process.env['VSCODE_PID']) {
65-
return; // TODO@Ben find out why test fails when run from within VS Code
65+
return undefined; // TODO@Ben find out why test fails when run from within VS Code
6666
}
6767

6868
const client = createClient();
@@ -88,7 +88,7 @@ suite('IPC', () => {
8888

8989
test('event dispose', () => {
9090
if (process.env['VSCODE_PID']) {
91-
return; // TODO@Ben find out why test fails when run from within VS Code
91+
return undefined; // TODO@Ben find out why test fails when run from within VS Code
9292
}
9393

9494
const client = createClient();

src/vs/base/parts/tree/browser/treeDefaults.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ export class DefaultController implements _.IController {
352352
tree.focusParent(payload);
353353
return tree.reveal(tree.getFocus());
354354
}
355+
return undefined;
355356
}).done(null, errors.onUnexpectedError);
356357
}
357358
return true;
@@ -369,6 +370,7 @@ export class DefaultController implements _.IController {
369370
tree.focusFirstChild(payload);
370371
return tree.reveal(tree.getFocus());
371372
}
373+
return undefined;
372374
}).done(null, errors.onUnexpectedError);
373375
}
374376
return true;

src/vs/editor/browser/standalone/colorizer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export class Colorizer {
3232
let mimeType = options.mimeType || domNode.getAttribute('lang') || domNode.getAttribute('data-lang');
3333
if (!mimeType) {
3434
console.error('Mode not detected');
35-
return;
35+
return undefined;
3636
}
3737

3838
standaloneColorService.setTheme(theme);

src/vs/editor/browser/standalone/standaloneLanguages.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ export function registerHoverProvider(languageId: string, provider: modes.HoverP
239239

240240
return toThenable<modes.Hover>(provider.provideHover(model, position, token)).then((value) => {
241241
if (!value) {
242-
return;
242+
return undefined;
243243
}
244244
if (!value.range && word) {
245245
value.range = new Range(position.lineNumber, word.startColumn, position.column, word.endColumn);
@@ -621,7 +621,7 @@ class SuggestAdapter {
621621
result.incomplete = list.isIncomplete;
622622
} else if (!value) {
623623
// undefined and null are valid results
624-
return;
624+
return undefined;
625625
} else {
626626
// warn about everything else
627627
console.warn('INVALID result from completion provider. expected CompletionItem-array or CompletionList but got:', value);

src/vs/editor/common/controller/cursor.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ export class Cursor extends EventEmitter {
544544

545545
private _collapseDeleteCommands(rawCmds: editorCommon.ICommand[], isAutoWhitespaceCommand: boolean[]): boolean {
546546
if (rawCmds.length === 1) {
547-
return;
547+
return false;
548548
}
549549

550550
// Merge adjacent delete commands
@@ -560,7 +560,7 @@ export class Cursor extends EventEmitter {
560560
});
561561

562562
if (!allAreDeleteCommands) {
563-
return;
563+
return false;
564564
}
565565

566566
var commands = <ReplaceCommand[]>rawCmds;
@@ -595,6 +595,7 @@ export class Cursor extends EventEmitter {
595595
previousCursor = cursors[i];
596596
}
597597
}
598+
return false;
598599
}
599600

600601
private _internalExecuteCommands(commands: editorCommon.ICommand[], isAutoWhitespaceCommand: boolean[]): boolean {

src/vs/editor/common/model/modelLine.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,5 +755,6 @@ export class ModelLine {
755755
return i;
756756
}
757757
}
758+
return undefined;
758759
}
759760
}

src/vs/editor/common/modes/languageSelector.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,5 @@ export function score(selector: LanguageSelector, uri: URI, language: string): n
7777

7878
return Math.max(valueLanguage, valueScheme, valuePattern);
7979
}
80+
return undefined;
8081
}

src/vs/editor/common/modes/snippetsRegistry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class SnippetsRegistry implements ISnippetsRegistry {
7272
public getSnippetCompletions(model: ITokenizedModel, position: IPosition): ISuggestion[] {
7373
const languageId = model.getLanguageIdAtPosition(position.lineNumber, position.column);
7474
if (!this._snippets[languageId]) {
75-
return;
75+
return undefined;
7676
}
7777

7878
const result: ISnippetSuggestion[] = [];

src/vs/editor/common/services/bulkEdit.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ export function createBulkEdit(textModelResolverService: ITextModelResolverServi
310310
if (names) {
311311
return nls.localize('conflict', "These files have changed in the meantime: {0}", names.join(', '));
312312
}
313+
return undefined;
313314
}
314315

315316
function finish(): TPromise<ISelection> {

src/vs/editor/common/services/editorWorkerServiceImpl.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export class EditorWorkerServiceImpl implements IEditorWorkerService {
5252
if (configurationService.lookup<boolean>('editor.wordBasedSuggestions').value) {
5353
return this._workerManager.withWorker().then(client => client.textualSuggest(model.uri, position));
5454
}
55+
return undefined;
5556
}
5657
});
5758
this._registrations = [linkProvider, completionProvider];

0 commit comments

Comments
 (0)