Skip to content

Commit 63f1fcb

Browse files
authored
Add automatic code reloading (microsoft#16030)
* Add automatic code reloading experiment * Remove experiment * Clean up * Update news item * Remove opt-in opt-out option for code reload
1 parent f1bf86b commit 63f1fcb

3 files changed

Lines changed: 48 additions & 0 deletions

File tree

news/1 Enhancements/16029.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add support for debugger code reloading.

package.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -798,6 +798,43 @@
798798
"type": "boolean",
799799
"description": "Whether to enable Sub Process debugging",
800800
"default": false
801+
},
802+
"autoReload": {
803+
"type": "object",
804+
"description": "Configures automatic reload of code on edit.",
805+
"default": {},
806+
"properties": {
807+
"enable": {
808+
"type": "boolean",
809+
"description": "Automatically reload code on edit.",
810+
"default": false
811+
},
812+
"exclude": {
813+
"type": "array",
814+
"description": "Glob patterns of paths to exclude from auto reload.",
815+
"default": [
816+
"**/.git/**",
817+
"**/__pycache__/**",
818+
"**/node_modules/**",
819+
"**/.metadata/**",
820+
"**/site-packages/**"
821+
],
822+
"items": {
823+
"type": "string"
824+
}
825+
},
826+
"include": {
827+
"type": "array",
828+
"description": "Glob patterns of paths to include in auto reload.",
829+
"default": [
830+
"**/*.py",
831+
"**/*.pyw"
832+
],
833+
"items": {
834+
"type": "string"
835+
}
836+
}
837+
}
801838
}
802839
}
803840
},

src/client/debugger/types.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ type Connection = {
3131
port?: number;
3232
};
3333

34+
export interface IAutomaticCodeReload {
35+
enable?: boolean;
36+
exclude?: string[];
37+
include?: string[];
38+
pollingInterval?: number;
39+
}
40+
3441
interface ICommonDebugArguments {
3542
redirectOutput?: boolean;
3643
django?: boolean;
@@ -97,6 +104,9 @@ interface IKnownLaunchRequestArguments extends ICommonDebugArguments {
97104
// Legacy interpreter setting. Equivalent to setting "python", "debugAdapterPython",
98105
// and "debugLauncherPython" all at once.
99106
pythonPath?: string;
107+
108+
// Configures automatic code reloading.
109+
autoReload?: IAutomaticCodeReload;
100110
}
101111

102112
export interface LaunchRequestArguments

0 commit comments

Comments
 (0)