From 3fe87cde1194f9ee54b92ebd29cd6bf57200d8eb Mon Sep 17 00:00:00 2001 From: Bhavya U Date: Fri, 13 Dec 2024 00:53:41 -0800 Subject: [PATCH 1/5] Create commands.json (#16295) --- .github/commands.json | 542 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 542 insertions(+) create mode 100644 .github/commands.json diff --git a/.github/commands.json b/.github/commands.json new file mode 100644 index 00000000000..38da97915a2 --- /dev/null +++ b/.github/commands.json @@ -0,0 +1,542 @@ +[ + { + "type": "comment", + "name": "question", + "allowUsers": [ + "cleidigh", + "usernamehw", + "gjsjohnmurray", + "IllusionMH" + ], + "action": "updateLabels", + "addLabel": "*question" + }, + { + "type": "comment", + "name": "dev-question", + "allowUsers": [ + "cleidigh", + "usernamehw", + "gjsjohnmurray", + "IllusionMH" + ], + "action": "updateLabels", + "addLabel": "*dev-question" + }, + { + "type": "label", + "name": "*question", + "action": "close", + "reason": "not_planned", + "comment": "We closed this issue because it is a question about using VS Code rather than an issue or feature request. Please search for help on [StackOverflow](https://aka.ms/vscodestackoverflow), where the community has already answered thousands of similar questions. You may find their [guide on asking a new question](https://aka.ms/vscodestackoverflowquestion) helpful if your question has not already been asked. See also our [issue reporting guidelines](https://aka.ms/vscodeissuereporting).\n\nHappy Coding!" + }, + { + "type": "label", + "name": "*dev-question", + "action": "close", + "reason": "not_planned", + "comment": "We have a great extension developer community over on [GitHub discussions](https://github.com/microsoft/vscode-discussions/discussions) and [Slack](https://vscode-dev-community.slack.com/) where extension authors help each other. This is a great place for you to ask questions and find support.\n\nHappy Coding!" + }, + { + "type": "label", + "name": "*extension-candidate", + "action": "close", + "reason": "not_planned", + "comment": "We try to keep VS Code lean and we think the functionality you're asking for is great for a VS Code extension. Maybe you can already find one that suits you in the [VS Code Marketplace](https://aka.ms/vscodemarketplace). Just in case, in a few simple steps you can get started [writing your own extension](https://aka.ms/vscodewritingextensions). See also our [issue reporting guidelines](https://aka.ms/vscodeissuereporting).\n\nHappy Coding!" + }, + { + "type": "label", + "name": "*not-reproducible", + "action": "close", + "reason": "not_planned", + "comment": "We closed this issue because we are unable to reproduce the problem with the steps you describe. Chances are we've already fixed your problem in a recent version of VS Code. If not, please ask us to reopen the issue and provide us with more detail. Our [issue reporting guidelines](https://aka.ms/vscodeissuereporting) might help you with that.\n\nHappy Coding!" + }, + { + "type": "label", + "name": "*out-of-scope", + "action": "close", + "reason": "not_planned", + "comment": "We closed this issue because we [don't plan to address it](https://aka.ms/vscode-out-of-scope) in the foreseeable future. If you disagree and feel that this issue is crucial: we are happy to listen and to reconsider.\n\nIf you wonder what we are up to, please see our [roadmap](https://aka.ms/vscoderoadmap) and [issue reporting guidelines](https://aka.ms/vscodeissuereporting).\n\nThanks for your understanding, and happy coding!" + }, + { + "type": "label", + "name": "wont-fix", + "action": "close", + "reason": "not_planned", + "comment": "We closed this issue because we [don't plan to address it](https://github.com/microsoft/vscode/wiki/Issue-Grooming#wont-fix-bugs).\n\nThanks for your understanding, and happy coding!" + }, + { + "type": "comment", + "name": "causedByExtension", + "allowUsers": [ + "cleidigh", + "usernamehw", + "gjsjohnmurray", + "IllusionMH" + ], + "action": "updateLabels", + "addLabel": "*caused-by-extension" + }, + { + "type": "label", + "name": "*caused-by-extension", + "action": "close", + "reason": "not_planned", + "comment": "This issue is caused by an extension, please file it with the repository (or contact) the extension has linked in its overview in VS Code or the [marketplace](https://aka.ms/vscodemarketplace) for VS Code. See also our [issue reporting guidelines](https://aka.ms/vscodeissuereporting). If you don't know which extension is causing the problem, you can run `Help: Start extension bisect` from the command palette (F1) to help identify the problem extension.\n\nHappy Coding!" + }, + { + "type": "label", + "name": "*as-designed", + "action": "close", + "reason": "not_planned", + "comment": "The described behavior is how it is expected to work. If you disagree, please explain what is expected and what is not in more detail. See also our [issue reporting guidelines](https://aka.ms/vscodeissuereporting).\n\nHappy Coding!" + }, + { + "type": "label", + "name": "L10N", + "assign": [ + "csigs", + "TylerLeonhardt" + ] + }, + { + "type": "comment", + "name": "duplicate", + "allowUsers": [ + "cleidigh", + "usernamehw", + "gjsjohnmurray", + "IllusionMH" + ], + "action": "updateLabels", + "addLabel": "*duplicate" + }, + { + "type": "label", + "name": "*duplicate", + "action": "close", + "reason": "not_planned", + "comment": "Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for [similar existing issues](${duplicateQuery}). See also our [issue reporting guidelines](https://aka.ms/vscodeissuereporting).\n\nHappy Coding!" + }, + { + "type": "comment", + "name": "verified", + "allowUsers": [ + "@author" + ], + "action": "updateLabels", + "addLabel": "verified", + "removeLabel": "author-verification-requested", + "requireLabel": "author-verification-requested", + "disallowLabel": "unreleased" + }, + { + "type": "comment", + "name": "confirm", + "allowUsers": [ + "cleidigh", + "usernamehw", + "gjsjohnmurray", + "IllusionMH" + ], + "action": "updateLabels", + "addLabel": "confirmed", + "removeLabel": "confirmation-pending" + }, + { + "type": "comment", + "name": "confirmationPending", + "allowUsers": [ + "cleidigh", + "usernamehw", + "gjsjohnmurray", + "IllusionMH" + ], + "action": "updateLabels", + "addLabel": "confirmation-pending", + "removeLabel": "confirmed" + }, + { + "type": "comment", + "name": "needsMoreInfo", + "allowUsers": [ + "cleidigh", + "usernamehw", + "gjsjohnmurray", + "IllusionMH" + ], + "action": "updateLabels", + "addLabel": "~info-needed" + }, + { + "type": "comment", + "name": "needsPerfInfo", + "allowUsers": [ + "cleidigh", + "usernamehw", + "gjsjohnmurray", + "IllusionMH" + ], + "addLabel": "info-needed", + "comment": "Thanks for creating this issue regarding performance! Please follow this guide to help us diagnose performance issues: https://github.com/microsoft/vscode/wiki/Performance-Issues \n\nHappy Coding!" + }, + { + "type": "comment", + "name": "jsDebugLogs", + "action": "updateLabels", + "addLabel": "info-needed", + "comment": "Please collect trace logs using the following instructions:\n\n> If you're able to, add `\"trace\": true` to your `launch.json` and reproduce the issue. The location of the log file on your disk will be written to the Debug Console. Share that with us.\n>\n> ⚠️ This log file will not contain source code, but will contain file paths. You can drop it into https://microsoft.github.io/vscode-pwa-analyzer/index.html to see what it contains. If you'd rather not share the log publicly, you can email it to connor@xbox.com" + }, + { + "type": "comment", + "name": "closedWith", + "allowUsers": [ + "cleidigh", + "usernamehw", + "gjsjohnmurray", + "IllusionMH" + ], + "action": "close", + "reason": "completed", + "addLabel": "unreleased" + }, + { + "type": "comment", + "name": "spam", + "allowUsers": [ + "cleidigh", + "usernamehw", + "gjsjohnmurray", + "IllusionMH" + ], + "action": "close", + "reason": "not_planned", + "addLabel": "invalid" + }, + { + "type": "comment", + "name": "a11ymas", + "allowUsers": [ + "AccessibilityTestingTeam-TCS", + "dixitsonali95", + "Mohini78", + "ChitrarupaSharma", + "mspatil110", + "umasarath52", + "v-umnaik" + ], + "action": "updateLabels", + "addLabel": "a11ymas" + }, + { + "type": "label", + "name": "*off-topic", + "action": "close", + "reason": "not_planned", + "comment": "Thanks for creating this issue. We think this issue is unactionable or unrelated to the goals of this project. Please follow our [issue reporting guidelines](https://aka.ms/vscodeissuereporting).\n\nHappy Coding!" + }, + { + "type": "comment", + "name": "extPython", + "allowUsers": [ + "cleidigh", + "usernamehw", + "gjsjohnmurray", + "IllusionMH" + ], + "action": "close", + "reason": "not_planned", + "addLabel": "*caused-by-extension", + "comment": "It looks like this is caused by the Python extension. Please file the issue to the [Python extension repository](https://github.com/microsoft/vscode-python). Make sure to check their issue reporting template and provide them relevant information such as the extension version you're using. See also our [issue reporting guidelines](https://aka.ms/vscodeissuereporting) for more information.\n\nHappy Coding!" + }, + { + "type": "comment", + "name": "extJupyter", + "allowUsers": [ + "cleidigh", + "usernamehw", + "gjsjohnmurray", + "IllusionMH" + ], + "action": "close", + "reason": "not_planned", + "addLabel": "*caused-by-extension", + "comment": "It looks like this is caused by the Jupyter extension. Please file the issue to the [Jupyter extension repository](https://github.com/microsoft/vscode-jupyter). Make sure to check their issue reporting template and provide them relevant information such as the extension version you're using. See also our [issue reporting guidelines](https://aka.ms/vscodeissuereporting) for more information.\n\nHappy Coding!" + }, + { + "type": "comment", + "name": "extC", + "allowUsers": [ + "cleidigh", + "usernamehw", + "gjsjohnmurray", + "IllusionMH" + ], + "action": "close", + "reason": "not_planned", + "addLabel": "*caused-by-extension", + "comment": "It looks like this is caused by the C extension. Please file the issue to the [C extension repository](https://github.com/microsoft/vscode-cpptools). Make sure to check their issue reporting template and provide them relevant information such as the extension version you're using. See also our [issue reporting guidelines](https://aka.ms/vscodeissuereporting) for more information.\n\nHappy Coding!" + }, + { + "type": "comment", + "name": "extC++", + "allowUsers": [ + "cleidigh", + "usernamehw", + "gjsjohnmurray", + "IllusionMH" + ], + "action": "close", + "reason": "not_planned", + "addLabel": "*caused-by-extension", + "comment": "It looks like this is caused by the C++ extension. Please file the issue to the [C++ extension repository](https://github.com/microsoft/vscode-cpptools). Make sure to check their issue reporting template and provide them relevant information such as the extension version you're using. See also our [issue reporting guidelines](https://aka.ms/vscodeissuereporting) for more information.\n\nHappy Coding!" + }, + { + "type": "comment", + "name": "extCpp", + "allowUsers": [ + "cleidigh", + "usernamehw", + "gjsjohnmurray", + "IllusionMH" + ], + "action": "close", + "reason": "not_planned", + "addLabel": "*caused-by-extension", + "comment": "It looks like this is caused by the C++ extension. Please file the issue to the [C++ extension repository](https://github.com/microsoft/vscode-cpptools). Make sure to check their issue reporting template and provide them relevant information such as the extension version you're using. See also our [issue reporting guidelines](https://aka.ms/vscodeissuereporting) for more information.\n\nHappy Coding!" + }, + { + "type": "comment", + "name": "extTS", + "allowUsers": [ + "cleidigh", + "usernamehw", + "gjsjohnmurray", + "IllusionMH" + ], + "action": "close", + "reason": "not_planned", + "addLabel": "*caused-by-extension", + "comment": "It looks like this is caused by the TypeScript language service. Please file the issue to the [TypeScript repository](https://github.com/microsoft/TypeScript/). Make sure to check their [contributing guidelines](https://github.com/microsoft/TypeScript/blob/master/CONTRIBUTING.md) and provide relevant information such as the extension version you're using. See also our [issue reporting guidelines](https://aka.ms/vscodeissuereporting) for more information.\n\nHappy Coding!" + }, + { + "type": "comment", + "name": "extJS", + "allowUsers": [ + "cleidigh", + "usernamehw", + "gjsjohnmurray", + "IllusionMH" + ], + "action": "close", + "reason": "not_planned", + "addLabel": "*caused-by-extension", + "comment": "It looks like this is caused by the TypeScript/JavaScript language service. Please file the issue to the [TypeScript repository](https://github.com/microsoft/TypeScript/). Make sure to check their [contributing guidelines](https://github.com/microsoft/TypeScript/blob/master/CONTRIBUTING.md) and provide relevant information such as the extension version you're using. See also our [issue reporting guidelines](https://aka.ms/vscodeissuereporting) for more information.\n\nHappy Coding!" + }, + { + "type": "comment", + "name": "extC#", + "allowUsers": [ + "cleidigh", + "usernamehw", + "gjsjohnmurray", + "IllusionMH" + ], + "action": "close", + "reason": "not_planned", + "addLabel": "*caused-by-extension", + "comment": "It looks like this is caused by the C# extension. Please file the issue to the [C# extension repository](https://github.com/OmniSharp/omnisharp-vscode.git). Make sure to check their issue reporting template and provide them relevant information such as the extension version you're using. See also our [issue reporting guidelines](https://aka.ms/vscodeissuereporting) for more information.\n\nHappy Coding!" + }, + { + "type": "comment", + "name": "extGo", + "allowUsers": [ + "cleidigh", + "usernamehw", + "gjsjohnmurray", + "IllusionMH" + ], + "action": "close", + "addLabel": "*caused-by-extension", + "comment": "It looks like this is caused by the Go extension. Please file the issue to the [Go extension repository](https://github.com/golang/vscode-go). Make sure to check their issue reporting template and provide them relevant information such as the extension version you're using. See also our [issue reporting guidelines](https://aka.ms/vscodeissuereporting) for more information.\n\nHappy Coding!" + }, + { + "type": "comment", + "name": "extPowershell", + "allowUsers": [ + "cleidigh", + "usernamehw", + "gjsjohnmurray", + "IllusionMH" + ], + "action": "close", + "reason": "not_planned", + "addLabel": "*caused-by-extension", + "comment": "It looks like this is caused by the PowerShell extension. Please file the issue to the [PowerShell extension repository](https://github.com/PowerShell/vscode-powershell). Make sure to check their issue reporting template and provide them relevant information such as the extension version you're using. See also our [issue reporting guidelines](https://aka.ms/vscodeissuereporting) for more information.\n\nHappy Coding!" + }, + { + "type": "comment", + "name": "extLiveShare", + "allowUsers": [ + "cleidigh", + "usernamehw", + "gjsjohnmurray", + "IllusionMH" + ], + "action": "close", + "reason": "not_planned", + "addLabel": "*caused-by-extension", + "comment": "It looks like this is caused by the LiveShare extension. Please file the issue to the [LiveShare repository](https://github.com/MicrosoftDocs/live-share). Make sure to check their [contributing guidelines](https://github.com/MicrosoftDocs/live-share/blob/master/CONTRIBUTING.md) and provide relevant information such as the extension version you're using. See also our [issue reporting guidelines](https://aka.ms/vscodeissuereporting) for more information.\n\nHappy Coding!" + }, + { + "type": "comment", + "name": "extDocker", + "allowUsers": [ + "cleidigh", + "usernamehw", + "gjsjohnmurray", + "IllusionMH" + ], + "action": "close", + "reason": "not_planned", + "addLabel": "*caused-by-extension", + "comment": "It looks like this is caused by the Docker extension. Please file the issue to the [Docker extension repository](https://github.com/microsoft/vscode-docker). Make sure to check their issue reporting template and provide them relevant information such as the extension version you're using. See also our [issue reporting guidelines](https://aka.ms/vscodeissuereporting) for more information.\n\nHappy Coding!" + }, + { + "type": "comment", + "name": "extJava", + "allowUsers": [ + "cleidigh", + "usernamehw", + "gjsjohnmurray", + "IllusionMH" + ], + "action": "close", + "reason": "not_planned", + "addLabel": "*caused-by-extension", + "comment": "It looks like this is caused by the Java extension. Please file the issue to the [Java extension repository](https://github.com/redhat-developer/vscode-java). Make sure to check their [troubleshooting instructions](https://github.com/redhat-developer/vscode-java/wiki/Troubleshooting) and provide relevant information such as the extension version you're using. See also our [issue reporting guidelines](https://aka.ms/vscodeissuereporting) for more information.\n\nHappy Coding!" + }, + { + "type": "comment", + "name": "extJavaDebug", + "allowUsers": [ + "cleidigh", + "usernamehw", + "gjsjohnmurray", + "IllusionMH" + ], + "action": "close", + "reason": "not_planned", + "addLabel": "*caused-by-extension", + "comment": "It looks like this is caused by the Java Debugger extension. Please file the issue to the [Java Debugger repository](https://github.com/microsoft/vscode-java-debug). Make sure to check their issue reporting template and provide them relevant information such as the extension version you're using. See also our [issue reporting guidelines](https://aka.ms/vscodeissuereporting) for more information.\n\nHappy Coding!" + }, + { + "type": "comment", + "name": "extCodespaces", + "allowUsers": [ + "cleidigh", + "usernamehw", + "gjsjohnmurray", + "IllusionMH" + ], + "action": "close", + "reason": "not_planned", + "addLabel": "*caused-by-extension", + "comment": "It looks like this is caused by the Codespaces extension. Please file the issue in the [Codespaces Discussion Forum](http://aka.ms/ghcs-feedback). Make sure to check their issue reporting template and provide them relevant information such as the extension version you're using. See also our [issue reporting guidelines](https://aka.ms/vscodeissuereporting) for more information.\n\nHappy Coding!" + }, + { + "type": "comment", + "name": "extCopilot", + "allowUsers": [ + "cleidigh", + "usernamehw", + "gjsjohnmurray", + "IllusionMH" + ], + "action": "close", + "reason": "not_planned", + "addLabel": "*caused-by-extension", + "comment": "It looks like this is caused by the Copilot extension. Please file the issue in the [Copilot Discussion Forum](https://github.com/community/community/discussions/categories/copilot). Make sure to check their issue reporting template and provide them relevant information such as the extension version you're using. See also our [issue reporting guidelines](https://aka.ms/vscodeissuereporting) for more information.\n\nHappy Coding!" + }, + { + "type": "comment", + "name": "gifPlease", + "allowUsers": [ + "cleidigh", + "usernamehw", + "gjsjohnmurray", + "IllusionMH" + ], + "action": "comment", + "addLabel": "info-needed", + "comment": "Thanks for reporting this issue! Unfortunately, it's hard for us to understand what issue you're seeing. Please help us out by providing a screen recording showing exactly what isn't working as expected. While we can work with most standard formats, `.gif` files are preferred as they are displayed inline on GitHub. You may find https://gifcap.dev helpful as a browser-based gif recording tool.\n\nIf the issue depends on keyboard input, you can help us by enabling screencast mode for the recording (`Developer: Toggle Screencast Mode` in the command palette). Lastly, please attach this file via the GitHub web interface as emailed responses will strip files out from the issue.\n\nHappy coding!" + }, + { + "type": "comment", + "name": "confirmPlease", + "allowUsers": [ + "cleidigh", + "usernamehw", + "gjsjohnmurray", + "IllusionMH" + ], + "action": "comment", + "addLabel": "info-needed", + "comment": "Please diagnose the root cause of the issue by running the command `F1 > Help: Troubleshoot Issue` and following the instructions. Once you have done that, please update the issue with the results.\n\nHappy Coding!" + }, + { + "__comment__": "Allows folks on the team to label issues by commenting: `\\label My-Label` ", + "type": "comment", + "name": "label", + "allowUsers": [] + }, + { + "type": "comment", + "name": "assign", + "allowUsers": [ + "cleidigh", + "usernamehw", + "gjsjohnmurray", + "IllusionMH" + ] + }, + { + "type": "label", + "name": "*workspace-trust-docs", + "action": "close", + "reason": "not_planned", + "comment": "This issue appears to be the result of the new workspace trust feature shipped in June 2021. This security-focused feature has major impact on the functionality of VS Code. Due to the volume of issues, we ask that you take some time to review our [comprehensive documentation](https://aka.ms/vscode-workspace-trust) on the feature. If your issue is still not resolved, please let us know." + }, + { + "type": "label", + "name": "~verification-steps-needed", + "action": "updateLabels", + "addLabel": "verification-steps-needed", + "removeLabel": "~verification-steps-needed", + "comment": "Friendly ping! Looks like this issue requires some further steps to be verified. Please provide us with the steps necessary to verify this issue." + }, + { + "type": "label", + "name": "~info-needed", + "action": "updateLabels", + "addLabel": "info-needed", + "removeLabel": "~info-needed", + "comment": "Thanks for creating this issue! We figured it's missing some basic information or in some other way doesn't follow our [issue reporting guidelines](https://aka.ms/vscodeissuereporting). Please take the time to review these and update the issue.\n\nHappy Coding!" + }, + { + "type": "label", + "name": "~version-info-needed", + "action": "updateLabels", + "addLabel": "info-needed", + "removeLabel": "~version-info-needed", + "comment": "Thanks for creating this issue! We figured it's missing some basic information, such as a version number, or in some other way doesn't follow our [issue reporting guidelines](https://aka.ms/vscodeissuereporting). Please take the time to review these and update the issue.\n\nHappy Coding!" + }, + { + "type": "label", + "name": "~confirmation-needed", + "action": "updateLabels", + "addLabel": "info-needed", + "removeLabel": "~confirmation-needed", + "comment": "Please diagnose the root cause of the issue by running the command `F1 > Help: Troubleshoot Issue` and following the instructions. Once you have done that, please update the issue with the results.\n\nHappy Coding!" + } +] From 52f33dcecee9d36f73b4955fc3873d0cd9eef47d Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Wed, 18 Dec 2024 09:21:29 +1100 Subject: [PATCH 2/5] Fix calculation of working dir (#16293) --- .../session/rawKernelSessionFactory.node.ts | 32 +++++++++++-------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/src/kernels/raw/session/rawKernelSessionFactory.node.ts b/src/kernels/raw/session/rawKernelSessionFactory.node.ts index ebcbfd6e777..8b9d0af953e 100644 --- a/src/kernels/raw/session/rawKernelSessionFactory.node.ts +++ b/src/kernels/raw/session/rawKernelSessionFactory.node.ts @@ -92,15 +92,19 @@ export async function computeLocalWorkingDirectory( fs: IFileSystem ): Promise { let suggestedDir = await doComputeLocalWorkingDirectory(resource, configService, fs); - if (suggestedDir && (await fs.exists(suggestedDir))) { - return suggestedDir.fsPath; + if (suggestedDir && (await fs.exists(vscode.Uri.file(suggestedDir)))) { + return suggestedDir; } else if (resource && resource.scheme !== 'untitled' && (await fs.exists(resource))) { // Combine the working directory with this file if possible. - suggestedDir = vscode.Uri.file( - expandWorkingDir(getFilePath(suggestedDir), resource, configService.getSettings(resource)) - ); - if (suggestedDir && (await fs.exists(suggestedDir))) { - return suggestedDir.fsPath; + const workingDir = + suggestedDir && suggestedDir.includes('${') + ? suggestedDir + : suggestedDir + ? getFilePath(vscode.Uri.file(suggestedDir)) + : undefined; + const expandedWorkingDir = expandWorkingDir(workingDir, resource, configService.getSettings(resource)); + if (await fs.exists(vscode.Uri.file(expandedWorkingDir))) { + return expandedWorkingDir; } } } @@ -109,8 +113,8 @@ async function doComputeLocalWorkingDirectory( resource: Resource, configService: IConfigurationService, fs: IFileSystem -): Promise { - let workingDir: vscode.Uri | undefined; +): Promise { + let workingDir: string | undefined; // For a local launch calculate the working directory that we should switch into const settings = configService.getSettings(resource); const fileRootStr = untildify(settings.notebookFileRoot); @@ -123,24 +127,24 @@ async function doComputeLocalWorkingDirectory( if (path.isAbsolute(fileRootStr)) { if (await fs.exists(fileRoot)) { // User setting is absolute and exists, use it - workingDir = fileRoot; + workingDir = fileRoot.fsPath; } else { // User setting is absolute and doesn't exist, use workspace - workingDir = workspaceFolderPath; + workingDir = workspaceFolderPath.fsPath; } } else if (!fileRootStr.includes('${')) { // fileRoot is a relative path, combine it with the workspace folder const combinedPath = vscode.Uri.joinPath(workspaceFolderPath, fileRootStr); if (await fs.exists(combinedPath)) { // combined path exists, use it - workingDir = combinedPath; + workingDir = combinedPath.fsPath; } else { // Combined path doesn't exist, use workspace - workingDir = workspaceFolderPath; + workingDir = workspaceFolderPath.fsPath; } } else { // fileRoot is a variable that hasn't been expanded - workingDir = fileRoot; + workingDir = fileRootStr; } } return workingDir; From 114c5002e3cc6c2188515dae7120b3f8ad28e769 Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Wed, 18 Dec 2024 09:21:59 +1100 Subject: [PATCH 3/5] Support more of the missing predefined variables (#16260) --- .../common/variables/systemVariables.node.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/platform/common/variables/systemVariables.node.ts b/src/platform/common/variables/systemVariables.node.ts index d11fac6f3c2..94a741a61a7 100644 --- a/src/platform/common/variables/systemVariables.node.ts +++ b/src/platform/common/variables/systemVariables.node.ts @@ -6,6 +6,7 @@ import * as path from '../../vscode-path/path'; import { Uri, Range, workspace, window } from 'vscode'; import { AbstractSystemVariables } from './systemVariables'; +import { getUserHomeDir } from '../utils/platform.node'; /** * System variables for node.js. Node specific is necessary because of using the current process environment. @@ -13,6 +14,7 @@ import { AbstractSystemVariables } from './systemVariables'; export class SystemVariables extends AbstractSystemVariables { private _workspaceFolder: string; private _workspaceFolderName: string; + private _fileWorkspaceFolder: string; private _filePath: string | undefined; private _lineNumber: number | undefined; private _selectedText: string | undefined; @@ -23,6 +25,7 @@ export class SystemVariables extends AbstractSystemVariables { const workspaceFolder = file ? workspace.getWorkspaceFolder(file) : undefined; this._workspaceFolder = workspaceFolder ? workspaceFolder.uri.fsPath : rootFolder?.fsPath || __dirname; this._workspaceFolderName = path.basename(this._workspaceFolder); + this._fileWorkspaceFolder = this._workspaceFolder; this._filePath = file ? file.fsPath : undefined; if (window && window.activeTextEditor) { this._lineNumber = window.activeTextEditor.selection.anchor.line + 1; @@ -38,6 +41,10 @@ export class SystemVariables extends AbstractSystemVariables { }); } + public get userHome(): string { + return getUserHomeDir().fsPath; + } + public get cwd(): string { return this.workspaceFolder; } @@ -50,6 +57,10 @@ export class SystemVariables extends AbstractSystemVariables { return this._workspaceFolder; } + public get fileWorkspaceFolder(): string { + return this._fileWorkspaceFolder; + } + public get workspaceRootFolderName(): string { return this._workspaceFolderName; } @@ -82,6 +93,14 @@ export class SystemVariables extends AbstractSystemVariables { return this.file ? path.dirname(this.file) : undefined; } + public get fileDirnameBasename(): string | undefined { + return this.fileDirname ? path.basename(this.fileDirname) : undefined; + } + + public get pathSeparator(): string | undefined { + return path.sep; + } + public get fileExtname(): string | undefined { return this.file ? path.extname(this.file) : undefined; } From 1f522b097f98261aa8aa5414f1b5f520b02cebf3 Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Wed, 18 Dec 2024 10:40:03 +1100 Subject: [PATCH 4/5] New way to hide output panel for tests (#16311) * New way to hide output panel for tests * Misc * Fixes --- src/test/datascience/widgets/commUtils.ts | 9 ++++++++- .../widgets/standardWidgets.vscode.common.test.ts | 6 +++--- .../widgets/thirdpartyWidgets.vscode.common.test.ts | 6 +++--- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/test/datascience/widgets/commUtils.ts b/src/test/datascience/widgets/commUtils.ts index da99a00b70b..75dbff10c4b 100644 --- a/src/test/datascience/widgets/commUtils.ts +++ b/src/test/datascience/widgets/commUtils.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { NotebookCell, NotebookEditor, NotebookRendererMessaging, notebooks } from 'vscode'; +import { commands, NotebookCell, NotebookEditor, NotebookRendererMessaging, notebooks } from 'vscode'; import { dispose } from '../../../platform/common/utils/lifecycle'; import { logger } from '../../../platform/logging'; import { IDisposable } from '../../../platform/common/types'; @@ -124,3 +124,10 @@ export class Utils { }); } } + +export async function hideOutputPanel() { + // Work around for the removal of the command `workbench.action.closePanel`. + // await commands.executeCommand('workbench.action.terminal.killAll'); + await commands.executeCommand('workbench.action.problems.focus'); + await commands.executeCommand('workbench.action.togglePanel'); +} diff --git a/src/test/datascience/widgets/standardWidgets.vscode.common.test.ts b/src/test/datascience/widgets/standardWidgets.vscode.common.test.ts index 6b727f71030..fe3aca60431 100644 --- a/src/test/datascience/widgets/standardWidgets.vscode.common.test.ts +++ b/src/test/datascience/widgets/standardWidgets.vscode.common.test.ts @@ -34,7 +34,7 @@ import { waitForExecutionCompletedSuccessfully, waitForTextOutput } from '../notebook/helper'; -import { initializeWidgetComms, Utils } from './commUtils'; +import { hideOutputPanel, initializeWidgetComms, Utils } from './commUtils'; import { WidgetRenderingTimeoutForTests } from './constants'; import { getTextOutputValue } from '../../../kernels/execution/helpers'; import { isWeb } from '../../../platform/common/utils/misc'; @@ -128,7 +128,7 @@ suite('Standard IPyWidget Tests @widgets', function () { // Widgets get rendered only when the output is in view. If we have a very large notebook // and the output is not visible, then it will not get rendered & the tests will fail. The tests inspect the rendered HTML. // Solution - maximize available real-estate by hiding the output panels & hiding the input cells. - await commands.executeCommand('workbench.action.closePanel'); + await hideOutputPanel(); await commands.executeCommand('workbench.action.maximizeEditorHideSidebar'); await commands.executeCommand('notebook.cell.collapseAllCellInputs'); comms = await initializeWidgetComms(disposables); @@ -142,7 +142,7 @@ suite('Standard IPyWidget Tests @widgets', function () { await startJupyterServer(); logger.info(`Start Test (completed) ${this.currentTest?.title}`); // With less realestate, the outputs might not get rendered (VS Code optimization to avoid rendering if not in viewport). - await commands.executeCommand('workbench.action.closePanel'); + await hideOutputPanel(); }); teardown(async function () { logger.info(`Ended Test ${this.currentTest?.title}`); diff --git a/src/test/datascience/widgets/thirdpartyWidgets.vscode.common.test.ts b/src/test/datascience/widgets/thirdpartyWidgets.vscode.common.test.ts index 1fb7fd4632d..e2cfcccb889 100644 --- a/src/test/datascience/widgets/thirdpartyWidgets.vscode.common.test.ts +++ b/src/test/datascience/widgets/thirdpartyWidgets.vscode.common.test.ts @@ -32,7 +32,7 @@ import { initializeNotebookForWidgetTest } from './standardWidgets.vscode.common.test'; import { GlobalStateKeyToTrackIfUserConfiguredCDNAtLeastOnce } from '../../../notebooks/controllers/ipywidgets/scriptSourceProvider/cdnWidgetScriptSourceProvider'; -import { initializeWidgetComms, Utils } from './commUtils'; +import { hideOutputPanel, initializeWidgetComms, Utils } from './commUtils'; import { isWeb } from '../../../platform/common/utils/misc'; [true, false].forEach((useCDN) => { @@ -71,7 +71,7 @@ import { isWeb } from '../../../platform/common/utils/misc'; // Widgets get rendered only when the output is in view. If we have a very large notebook // and the output is not visible, then it will not get rendered & the tests will fail. The tests inspect the rendered HTML. // Solution - maximize available real-estate by hiding the output panels & hiding the input cells. - await commands.executeCommand('workbench.action.closePanel'); + await hideOutputPanel(); await commands.executeCommand('workbench.action.maximizeEditorHideSidebar'); comms = await initializeWidgetComms(disposables); @@ -83,7 +83,7 @@ import { isWeb } from '../../../platform/common/utils/misc'; sinon.restore(); logger.info(`Start Test (completed) ${this.currentTest?.title}`); // With less real estate, the outputs might not get rendered (VS Code optimization to avoid rendering if not in viewport). - await commands.executeCommand('workbench.action.closePanel'); + await hideOutputPanel(); }); teardown(async function () { logger.info(`Ended Test ${this.currentTest?.title}`); From afaf622985bad6cae8a75d1f167f0b52c99d273e Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Wed, 18 Dec 2024 11:03:14 +1100 Subject: [PATCH 5/5] Restore disabled widget tests (#16308) --- .../widgets/standardWidgets.vscode.common.test.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/test/datascience/widgets/standardWidgets.vscode.common.test.ts b/src/test/datascience/widgets/standardWidgets.vscode.common.test.ts index fe3aca60431..c8f869ccc26 100644 --- a/src/test/datascience/widgets/standardWidgets.vscode.common.test.ts +++ b/src/test/datascience/widgets/standardWidgets.vscode.common.test.ts @@ -330,7 +330,7 @@ suite('Standard IPyWidget Tests @widgets', function () { // Also display the same nested output and the widget in the 3rd cell. await Promise.all([runCell(cell3), waitForCellExecutionToComplete(cell3)]); await assertOutputContainsHtml(cell1, comms, ['