@@ -27,7 +27,7 @@ import { WorkspaceSymbols } from './workspaceSymbols/main';
2727import { BlockFormatProviders } from './typeFormatters/blockFormatProvider' ;
2828import * as os from 'os' ;
2929import * as fs from 'fs' ;
30-
30+ import { activateSingleFileDebug } from './singleFileDebug' ;
3131
3232const PYTHON : vscode . DocumentFilter = { language : 'python' , scheme : 'file' } ;
3333let unitTestOutChannel : vscode . OutputChannel ;
@@ -65,7 +65,7 @@ export function activate(context: vscode.ExtensionContext) {
6565 context . subscriptions . push ( vscode . commands . registerCommand ( Commands . Start_REPL , ( ) => {
6666 let term = vscode . window . createTerminal ( 'Python' , pythonSettings . pythonPath ) ;
6767 term . show ( ) ;
68- context . subscriptions . push ( term ) ;
68+ context . subscriptions . push ( term ) ;
6969 } ) ) ;
7070
7171 // Enable indentAction
@@ -117,6 +117,8 @@ export function activate(context: vscode.ExtensionContext) {
117117
118118 const hepProvider = new HelpProvider ( ) ;
119119 context . subscriptions . push ( hepProvider ) ;
120+
121+ context . subscriptions . push ( activateSingleFileDebug ( ) ) ;
120122}
121123
122124// this method is called when your extension is deactivated
@@ -125,32 +127,32 @@ export function deactivate() {
125127
126128class PythonExt {
127129
128- private _isDjangoProject : ContextKey ;
130+ private _isDjangoProject : ContextKey ;
129131
130- constructor ( ) {
131- this . _isDjangoProject = new ContextKey ( 'python.isDjangoProject' ) ;
132- this . _ensureState ( ) ;
133- }
132+ constructor ( ) {
133+ this . _isDjangoProject = new ContextKey ( 'python.isDjangoProject' ) ;
134+ this . _ensureState ( ) ;
135+ }
134136
135- private _ensureState ( ) : void {
136- // context: python.isDjangoProject
137- this . _isDjangoProject . set ( fs . existsSync ( vscode . workspace . rootPath . concat ( "/manage.py" ) ) ) ;
138- }
137+ private _ensureState ( ) : void {
138+ // context: python.isDjangoProject
139+ this . _isDjangoProject . set ( fs . existsSync ( vscode . workspace . rootPath . concat ( "/manage.py" ) ) ) ;
140+ }
139141}
140142
141- class ContextKey {
142- private _name : string ;
143- private _lastValue : boolean ;
144-
145- constructor ( name :string ) {
146- this . _name = name ;
147- }
148-
149- public set ( value :boolean ) : void {
150- if ( this . _lastValue === value ) {
151- return ;
152- }
153- this . _lastValue = value ;
154- vscode . commands . executeCommand ( 'setContext' , this . _name , this . _lastValue ) ;
155- }
143+ class ContextKey {
144+ private _name : string ;
145+ private _lastValue : boolean ;
146+
147+ constructor ( name : string ) {
148+ this . _name = name ;
149+ }
150+
151+ public set ( value : boolean ) : void {
152+ if ( this . _lastValue === value ) {
153+ return ;
154+ }
155+ this . _lastValue = value ;
156+ vscode . commands . executeCommand ( 'setContext' , this . _name , this . _lastValue ) ;
157+ }
156158}
0 commit comments