FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pythonVSCode/src/client/singleFileDebug.ts at master · ldebug/pythonVSCode · GitHub
ldebug
/
pythonVSCode
Public
forked from
DonJayamanne/pythonVSCode
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
pythonVSCode
/
src
/
client
/
singleFileDebug.ts
Copy path
More file actions
More file actions
Latest commit
History
History
History
51 lines (44 loc) · 1.87 KB
Breadcrumbs
pythonVSCode
/
src
/
client
/
singleFileDebug.ts
Copy path
File metadata and controls
51 lines (44 loc) · 1.87 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import
*
as
vscode
from
'vscode'
;
import
{
dirname
,
join
}
from
'path'
;
import
{
PythonSettings
}
from
'./common/configSettings'
;
export
function
activateSingleFileDebug
(
)
{
return
vscode
.
commands
.
registerCommand
(
'python.python-debug.startSession'
,
config
=>
{
if
(
!
config
.
request
)
{
// if 'request' is missing interpret this as a missing launch.json
config
.
type
=
'python'
;
config
.
name
=
'Launch'
;
config
.
request
=
'launch'
;
config
.
pythonPath
=
PythonSettings
.
getInstance
(
)
.
pythonPath
;
config
.
debugOptions
=
[
"WaitOnAbnormalExit"
,
"WaitOnNormalExit"
,
"RedirectOutput"
]
;
config
.
stopOnEntry
=
true
;
config
.
module
=
''
;
config
.
args
=
[
]
;
config
.
console
=
"none"
;
config
.
exceptionHandling
=
[
]
;
config
.
env
=
{
}
;
if
(
vscode
.
workspace
.
rootPath
)
{
config
.
cwd
=
vscode
.
workspace
.
rootPath
;
}
if
(
!
config
.
program
)
{
const
editor
=
vscode
.
window
.
activeTextEditor
;
if
(
editor
&&
editor
.
document
.
languageId
===
'python'
)
{
config
.
program
=
editor
.
document
.
fileName
;
}
}
if
(
!
config
.
cwd
&&
config
.
program
)
{
// fall back if 'cwd' not known: derive it from 'program'
config
.
cwd
=
dirname
(
config
.
program
)
;
}
if
(
vscode
.
workspace
&&
vscode
.
workspace
.
rootPath
)
{
config
.
envFile
=
join
(
vscode
.
workspace
.
rootPath
,
'.env'
)
;
}
if
(
!
config
.
envFile
&&
typeof
config
.
cwd
===
'string'
&&
config
.
cwd
.
lengths
>
0
)
{
config
.
envFile
=
join
(
config
.
cwd
,
'.env'
)
;
}
}
vscode
.
commands
.
executeCommand
(
'vscode.startDebug'
,
config
)
;
}
)
;
}
Back
|
FazBrowse Home
|
New Git URL