Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
T
topjs3-vscode-debugger
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abby Cin
topjs3-vscode-debugger
Commits
15ef6257
Commit
15ef6257
authored
May 15, 2019
by
abbycin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix restart and stop issue
parent
32f0f937
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
7 deletions
+31
-7
package.json
package.json
+1
-1
topjsDebug.js
src/topjsDebug.js
+28
-4
topjsRuntime.js
src/topjsRuntime.js
+2
-2
No files found.
package.json
View file @
15ef6257
{
"name"
:
"topjs-debugger"
,
"displayName"
:
"TopJS Debugger"
,
"version"
:
"0.0.
2
"
,
"version"
:
"0.0.
3
"
,
"publisher"
:
"AbbyCin"
,
"description"
:
"TopJS debugger extension for VS Code."
,
"author"
:
{
...
...
src/topjsDebug.js
View file @
15ef6257
...
...
@@ -43,6 +43,20 @@ class TopJSDebugSession extends vscode_debugadapter.LoggingDebugSession {
this
.
setDebuggerColumnsStartAt1
(
false
);
this
.
_cachedBreakpoints
=
{};
this
.
_restart
=
false
;
// overwrite event in base class
// when close stop button
this
.
on
(
'close'
,
()
=>
{
this
.
terminateSession
(
'exit'
);
super
.
shutdown
();
});
this
.
on
(
'error'
,
(
error
)
=>
{
this
.
terminateSession
(
'exit'
);
super
.
shutdown
();
});
// runtime instance for interacting with debugger backend
this
.
_runtime
=
new
topjsRuntime
.
topjsRuntime
();
...
...
@@ -150,7 +164,7 @@ class TopJSDebugSession extends vscode_debugadapter.LoggingDebugSession {
spawn
.
execSync
(
`
${
TASK_KILL
}
/F /T /PID
${
processId
}
`
);
}
catch
(
err
)
{
this
.
err
(
err
);
//this.err(err.message
);
}
}
else
{
...
...
@@ -168,7 +182,10 @@ class TopJSDebugSession extends vscode_debugadapter.LoggingDebugSession {
let
argv
=
[
`--remote-debugging-port=
${
args
.
port
}
`
,
args
.
program
];
this
.
_backend
=
spawn
.
spawn
(
args
.
runtimeExecutable
,
argv
);
this
.
_backend
.
on
(
'exit'
,
()
=>
{
this
.
sendEvent
(
new
vscode_debugadapter
.
TerminatedEvent
());
if
(
!
this
.
_restart
)
{
this
.
_restart
=
false
;
this
.
sendEvent
(
new
vscode_debugadapter
.
TerminatedEvent
());
}
if
(
this
.
isExtensionHost
())
{
this
.
terminateSession
(
msg
);
}
...
...
@@ -178,7 +195,10 @@ class TopJSDebugSession extends vscode_debugadapter.LoggingDebugSession {
if
(
!
this
.
isExtensionHost
())
{
this
.
terminateSession
(
msg
);
}
this
.
sendEvent
(
new
vscode_debugadapter
.
TerminatedEvent
());
if
(
!
this
.
_restart
)
{
this
.
_restart
=
false
;
this
.
sendEvent
(
new
vscode_debugadapter
.
TerminatedEvent
());
}
process
.
exit
(
0
);
});
this
.
_backend
.
stdout
.
on
(
'data'
,
(
data
)
=>
{
...
...
@@ -190,7 +210,10 @@ class TopJSDebugSession extends vscode_debugadapter.LoggingDebugSession {
this
.
_backend
.
on
(
'error'
,
(
err
)
=>
{
this
.
err
(
err
.
message
());
this
.
err
(
'main process exit...'
);
this
.
sendEvent
(
new
vscode_debugadapter
.
TerminatedEvent
());
if
(
!
this
.
_restart
)
{
this
.
_restart
=
false
;
this
.
sendEvent
(
new
vscode_debugadapter
.
TerminatedEvent
());
}
process
.
exit
(
1
);
});
this
.
log
([
args
.
runtimeExecutable
,
`--remote-debugging-port=
${
args
.
port
}
`
,
Path
.
basename
(
args
.
program
)].
join
(
' '
));
...
...
@@ -362,6 +385,7 @@ class TopJSDebugSession extends vscode_debugadapter.LoggingDebugSession {
}
restartRequest
(
response
,
args
)
{
this
.
_restart
=
true
;
this
.
_runtime
.
quit
();
this
.
terminateSession
(
'restart'
);
this
.
spawnBackend
(
this
.
_args
);
...
...
src/topjsRuntime.js
View file @
15ef6257
...
...
@@ -277,9 +277,9 @@ class topjsRuntime extends events.EventEmitter {
quit
()
{
try
{
this
.
client
.
d
isconnect
(
);
this
.
client
.
d
estroy
(
'close'
);
}
catch
(
e
)
{
//this._logger.log(`disconnect: ${e}`);
}
this
.
_started
=
false
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment