Skip to content

Commit 8181477

Browse files
renovate[bot]renovate-botzobo
authored
chore(deps): update dependency prettier to v2.3.2 (#580)
* chore(deps): update dependency prettier to v2.3.2 * Reformat for new prettier. Co-authored-by: Renovate Bot <[email protected]> Co-authored-by: Damjan Cvetko <[email protected]>
1 parent e589d85 commit 8181477

File tree

3 files changed

+40
-42
lines changed

3 files changed

+40
-42
lines changed

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"husky": "^5.2.0",
6969
"mocha": "^8.3.2",
7070
"nyc": "^15.1.0",
71-
"prettier": "2.2.1",
71+
"prettier": "2.3.2",
7272
"semantic-release": "^17.4.2",
7373
"semantic-release-vsce": "^3.3.0",
7474
"semver": "^7.3.5",

src/phpDebug.ts

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -621,47 +621,45 @@ class PhpDebugSession extends vscode.DebugSession {
621621
response.body = { stackFrames: [{ id, name, source, line, column: 1 }] }
622622
} else {
623623
response.body = {
624-
stackFrames: stack.map(
625-
(stackFrame): VSCodeDebugProtocol.StackFrame => {
626-
let source: VSCodeDebugProtocol.Source
627-
let line = stackFrame.line
628-
const urlObject = url.parse(stackFrame.fileUri)
629-
if (urlObject.protocol === 'dbgp:') {
630-
let sourceReference
631-
const src = Array.from(this._sources).find(
632-
([, v]) => v.url === stackFrame.fileUri && v.connection === connection
633-
)
634-
if (src) {
635-
sourceReference = src[0]
636-
} else {
637-
sourceReference = this._sourceIdCounter++
638-
this._sources.set(sourceReference, { connection, url: stackFrame.fileUri })
639-
}
640-
// for eval code, we need to include .php extension to get syntax highlighting
641-
source = {
642-
name:
643-
stackFrame.type === 'eval'
644-
? `eval ${stackFrame.fileUri.substr(7)}.php`
645-
: stackFrame.name,
646-
sourceReference,
647-
origin: stackFrame.type,
648-
}
649-
// for eval code, we add a "<?php" line at the beginning to get syntax highlighting (see sourceRequest)
650-
line++
624+
stackFrames: stack.map((stackFrame): VSCodeDebugProtocol.StackFrame => {
625+
let source: VSCodeDebugProtocol.Source
626+
let line = stackFrame.line
627+
const urlObject = url.parse(stackFrame.fileUri)
628+
if (urlObject.protocol === 'dbgp:') {
629+
let sourceReference
630+
const src = Array.from(this._sources).find(
631+
([, v]) => v.url === stackFrame.fileUri && v.connection === connection
632+
)
633+
if (src) {
634+
sourceReference = src[0]
651635
} else {
652-
// Xdebug paths are URIs, VS Code file paths
653-
const filePath = convertDebuggerPathToClient(urlObject, this._args.pathMappings)
654-
// "Name" of the source and the actual file path
655-
source = { name: path.basename(filePath), path: filePath }
636+
sourceReference = this._sourceIdCounter++
637+
this._sources.set(sourceReference, { connection, url: stackFrame.fileUri })
638+
}
639+
// for eval code, we need to include .php extension to get syntax highlighting
640+
source = {
641+
name:
642+
stackFrame.type === 'eval'
643+
? `eval ${stackFrame.fileUri.substr(7)}.php`
644+
: stackFrame.name,
645+
sourceReference,
646+
origin: stackFrame.type,
656647
}
657-
// a new, unique ID for scopeRequests
658-
const stackFrameId = this._stackFrameIdCounter++
659-
// save the connection this stackframe belongs to and the level of the stackframe under the stacktrace id
660-
this._stackFrames.set(stackFrameId, stackFrame)
661-
// prepare response for VS Code (column is always 1 since Xdebug doesn't tell us the column)
662-
return { id: stackFrameId, name: stackFrame.name, source, line, column: 1 }
648+
// for eval code, we add a "<?php" line at the beginning to get syntax highlighting (see sourceRequest)
649+
line++
650+
} else {
651+
// Xdebug paths are URIs, VS Code file paths
652+
const filePath = convertDebuggerPathToClient(urlObject, this._args.pathMappings)
653+
// "Name" of the source and the actual file path
654+
source = { name: path.basename(filePath), path: filePath }
663655
}
664-
),
656+
// a new, unique ID for scopeRequests
657+
const stackFrameId = this._stackFrameIdCounter++
658+
// save the connection this stackframe belongs to and the level of the stackframe under the stacktrace id
659+
this._stackFrames.set(stackFrameId, stackFrame)
660+
// prepare response for VS Code (column is always 1 since Xdebug doesn't tell us the column)
661+
return { id: stackFrameId, name: stackFrame.name, source, line, column: 1 }
662+
}),
665663
}
666664
}
667665
} catch (error) {

0 commit comments

Comments
 (0)