mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-01 09:35:41 -05:00
Merge from vscode 64980ea1f3f532c82bb6c28d27bba9ef2c5b4463 (#7206)
* Merge from vscode 64980ea1f3f532c82bb6c28d27bba9ef2c5b4463 * fix config changes * fix strictnull checks
This commit is contained in:
@@ -9,9 +9,21 @@ import * as dom from 'vs/base/browser/dom';
|
||||
import { Expression, Variable, Scope, StackFrame, Thread } from 'vs/workbench/contrib/debug/common/debugModel';
|
||||
import { MockSession } from 'vs/workbench/contrib/debug/test/common/mockDebug';
|
||||
import { HighlightedLabel } from 'vs/base/browser/ui/highlightedlabel/highlightedLabel';
|
||||
import { LinkDetector } from 'vs/workbench/contrib/debug/browser/linkDetector';
|
||||
import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock';
|
||||
import { workbenchInstantiationService } from 'vs/workbench/test/workbenchTestServices';
|
||||
const $ = dom.$;
|
||||
|
||||
suite('Debug - Base Debug View', () => {
|
||||
let linkDetector: LinkDetector;
|
||||
|
||||
/**
|
||||
* Instantiate services for use by the functions being tested.
|
||||
*/
|
||||
setup(() => {
|
||||
const instantiationService: TestInstantiationService = <TestInstantiationService>workbenchInstantiationService();
|
||||
linkDetector = instantiationService.createInstance(LinkDetector);
|
||||
});
|
||||
|
||||
test('replace whitespace', () => {
|
||||
assert.equal(replaceWhitespace('hey there'), 'hey there');
|
||||
@@ -36,7 +48,7 @@ suite('Debug - Base Debug View', () => {
|
||||
expression.available = true;
|
||||
expression.value = '"string value"';
|
||||
container = $('.container');
|
||||
renderExpressionValue(expression, container, { colorize: true });
|
||||
renderExpressionValue(expression, container, { colorize: true, linkDetector });
|
||||
assert.equal(container.className, 'value string');
|
||||
assert.equal(container.textContent, '"string value"');
|
||||
|
||||
@@ -48,8 +60,14 @@ suite('Debug - Base Debug View', () => {
|
||||
|
||||
expression.value = 'this is a long string';
|
||||
container = $('.container');
|
||||
renderExpressionValue(expression, container, { colorize: true, maxValueLength: 4 });
|
||||
renderExpressionValue(expression, container, { colorize: true, maxValueLength: 4, linkDetector });
|
||||
assert.equal(container.textContent, 'this...');
|
||||
|
||||
expression.value = process.platform === 'win32' ? 'C:\\foo.js:5' : '/foo.js:5';
|
||||
container = $('.container');
|
||||
renderExpressionValue(expression, container, { colorize: true, linkDetector });
|
||||
assert.ok(container.querySelector('a'));
|
||||
assert.equal(container.querySelector('a')!.textContent, expression.value);
|
||||
});
|
||||
|
||||
test.skip('render variable', () => { // {{SQL CARBON EDIT}} skip test
|
||||
@@ -58,7 +76,7 @@ suite('Debug - Base Debug View', () => {
|
||||
const stackFrame = new StackFrame(thread, 1, null!, 'app.js', 'normal', { startLineNumber: 1, startColumn: 1, endLineNumber: undefined!, endColumn: undefined! }, 0);
|
||||
const scope = new Scope(stackFrame, 1, 'local', 1, false, 10, 10);
|
||||
|
||||
let variable = new Variable(session, scope, 2, 'foo', 'bar.foo', undefined!, 0, 0, {}, 'string');
|
||||
let variable = new Variable(session, 1, scope, 2, 'foo', 'bar.foo', undefined!, 0, 0, {}, 'string');
|
||||
let expression = $('.');
|
||||
let name = $('.');
|
||||
let value = $('.');
|
||||
@@ -73,16 +91,24 @@ suite('Debug - Base Debug View', () => {
|
||||
expression = $('.');
|
||||
name = $('.');
|
||||
value = $('.');
|
||||
renderVariable(variable, { expression, name, value, label }, false, []);
|
||||
renderVariable(variable, { expression, name, value, label }, false, [], linkDetector);
|
||||
assert.equal(value.textContent, 'hey');
|
||||
assert.equal(label.element.textContent, 'foo:');
|
||||
assert.equal(label.element.title, 'string');
|
||||
|
||||
variable = new Variable(session, scope, 2, 'console', 'console', '5', 0, 0, { kind: 'virtual' });
|
||||
variable.value = process.platform === 'win32' ? 'C:\\foo.js:5' : '/foo.js:5';
|
||||
expression = $('.');
|
||||
name = $('.');
|
||||
value = $('.');
|
||||
renderVariable(variable, { expression, name, value, label }, false, []);
|
||||
renderVariable(variable, { expression, name, value, label }, false, [], linkDetector);
|
||||
assert.ok(value.querySelector('a'));
|
||||
assert.equal(value.querySelector('a')!.textContent, variable.value);
|
||||
|
||||
variable = new Variable(session, 1, scope, 2, 'console', 'console', '5', 0, 0, { kind: 'virtual' });
|
||||
expression = $('.');
|
||||
name = $('.');
|
||||
value = $('.');
|
||||
renderVariable(variable, { expression, name, value, label }, false, [], linkDetector);
|
||||
assert.equal(name.className, 'virtual');
|
||||
assert.equal(label.element.textContent, 'console:');
|
||||
assert.equal(label.element.title, 'console');
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
import * as assert from 'assert';
|
||||
import { URI as uri } from 'vs/base/common/uri';
|
||||
import severity from 'vs/base/common/severity';
|
||||
import { SimpleReplElement, DebugModel, Expression, RawObjectReplElement, StackFrame, Thread } from 'vs/workbench/contrib/debug/common/debugModel';
|
||||
import { DebugModel, Expression, StackFrame, Thread } from 'vs/workbench/contrib/debug/common/debugModel';
|
||||
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/browser/debugSession';
|
||||
import { ReplModel } from 'vs/workbench/contrib/debug/common/replModel';
|
||||
import { SimpleReplElement, RawObjectReplElement, ReplEvaluationInput, ReplModel } from 'vs/workbench/contrib/debug/common/replModel';
|
||||
import { IBreakpointUpdateData } from 'vs/workbench/contrib/debug/common/debug';
|
||||
import { NullOpenerService } from 'vs/platform/opener/common/opener';
|
||||
|
||||
@@ -24,7 +24,7 @@ suite('Debug - Model', () => {
|
||||
let rawSession: MockRawSession;
|
||||
|
||||
setup(() => {
|
||||
model = new DebugModel([], true, [], [], [], [], <any>{ isDirty: (e: any) => false });
|
||||
model = new DebugModel([], [], [], [], [], <any>{ isDirty: (e: any) => false });
|
||||
rawSession = new MockRawSession();
|
||||
});
|
||||
|
||||
@@ -348,9 +348,7 @@ suite('Debug - Model', () => {
|
||||
|
||||
assert.equal(replModel.getReplElements().length, 3);
|
||||
replModel.getReplElements().forEach(re => {
|
||||
assert.equal((<Expression>re).available, false);
|
||||
assert.equal((<Expression>re).name, 'myVariable');
|
||||
assert.equal((<Expression>re).reference, 0);
|
||||
assert.equal((<ReplEvaluationInput>re).value, 'myVariable');
|
||||
});
|
||||
|
||||
replModel.removeReplExpressions();
|
||||
|
||||
@@ -14,7 +14,7 @@ import Severity from 'vs/base/common/severity';
|
||||
|
||||
export class MockDebugService implements IDebugService {
|
||||
|
||||
public _serviceBrand: any;
|
||||
public _serviceBrand: undefined;
|
||||
|
||||
public get state(): State {
|
||||
throw new Error('not implemented');
|
||||
@@ -180,6 +180,10 @@ export class MockSession implements IDebugSession {
|
||||
return 'mockname';
|
||||
}
|
||||
|
||||
setName(name: string): void {
|
||||
throw new Error('not implemented');
|
||||
}
|
||||
|
||||
getSourceForUri(modelUri: uri): Source {
|
||||
throw new Error('not implemented');
|
||||
}
|
||||
@@ -204,6 +208,10 @@ export class MockSession implements IDebugSession {
|
||||
throw new Error('not implemented');
|
||||
}
|
||||
|
||||
get onDidChangeName(): Event<string> {
|
||||
throw new Error('not implemented');
|
||||
}
|
||||
|
||||
setConfiguration(configuration: { resolved: IConfig, unresolved: IConfig }) { }
|
||||
|
||||
getAllThreads(): IThread[] {
|
||||
@@ -256,7 +264,7 @@ export class MockSession implements IDebugSession {
|
||||
scopes(frameId: number): Promise<DebugProtocol.ScopesResponse> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
variables(variablesReference: number, filter: 'indexed' | 'named', start: number, count: number): Promise<DebugProtocol.VariablesResponse> {
|
||||
variables(variablesReference: number, threadId: number | undefined, filter: 'indexed' | 'named', start: number, count: number): Promise<DebugProtocol.VariablesResponse> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
evaluate(expression: string, frameId: number, context?: string): Promise<DebugProtocol.EvaluateResponse> {
|
||||
|
||||
Reference in New Issue
Block a user