Skip to content
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

Pylance support broken in Zowe Explorer 3.x.x #3331

Open
EmmasBox opened this issue Nov 19, 2024 · 2 comments
Open

Pylance support broken in Zowe Explorer 3.x.x #3331

EmmasBox opened this issue Nov 19, 2024 · 2 comments
Assignees
Labels
bug Something isn't working priority-medium Not functioning - next quarter if capacity permits severity-medium Bug where workaround exists or that doesn't prevent the usage of Zowe. Just makes it more complex.

Comments

@EmmasBox
Copy link

Describe the bug

Pylance no longer provides general help like autocomplete and highlighting unused imports

To Reproduce

  1. Install Pylance alongside Zowe Explorer
  2. Open script with unused import or try autocomplete with python

Expected behavior

Previously Pylance would be able to do autocomplete with basic python and also if packages like ZOAU were also installed locally on my workstation.

Copy link

Thank you for creating a bug report.
We will investigate the bug and evaluate its impact on the product.
If you haven't already, please ensure you have provided steps to reproduce the bug and as much context as possible.

@JTonda JTonda added priority-medium Not functioning - next quarter if capacity permits severity-medium Bug where workaround exists or that doesn't prevent the usage of Zowe. Just makes it more complex. labels Nov 26, 2024
@zowe-robot zowe-robot moved this from New Issues to Medium Priority in Zowe Explorer for VS Code Nov 26, 2024
@t1m0thyj
Copy link
Member

t1m0thyj commented Dec 6, 2024

In Zowe Explorer V3 we adopted the VS Code FileSystemProvider API to store files in memory rather than downloading them to a temp folder. This prevents some issues we had in V2 where upload errors could cause local and remote contents to get out of sync, and enabled us to add new features like breadcrumb navigation in the editor and drag-and-drop operations in tree views.

Some VS Code extensions like Pylance don't yet fully support custom URI schemes in file paths, such as zowe-ds: and zowe-uss: used by the FileSystemProvider API. We have reported this issue to the Pylance team: microsoft/pylance-release#6612. They are working on virtual file support but have not provided an ETA.

In the meantime there is a workaround to enable Pylance autocompletion for Zowe Explorer files, but unfortunately not a very convenient one as it requires having a dedicated workspace for using ZE. If you create a VS Code workspace and add a USS folder that contains Python files to this workspace, then Pylance should work in this workspace as long as there are no local files/folders added to it. I've included steps below for how to add a USS folder to a VS Code workspace, and in ZE v3.1 this will be made easier with the addition of an "Add to Workspace" right-click action in the USS tree view.


To add a USS folder or data set to your VS Code workspace:

  1. If you don’t already have a workspace, create one by selecting in the VS Code menu “File -> Save Workspace As”.
  2. Open the workspace configuration file from the VS Code command palette. Open it by pressing "Ctrl+Shift+P" or selecting in the VS Code menu “View -> Command Palette”. Then find the command “Workspaces: Open Workspace Configuration File” and run it.
  3. In the workspace file, define a new object inside the “folders” array like the following. Replace PROFILE_NAME with the name of your z/OSMF profile, and USS_PATH or DS_NAME with the absolute USS path or fully qualified data set name. The value for “name” can be whatever you want - it controls the display name of the virtual folder in the File Explorer pane.
    • For a USS folder:
      {
          "name": "Zowe USS",
          "uri": "zowe-uss:/PROFILE_NAME/USS_PATH"
      }
      
    • For a data set:
      {
          "name": "Zowe DS",
          "uri": "zowe-ds:/PROFILE_NAME/DS_NAME"
      }
      
  4. Navigate to your files or members using the File Explorer pane in VS Code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority-medium Not functioning - next quarter if capacity permits severity-medium Bug where workaround exists or that doesn't prevent the usage of Zowe. Just makes it more complex.
Projects
Status: Medium Priority
Development

No branches or pull requests

3 participants