FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

settings: adding autoStartBrowserURL setting to customize the URL tha… by maxschmi · Pull Request #581 · microsoft/vscode-python-debugger · GitHub

Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .json  (1) .ts  (3) All 2 file types selected
Only manifest files
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
4 changes: 4 additions & 0 deletions package.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,10 @@
"description": "Open external browser to launch the application",
"type": "boolean"
},
"autoStartBrowserURL": {
"description": "The URL to open in the external browser if autoStartBrowser is true. The URL can be a regular expression that matches the URL to open in the stdout.",
"type": "string"
},
"django": {
"default": false,
"description": "Django debugging.",
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ export abstract class BaseConfigurationResolver<T extends DebugConfiguration>
showReturnValue: !!debugConfiguration.showReturnValue,
subProcess: !!debugConfiguration.subProcess,
autoStartBrowser: !!debugConfiguration,
autoStartBrowserURL: debugConfiguration.autoStartBrowserURL,
watson: name.toLowerCase().indexOf('watson') >= 0,
pyspark: name.toLowerCase().indexOf('pyspark') >= 0,
gevent: name.toLowerCase().indexOf('gevent') >= 0,
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,12 @@ export class LaunchConfigurationResolver extends BaseConfigurationResolver<Launc
const isFastAPI = LaunchConfigurationResolver.isDebuggingFastAPI(debugConfiguration);
const isFlask = LaunchConfigurationResolver.isDebuggingFlask(debugConfiguration);
if (debugConfiguration.autoStartBrowser && (debugConfiguration.django || isFlask)) {
let pattern = '.*(?:(http|https):\\/\\/\\S+:[0-9]+\\/?).*';
if (debugConfiguration.autoStartBrowserURL !== undefined) {
pattern = `.*(${debugConfiguration.autoStartBrowserURL}).*`;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

what is the reasoning behind having the .* appended here instead of just having the user submit the exact string match they want in the setting? This feels like it might confuse people if they manual configure with the starting * on their own

}
debugConfiguration.serverReadyAction = {
pattern: '.*(https?:\\/\\/\\S+:[0-9]+\\/?).*',
pattern: pattern,
uriFormat: '%s',
action: 'openExternally',
};
Expand Down
6 changes: 6 additions & 0 deletions src/extension/telemetry/index.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,12 @@ export interface IEventNamePropertyMapping {
* @type {boolean}
*/
autoStartBrowser: boolean;
/**
* A custom URL to start in the browser when autoStartBrowser is true.
*
* @type {string}
*/
autoStartBrowserURL: string;
};
/**
* Telemetry event sent when attaching to child process
Expand Down

Back | FazBrowse Home | New Git URL