-
Notifications
You must be signed in to change notification settings - Fork 138
Provide func tasks programmatically #936
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ping |
private readonly _pythonDebugProvider: PythonDebugProvider; | ||
private readonly _javaDebugProvider: JavaDebugProvider; | ||
|
||
constructor(nodeDebugProvider: NodeDebugProvider, pythonDebugProvider: PythonDebugProvider, javaDebugProvider: JavaDebugProvider) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have this be part of the constructor rather than just export it from the respective files? It doesn't seem like there are any dynamic properties in the constructors for any of the DebugProviders.
if (venvName) { | ||
command = convertToVenvCommand(venvName, process.platform, command); | ||
} | ||
const options: ShellExecutionOptions = { env: { languageWorkers__python__arguments: await getPythonCommand(localhost, port) } }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was the Python extension supposed to handle activating the virtual environment as well? I thought that was part of the reason we wanted them to provide an API.
context.subscriptions.push(vscode.debug.registerDebugConfigurationProvider('node', nodeDebugProvider)); | ||
context.subscriptions.push(vscode.debug.registerDebugConfigurationProvider('python', pythonDebugProvider)); | ||
context.subscriptions.push(vscode.debug.registerDebugConfigurationProvider('java', javaDebugProvider)); | ||
context.subscriptions.push(vscode.workspace.registerTaskProvider(func, new FuncTaskProvider(nodeDebugProvider, pythonDebugProvider, javaDebugProvider))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the C# launch too simple to justify creating a FuncTaskProvider for it?
Discussed offline. Might add more stuff for the C# scenario in the future, but not needed right now. |
I was having problems with tests when I tried to run them against Insiders for this PR: #936 These are just a few quality of life improvements that came out of that. 1. Use `mocha-multi-reporters` like stephen's done in other repos 1. Set `ext.ui` immediately. In some cases this will report "Unexpected call to showWarningMessage..." instead of a timeout 1. Added `runWithSetting` so that I had more control on when settings are used in tests. For example, if the `dispose` method of `FunctionTesterBase` failed at `fse.remove` these weren't getting set back
By providing func tasks programmatically, we get the following benefits:
I'm somewhat hesitant to merge this PR to master because it relies on a few fixes only in insiders, but I think it's worth it to give it some bake time since it affects a high priority scenario (debug) within our extension.
Fixes #822
Fixes #821
I've also filed a few issues for remaining work: #932 #933 #935