Merge from vscode 8e0f348413f4f616c23a88ae30030efa85811973 (#6381)

* Merge from vscode 8e0f348413f4f616c23a88ae30030efa85811973

* disable strict null check
This commit is contained in:
Anthony Dresser
2019-07-15 22:35:46 -07:00
committed by GitHub
parent f720ec642f
commit 0b7e7ddbf9
2406 changed files with 59140 additions and 35464 deletions

View File

@@ -18,7 +18,6 @@ import { ExtHostLanguageFeatures } from 'vs/workbench/api/common/extHostLanguage
import { MainThreadLanguageFeatures } from 'vs/workbench/api/browser/mainThreadLanguageFeatures';
import { ExtHostCommands } from 'vs/workbench/api/common/extHostCommands';
import { MainThreadCommands } from 'vs/workbench/api/browser/mainThreadCommands';
import { IHeapService, NullHeapService } from 'vs/workbench/services/heap/common/heap';
import { ExtHostDocuments } from 'vs/workbench/api/common/extHostDocuments';
import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors';
import { getDocumentSymbols } from 'vs/editor/contrib/quickOpen/quickOpen';
@@ -37,7 +36,6 @@ import { getDocumentFormattingEditsUntilResult, getDocumentRangeFormattingEditsU
import { getLinks } from 'vs/editor/contrib/links/getLinks';
import { MainContext, ExtHostContext } from 'vs/workbench/api/common/extHost.protocol';
import { ExtHostDiagnostics } from 'vs/workbench/api/common/extHostDiagnostics';
import { ExtHostHeapService } from 'vs/workbench/api/common/extHostHeapService';
import * as vscode from 'vscode';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { NullLogService } from 'vs/platform/log/common/log';
@@ -81,7 +79,6 @@ suite('ExtHostLanguageFeatures', function () {
{
let instantiationService = new TestInstantiationService();
instantiationService.stub(IMarkerService, MarkerService);
instantiationService.stub(IHeapService, NullHeapService);
inst = instantiationService;
}
@@ -102,16 +99,14 @@ suite('ExtHostLanguageFeatures', function () {
const extHostDocuments = new ExtHostDocuments(rpcProtocol, extHostDocumentsAndEditors);
rpcProtocol.set(ExtHostContext.ExtHostDocuments, extHostDocuments);
const heapService = new ExtHostHeapService();
const commands = new ExtHostCommands(rpcProtocol, heapService, new NullLogService());
const commands = new ExtHostCommands(rpcProtocol, new NullLogService());
rpcProtocol.set(ExtHostContext.ExtHostCommands, commands);
rpcProtocol.set(MainContext.MainThreadCommands, inst.createInstance(MainThreadCommands, rpcProtocol));
const diagnostics = new ExtHostDiagnostics(rpcProtocol);
rpcProtocol.set(ExtHostContext.ExtHostDiagnostics, diagnostics);
extHost = new ExtHostLanguageFeatures(rpcProtocol, null, extHostDocuments, commands, heapService, diagnostics, new NullLogService());
extHost = new ExtHostLanguageFeatures(rpcProtocol, null, extHostDocuments, commands, diagnostics, new NullLogService());
rpcProtocol.set(ExtHostContext.ExtHostLanguageFeatures, extHost);
mainThread = rpcProtocol.set(MainContext.MainThreadLanguageFeatures, inst.createInstance(MainThreadLanguageFeatures, rpcProtocol));
@@ -194,7 +189,7 @@ suite('ExtHostLanguageFeatures', function () {
await rpcProtocol.sync();
const value = await getCodeLensData(model, CancellationToken.None);
assert.equal(value.length, 1);
assert.equal(value.lenses.length, 1);
});
test('CodeLens, do not resolve a resolved lens', async () => {
@@ -212,8 +207,8 @@ suite('ExtHostLanguageFeatures', function () {
await rpcProtocol.sync();
const value = await getCodeLensData(model, CancellationToken.None);
assert.equal(value.length, 1);
const data = value[0];
assert.equal(value.lenses.length, 1);
const [data] = value.lenses;
const symbol = await Promise.resolve(data.provider.resolveCodeLens!(model, data.symbol, CancellationToken.None));
assert.equal(symbol!.command!.id, 'id');
assert.equal(symbol!.command!.title, 'Title');
@@ -229,8 +224,8 @@ suite('ExtHostLanguageFeatures', function () {
await rpcProtocol.sync();
const value = await getCodeLensData(model, CancellationToken.None);
assert.equal(value.length, 1);
let data = value[0];
assert.equal(value.lenses.length, 1);
let [data] = value.lenses;
const symbol = await Promise.resolve(data.provider.resolveCodeLens!(model, data.symbol, CancellationToken.None));
assert.equal(symbol!.command!.id, 'missing');
assert.equal(symbol!.command!.title, '!!MISSING: command!!');
@@ -1041,7 +1036,9 @@ suite('ExtHostLanguageFeatures', function () {
disposables.push(extHost.registerDocumentLinkProvider(defaultExtension, defaultSelector, new class implements vscode.DocumentLinkProvider {
provideDocumentLinks() {
return [new types.DocumentLink(new types.Range(0, 0, 1, 1), URI.parse('foo:bar#3'))];
const link = new types.DocumentLink(new types.Range(0, 0, 1, 1), URI.parse('foo:bar#3'));
link.tooltip = 'tooltip';
return [link];
}
}));
@@ -1051,6 +1048,7 @@ suite('ExtHostLanguageFeatures', function () {
let [first] = links;
assert.equal(first.url, 'foo:bar#3');
assert.deepEqual(first.range, { startLineNumber: 1, startColumn: 1, endLineNumber: 2, endColumn: 2 });
assert.equal(first.tooltip, 'tooltip');
});
test('Links, evil provider', async () => {