Refresh master with initial release/0.24 snapshot (#332)

* Initial port of release/0.24 source code

* Fix additional headers

* Fix a typo in launch.json
This commit is contained in:
Karl Burtram
2017-12-15 15:38:57 -08:00
committed by GitHub
parent 271b3a0b82
commit 6ad0df0e3e
7118 changed files with 107999 additions and 56466 deletions

View File

@@ -55,7 +55,7 @@ suite('ExtHostAccountManagement', () => {
displayInfo: {
displayName: 'Test Account',
contextualDisplayName: 'Test Kind Of Account',
contextualLogo: { light: '', dark: '' }
accountType: 'test'
},
isStale: false
};

View File

@@ -52,78 +52,59 @@ suite('ExtHostDataProtocol', function () {
suiteSetup(() => {
threadService = new TestThreadService();
let instantiationService = new TestInstantiationService();
instantiationService.stub(IThreadService, threadService);
instantiationService.stub(IMarkerService, MarkerService);
instantiationService.stub(IHeapService, {
_serviceBrand: undefined,
trackRecursive(args) {
// nothing
return args;
}
});
// threadService = new TestThreadService();
// let instantiationService = new TestInstantiationService();
// instantiationService.stub(IThreadService, threadService);
// instantiationService.stub(IMarkerService, MarkerService);
// instantiationService.stub(IHeapService, {
// _serviceBrand: undefined,
// trackRecursive(args) {
// // nothing
// return args;
// }
// });
originalErrorHandler = errorHandler.getUnexpectedErrorHandler();
setUnexpectedErrorHandler(() => { });
// originalErrorHandler = errorHandler.getUnexpectedErrorHandler();
// setUnexpectedErrorHandler(() => { });
const extHostDocumentsAndEditors = new ExtHostDocumentsAndEditors(threadService);
extHostDocumentsAndEditors.$acceptDocumentsAndEditorsDelta({
addedDocuments: [{
isDirty: false,
versionId: model.getVersionId(),
modeId: model.getLanguageIdentifier().language,
url: model.uri,
lines: model.getValue().split(model.getEOL()),
EOL: model.getEOL(),
}]
});
const extHostDocuments = new ExtHostDocuments(threadService, extHostDocumentsAndEditors);
threadService.set(ExtHostContext.ExtHostDocuments, extHostDocuments);
// const extHostDocumentsAndEditors = new ExtHostDocumentsAndEditors(threadService);
// extHostDocumentsAndEditors.$acceptDocumentsAndEditorsDelta({
// addedDocuments: [{
// isDirty: false,
// versionId: model.getVersionId(),
// modeId: model.getLanguageIdentifier().language,
// url: model.uri,
// lines: model.getValue().split(model.getEOL()),
// EOL: model.getEOL(),
// }]
// });
// const extHostDocuments = new ExtHostDocuments(threadService, extHostDocumentsAndEditors);
// threadService.set(ExtHostContext.ExtHostDocuments, extHostDocuments);
const heapService = new ExtHostHeapService();
// const heapService = new ExtHostHeapService();
const commands = new ExtHostCommands(threadService, heapService);
threadService.set(ExtHostContext.ExtHostCommands, commands);
threadService.setTestInstance(MainContext.MainThreadCommands, instantiationService.createInstance(MainThreadCommands));
// const commands = new ExtHostCommands(threadService, heapService);
// threadService.set(ExtHostContext.ExtHostCommands, commands);
// threadService.setTestInstance(MainContext.MainThreadCommands, instantiationService.createInstance(MainThreadCommands));
const diagnostics = new ExtHostDiagnostics(threadService);
threadService.set(ExtHostContext.ExtHostDiagnostics, diagnostics);
// const diagnostics = new ExtHostDiagnostics(threadService);
// threadService.set(ExtHostContext.ExtHostDiagnostics, diagnostics);
extHost = new ExtHostDataProtocol(threadService);
threadService.set(SqlExtHostContext.ExtHostDataProtocol, extHost);
// extHost = new ExtHostDataProtocol(threadService);
// threadService.set(SqlExtHostContext.ExtHostDataProtocol, extHost);
});
suiteTeardown(() => {
setUnexpectedErrorHandler(originalErrorHandler);
model.dispose();
// setUnexpectedErrorHandler(originalErrorHandler);
// model.dispose();
});
teardown(function () {
while (disposables.length) {
disposables.pop().dispose();
}
return threadService.sync();
// while (disposables.length) {
// disposables.pop().dispose();
// }
// return threadService.sync();
});
// --- outline
test('DataProvider, language flavor changed', function () {
assert.equal(DocumentSymbolProviderRegistry.all(model).length, 0);
let expectedParams = <data.DidChangeLanguageFlavorParams> {
uri: 'myuri',
language: 'sql'
};
let actualParams: data.DidChangeLanguageFlavorParams = undefined;
extHost.onDidChangeLanguageFlavor((e => {
actualParams = e;
}));
extHost.$languageFlavorChanged(expectedParams);
assert.ok(actualParams !== undefined);
assert.equal(actualParams.uri, expectedParams.uri);
assert.equal(actualParams.flavor, expectedParams.flavor);
assert.equal(actualParams.language, expectedParams.language);
});
});