Skip to content

Commit 16b384f

Browse files
committed
lint
1 parent c03893e commit 16b384f

File tree

3 files changed

+32
-11
lines changed

3 files changed

+32
-11
lines changed

src/phpDebug.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1535,7 +1535,7 @@ class PhpDebugSession extends vscode.DebugSession {
15351535
}
15361536
} else {
15371537
let property = this.getPropertyFromReference(args.variablesReference)
1538-
let ctx
1538+
let ctx: xdebug.Context[]
15391539
if (!property) {
15401540
// try to get variable
15411541
ctx = await stackFrame.getContexts() // TODO CACHE THIS

src/test/adapter.ts

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,6 @@ describe('PHP Debug Adapter', () => {
831831
await client.configurationDoneRequest()
832832
const { frame } = await assertStoppedLocation('breakpoint', program, 19)
833833

834-
835834
interface TestCase {
836835
context: string
837836
expression: string
@@ -845,12 +844,22 @@ describe('PHP Debug Adapter', () => {
845844
{ context: 'hover', expression: '$anArray', result: 'array(3)', hasVariablesReference: true },
846845
{ context: 'clipboard', expression: '$anInt', result: '123', hasVariablesReference: false },
847846
{ context: 'clipboard', expression: '$aString', result: "'123'", hasVariablesReference: false },
848-
{ context: 'clipboard', expression: '$anArray', result: 'array (\n 0 => 1,\n test => 2,\n test2 => \n array (\n t => 123,\n ),\n)', hasVariablesReference: false },
847+
{
848+
context: 'clipboard',
849+
expression: '$anArray',
850+
result: 'array (\n 0 => 1,\n test => 2,\n test2 => \n array (\n t => 123,\n ),\n)',
851+
hasVariablesReference: false,
852+
},
849853
{ context: 'clipboard-json', expression: '$anInt', result: '123', hasVariablesReference: false },
850-
{ context: 'clipboard-json', expression: '$aString', result: "\"123\"", hasVariablesReference: false },
851-
{ context: 'clipboard-json', expression: '$anArray', result: '{\n "0": 1,\n "test": 2,\n "test2": {\n "t": 123\n }\n}', hasVariablesReference: false },
854+
{ context: 'clipboard-json', expression: '$aString', result: '"123"', hasVariablesReference: false },
855+
{
856+
context: 'clipboard-json',
857+
expression: '$anArray',
858+
result: '{\n "0": 1,\n "test": 2,\n "test2": {\n "t": 123\n }\n}',
859+
hasVariablesReference: false,
860+
},
852861
{ context: 'clipboard-raw', expression: '$anInt', result: '123', hasVariablesReference: false },
853-
{ context: 'clipboard-raw', expression: '$aString', result: "123", hasVariablesReference: false },
862+
{ context: 'clipboard-raw', expression: '$aString', result: '123', hasVariablesReference: false },
854863
{ context: 'clipboard-raw', expression: '$anArray', result: 'array(3)', hasVariablesReference: false },
855864
]
856865

@@ -863,13 +872,25 @@ describe('PHP Debug Adapter', () => {
863872
})
864873
).body
865874

866-
assert.equal(response.result, testCase.result, `Failed for ${testCase.context} - ${testCase.expression}`)
875+
assert.equal(
876+
response.result,
877+
testCase.result,
878+
`Failed for ${testCase.context} - ${testCase.expression}`
879+
)
867880
if (testCase.hasVariablesReference) {
868-
assert.notEqual(response.variablesReference, 0, `Expected variablesReference for ${testCase.context} - ${testCase.expression}`)
881+
assert.notEqual(
882+
response.variablesReference,
883+
0,
884+
`Expected variablesReference for ${testCase.context} - ${testCase.expression}`
885+
)
869886
} else {
870-
assert.equal(response.variablesReference, 0, `Unexpected variablesReference for ${testCase.context} - ${testCase.expression}`)
887+
assert.equal(
888+
response.variablesReference,
889+
0,
890+
`Unexpected variablesReference for ${testCase.context} - ${testCase.expression}`
891+
)
871892
}
872-
}
893+
}
873894
})
874895
})
875896

src/varExport.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export async function varExportProperty(property: xdebug.Property, indent: strin
4949
)
5050
displayValue = p2.value
5151
}
52-
const escaped = displayValue.replace(/\\/g, '\\\\').replace(/'/g, "\\'");
52+
const escaped = displayValue.replace(/\\/g, '\\\\').replace(/'/g, "\\'")
5353
displayValue = `'${escaped}'`
5454
} else if (property.type === 'bool') {
5555
displayValue = Boolean(parseInt(displayValue, 10)).toString()

0 commit comments

Comments
 (0)