11import { BaseDebugServer } from "../DebugServers/BaseDebugServer" ;
22import { NonDebugServer } from "../DebugServers/NonDebugServer" ;
3- import { IPythonProcess , IPythonThread , IDebugServer } from "../Common/Contracts" ;
3+ import { IPythonProcess , IDebugServer } from "../Common/Contracts" ;
44import { DebugSession , OutputEvent } from "vscode-debugadapter" ;
55import { DebugProtocol } from "vscode-debugprotocol" ;
66import * as path from "path" ;
77import * as child_process from "child_process" ;
88import { LaunchRequestArguments } from "../Common/Contracts" ;
99import { DebugClient , DebugType } from "./DebugClient" ;
10- import * as fs from "fs" ;
1110import { open } from "../../common/open" ;
12- let fsExtra = require ( "fs-extra" ) ;
13- let tmp = require ( "tmp" ) ;
14- let prependFile = require ( "prepend-file" ) ;
15- let LineByLineReader = require ( "line-by-line" ) ;
1611
1712export class NonDebugClient extends DebugClient {
1813 protected args : LaunchRequestArguments ;
@@ -50,7 +45,6 @@ export class NonDebugClient extends DebugClient {
5045 if ( typeof this . args . cwd === "string" && this . args . cwd . length > 0 ) {
5146 processCwd = this . args . cwd ;
5247 }
53- let fileNameWithoutPath = path . basename ( this . args . program ) ;
5448 let pythonPath = "python" ;
5549 if ( typeof this . args . pythonPath === "string" && this . args . pythonPath . trim ( ) . length > 0 ) {
5650 pythonPath = this . args . pythonPath ;
@@ -73,7 +67,6 @@ export class NonDebugClient extends DebugClient {
7367 environmentVariables [ "PYTHONIOENCODING" ] = "UTF-8" ;
7468 newEnvVars [ "PYTHONIOENCODING" ] = "UTF-8" ;
7569 }
76- let currentFileName = module . filename ;
7770 let launcherArgs = this . buildLauncherArguments ( ) ;
7871
7972 let args = launcherArgs ;
@@ -98,7 +91,6 @@ export class NonDebugClient extends DebugClient {
9891 const isSudo = Array . isArray ( this . args . debugOptions ) && this . args . debugOptions . some ( opt => opt === 'Sudo' ) ;
9992 const command = isSudo ? 'sudo' : pythonPath ;
10093 const commandArgs = isSudo ? [ pythonPath ] . concat ( args ) : args ;
101- const options = { cwd : processCwd , env : environmentVariables } ;
10294 const termArgs : DebugProtocol . RunInTerminalRequestArguments = {
10395 kind : 'integrated' ,
10496 title : "Python Debug Console" ,
@@ -108,7 +100,7 @@ export class NonDebugClient extends DebugClient {
108100 } ;
109101 this . debugSession . runInTerminalRequest ( termArgs , 5000 , ( response ) => {
110102 if ( response . success ) {
111- resolve ( )
103+ resolve ( ) ;
112104 } else {
113105 reject ( response ) ;
114106 }
@@ -118,7 +110,7 @@ export class NonDebugClient extends DebugClient {
118110
119111 this . pyProc = child_process . spawn ( pythonPath , args , { cwd : processCwd , env : environmentVariables } ) ;
120112 this . pyProc . on ( "error" , error => {
121- this . debugSession . sendEvent ( new OutputEvent ( error , "stderr" ) ) ;
113+ this . debugSession . sendEvent ( new OutputEvent ( error + '' , "stderr" ) ) ;
122114 } ) ;
123115 this . pyProc . stderr . setEncoding ( "utf8" ) ;
124116 this . pyProc . stdout . setEncoding ( "utf8" ) ;
0 commit comments