Merge from vscode c58aaab8a1cc22a7139b761166a0d4f37d41e998 (#7880)

* Merge from vscode c58aaab8a1cc22a7139b761166a0d4f37d41e998

* fix pipelines

* fix strict-null-checks

* add missing files
This commit is contained in:
Anthony Dresser
2019-10-21 22:12:22 -07:00
committed by GitHub
parent 7c9be74970
commit 1e22f47304
913 changed files with 18898 additions and 16536 deletions

View File

@@ -51,7 +51,7 @@ export class BracketSelectionRangeProvider implements SelectionRangeProvider {
setTimeout(() => BracketSelectionRangeProvider._bracketsRightYield(resolve, round + 1, model, pos, ranges));
break;
}
const key = bracket.close;
const key = bracket.close[0];
if (bracket.isOpen) {
// wait for closing
let val = counts.has(key) ? counts.get(key)! : 0;
@@ -96,7 +96,7 @@ export class BracketSelectionRangeProvider implements SelectionRangeProvider {
setTimeout(() => BracketSelectionRangeProvider._bracketsLeftYield(resolve, round + 1, model, pos, ranges, bucket));
break;
}
const key = bracket.close;
const key = bracket.close[0];
if (!bracket.isOpen) {
// wait for opening
let val = counts.has(key) ? counts.get(key)! : 0;

View File

@@ -47,10 +47,10 @@ class SelectionRanges {
class SmartSelectController implements IEditorContribution {
private static readonly _id = 'editor.contrib.smartSelectController';
public static readonly ID = 'editor.contrib.smartSelectController';
static get(editor: ICodeEditor): SmartSelectController {
return editor.getContribution<SmartSelectController>(SmartSelectController._id);
return editor.getContribution<SmartSelectController>(SmartSelectController.ID);
}
private readonly _editor: ICodeEditor;
@@ -67,10 +67,6 @@ class SmartSelectController implements IEditorContribution {
dispose(this._selectionListener);
}
getId(): string {
return SmartSelectController._id;
}
run(forward: boolean): Promise<void> | void {
if (!this._editor.hasModel()) {
return;
@@ -210,7 +206,7 @@ class ShrinkSelectionAction extends AbstractSmartSelect {
}
}
registerEditorContribution(SmartSelectController);
registerEditorContribution(SmartSelectController.ID, SmartSelectController);
registerEditorAction(GrowSelectionAction);
registerEditorAction(ShrinkSelectionAction);

View File

@@ -12,33 +12,11 @@ import { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageCo
import { ModelServiceImpl } from 'vs/editor/common/services/modelServiceImpl';
import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService';
import { javascriptOnEnterRules } from 'vs/editor/test/common/modes/supports/javascriptOnEnterRules';
import { ITextResourcePropertiesService } from 'vs/editor/common/services/resourceConfiguration';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { isLinux, isMacintosh } from 'vs/base/common/platform';
import { BracketSelectionRangeProvider } from 'vs/editor/contrib/smartSelect/bracketSelections';
import { provideSelectionRanges } from 'vs/editor/contrib/smartSelect/smartSelect';
import { CancellationToken } from 'vs/base/common/cancellation';
import { WordSelectionRangeProvider } from 'vs/editor/contrib/smartSelect/wordSelections';
class TestTextResourcePropertiesService implements ITextResourcePropertiesService {
_serviceBrand: undefined;
constructor(
@IConfigurationService private readonly configurationService: IConfigurationService,
) {
}
getEOL(resource: URI | undefined): string {
const filesConfiguration = this.configurationService.getValue<{ eol: string }>('files');
if (filesConfiguration && filesConfiguration.eol) {
if (filesConfiguration.eol !== 'auto') {
return filesConfiguration.eol;
}
}
return (isLinux || isMacintosh) ? '\n' : '\r\n';
}
}
import { TestTextResourcePropertiesService } from 'vs/editor/test/common/services/modelService.test';
class MockJSMode extends MockMode {