mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-04 09:35:38 -05:00
Merge from vscode 8e0f348413f4f616c23a88ae30030efa85811973 (#6381)
* Merge from vscode 8e0f348413f4f616c23a88ae30030efa85811973 * disable strict null check
This commit is contained in:
@@ -11,8 +11,30 @@ import { TestInstantiationService } from 'vs/platform/instantiation/test/common/
|
||||
import { workbenchInstantiationService } from 'vs/workbench/test/workbenchTestServices';
|
||||
import { LinkDetector } from 'vs/workbench/contrib/debug/browser/linkDetector';
|
||||
import { Color, RGBA } from 'vs/base/common/color';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { TestThemeService, TestTheme } from 'vs/platform/theme/test/common/testThemeService';
|
||||
import { ansiColorMap } from 'vs/workbench/contrib/terminal/common/terminalColorRegistry';
|
||||
|
||||
suite('Debug - ANSI Handling', () => {
|
||||
|
||||
let linkDetector: LinkDetector;
|
||||
let themeService: IThemeService;
|
||||
|
||||
/**
|
||||
* Instantiate services for use by the functions being tested.
|
||||
*/
|
||||
setup(() => {
|
||||
const instantiationService: TestInstantiationService = <TestInstantiationService>workbenchInstantiationService();
|
||||
linkDetector = instantiationService.createInstance(LinkDetector);
|
||||
|
||||
const colors: { [id: string]: string; } = {};
|
||||
for (let color in ansiColorMap) {
|
||||
colors[color] = <any>ansiColorMap[color].defaults.dark;
|
||||
}
|
||||
const testTheme = new TestTheme(colors);
|
||||
themeService = new TestThemeService(testTheme);
|
||||
});
|
||||
|
||||
test('appendStylizedStringToContainer', () => {
|
||||
assert.equal('', '');
|
||||
});
|
||||
|
||||
@@ -10,11 +10,12 @@ import { SimpleReplElement, DebugModel, Expression, RawObjectReplElement, StackF
|
||||
import * as sinon from 'sinon';
|
||||
import { MockRawSession } from 'vs/workbench/contrib/debug/test/common/mockDebug';
|
||||
import { Source } from 'vs/workbench/contrib/debug/common/debugSource';
|
||||
import { DebugSession } from 'vs/workbench/contrib/debug/electron-browser/debugSession';
|
||||
import { DebugSession } from 'vs/workbench/contrib/debug/browser/debugSession';
|
||||
import { ReplModel } from 'vs/workbench/contrib/debug/common/replModel';
|
||||
import { IBreakpointUpdateData } from 'vs/workbench/contrib/debug/common/debug';
|
||||
|
||||
function createMockSession(model: DebugModel, name = 'mockSession', parentSession?: DebugSession | undefined): DebugSession {
|
||||
return new DebugSession({ resolved: { name, type: 'node', request: 'launch' }, unresolved: undefined }, undefined!, model, parentSession, undefined!, undefined!, undefined!, undefined!, undefined!, undefined!, undefined!, undefined!);
|
||||
return new DebugSession({ resolved: { name, type: 'node', request: 'launch' }, unresolved: undefined }, undefined!, model, parentSession, undefined!, undefined!, undefined!, undefined!, undefined!, undefined!, undefined!, undefined!, undefined!, undefined!);
|
||||
}
|
||||
|
||||
suite('Debug - Model', () => {
|
||||
@@ -63,8 +64,8 @@ suite('Debug - Model', () => {
|
||||
|
||||
assert.equal(model.getBreakpoints().length, 5);
|
||||
const bp = model.getBreakpoints()[0];
|
||||
const update: any = {};
|
||||
update[bp.getId()] = { lineNumber: 100 };
|
||||
const update = new Map<string, IBreakpointUpdateData>();
|
||||
update.set(bp.getId(), { lineNumber: 100 });
|
||||
model.updateBreakpoints(update);
|
||||
assert.equal(bp.lineNumber, 100);
|
||||
|
||||
@@ -153,20 +154,15 @@ suite('Debug - Model', () => {
|
||||
}]
|
||||
});
|
||||
|
||||
model.rawUpdate({
|
||||
sessionId: session.getId(),
|
||||
threads: [{
|
||||
id: threadId2,
|
||||
name: threadName2
|
||||
}]
|
||||
});
|
||||
|
||||
// Stopped event with all threads stopped
|
||||
model.rawUpdate({
|
||||
sessionId: session.getId(),
|
||||
threads: [{
|
||||
id: threadId1,
|
||||
name: threadName1
|
||||
}, {
|
||||
id: threadId2,
|
||||
name: threadName2
|
||||
}],
|
||||
stoppedDetails: {
|
||||
reason: stoppedReason,
|
||||
@@ -242,20 +238,15 @@ suite('Debug - Model', () => {
|
||||
}]
|
||||
});
|
||||
|
||||
model.rawUpdate({
|
||||
sessionId: session.getId(),
|
||||
threads: [{
|
||||
id: runningThreadId,
|
||||
name: runningThreadName
|
||||
}]
|
||||
});
|
||||
|
||||
// Stopped event with only one thread stopped
|
||||
model.rawUpdate({
|
||||
sessionId: session.getId(),
|
||||
threads: [{
|
||||
id: 1,
|
||||
name: stoppedThreadName
|
||||
}, {
|
||||
id: runningThreadId,
|
||||
name: runningThreadName
|
||||
}],
|
||||
stoppedDetails: {
|
||||
reason: stoppedReason,
|
||||
@@ -436,7 +427,7 @@ suite('Debug - Model', () => {
|
||||
// Repl output
|
||||
|
||||
test('repl output', () => {
|
||||
const session = new DebugSession({ resolved: { name: 'mockSession', type: 'node', request: 'launch' }, unresolved: undefined }, undefined!, model, undefined, undefined!, undefined!, undefined!, undefined!, undefined!, undefined!, undefined!, undefined!);
|
||||
const session = new DebugSession({ resolved: { name: 'mockSession', type: 'node', request: 'launch' }, unresolved: undefined }, undefined!, model, undefined, undefined!, undefined!, undefined!, undefined!, undefined!, undefined!, undefined!, undefined!, undefined!, undefined!);
|
||||
const repl = new ReplModel(session);
|
||||
repl.appendToRepl('first line\n', severity.Error);
|
||||
repl.appendToRepl('second line ', severity.Error);
|
||||
@@ -51,7 +51,9 @@ export class MockDebugService implements IDebugService {
|
||||
throw new Error('not implemented');
|
||||
}
|
||||
|
||||
public updateBreakpoints(uri: uri, data: { [id: string]: IBreakpointUpdateData }, sendOnResourceSaved: boolean): void { }
|
||||
public updateBreakpoints(uri: uri, data: Map<string, IBreakpointUpdateData>, sendOnResourceSaved: boolean): Promise<void> {
|
||||
throw new Error('not implemented');
|
||||
}
|
||||
|
||||
public enableOrDisableBreakpoints(enabled: boolean): Promise<void> {
|
||||
throw new Error('not implemented');
|
||||
@@ -287,6 +289,13 @@ export class MockSession implements IDebugSession {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
gotoTargets(source: DebugProtocol.Source, line: number, column?: number | undefined): Promise<DebugProtocol.GotoTargetsResponse> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
goto(threadId: number, targetId: number): Promise<DebugProtocol.GotoResponse> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
shutdown(): void { }
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import * as assert from 'assert';
|
||||
import { join, normalize } from 'vs/base/common/path';
|
||||
import * as platform from 'vs/base/common/platform';
|
||||
import { IDebugAdapterExecutable, IConfigurationManager, IConfig, IDebugSession } from 'vs/workbench/contrib/debug/common/debug';
|
||||
import { Debugger } from 'vs/workbench/contrib/debug/node/debugger';
|
||||
import { Debugger } from 'vs/workbench/contrib/debug/common/debugger';
|
||||
import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { ExecutableDebugAdapter } from 'vs/workbench/contrib/debug/node/debugAdapter';
|
||||
@@ -130,7 +130,7 @@ suite('Debug - Debugger', () => {
|
||||
const testResourcePropertiesService = new TestTextResourcePropertiesService(configurationService);
|
||||
|
||||
setup(() => {
|
||||
_debugger = new Debugger(configurationManager, debuggerContribution, extensionDescriptor0, configurationService, testResourcePropertiesService, undefined!, undefined!);
|
||||
_debugger = new Debugger(configurationManager, debuggerContribution, extensionDescriptor0, configurationService, testResourcePropertiesService, undefined!, undefined!, undefined!);
|
||||
});
|
||||
|
||||
teardown(() => {
|
||||
@@ -151,7 +151,7 @@ suite('Debug - Debugger', () => {
|
||||
const schemaAttribute = _debugger.getSchemaAttributes()![0];
|
||||
assert.notDeepEqual(schemaAttribute, debuggerContribution.configurationAttributes);
|
||||
Object.keys(debuggerContribution.configurationAttributes.launch).forEach(key => {
|
||||
assert.deepEqual(schemaAttribute[key], debuggerContribution.configurationAttributes.launch[key]);
|
||||
assert.deepEqual((<any>schemaAttribute)[key], (<any>debuggerContribution.configurationAttributes.launch)[key]);
|
||||
});
|
||||
|
||||
assert.equal(schemaAttribute['additionalProperties'], false);
|
||||
|
||||
Reference in New Issue
Block a user