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

support global pyright setting in zed settings #10587

Open
1 task done
geoqiao opened this issue Apr 16, 2024 · 7 comments
Open
1 task done

support global pyright setting in zed settings #10587

geoqiao opened this issue Apr 16, 2024 · 7 comments
Labels
enhancement [core label] language An umbrella label for all programming languages syntax behaviors python Python programming language support

Comments

@geoqiao
Copy link

geoqiao commented Apr 16, 2024

Check for existing issues

  • Completed

Describe the feature

support global pyright setting in zed settings so that users don't need to generate pyrightconfig.json in every project dir.

If applicable, add mockups / screenshots to help present your vision of the feature

No response

@geoqiao geoqiao added admin read Pending admin review enhancement [core label] triage Maintainer needs to classify the issue labels Apr 16, 2024
@JosephTLyons JosephTLyons added python Python programming language support language An umbrella label for all programming languages syntax behaviors and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Apr 16, 2024
@geoqiao
Copy link
Author

geoqiao commented Apr 27, 2024

something like:

  "lsp": {
    "pyright": {
      "enabled": true,
      "pythonVersion": "3.11",
      "venvPath": ".",
      "venv": ".venv",
      "typeCheckingMode": "strict",
      "strictListInference": true,
      "reportDuplicateImport": true,
      "reportMissingImports": true,
      "reportMissingTypeStubs": false,
      "defineConstant": { "DEBUG": true }
    }
  }

or pylance in VSCode:

{
    "python.languageServer": "Pylance",
    "python.analysis.typeCheckingMode": "basic",
    "python.analysis.diagnosticSeverityOverrides": {
        "reportMissingModuleSource": "none"
    },
    "python.analysis.typeshedPaths": [
        ".venv/Lib/site-packages"
    ],
    "python.linting.enabled": true,
    "python.linting.pylintEnabled": true,
}

@FilipeBisinella
Copy link
Contributor

Made a PR that should allow this:

#14265

@jsnjack
Copy link

jsnjack commented Jul 17, 2024

@FilipeBisinella

Dependency resolution still doesn't work for me with the folowing configuration in settings.json:

  "lsp": {
    "pyright": {
      "settings": {
        "python": {
          "venvPath": ".",
          "venv": ".venv"
        }
      }
    }
  }

At the same time, it works fine with pyrightconfig.json:

{
  "venvPath": ".",
  "venv": ".venv"
}

I'm running zed preview 0.144.3 f11a992

@FilipeBisinella
Copy link
Contributor

The pyright global settings are different from the pyrightconfig.json ones.
Try with:

  "lsp": {
    "pyright": {
      "settings": {
        "python": {
          "pythonPath": ".venv/bin/python"
        }
      }
    }
  }

@jsnjack
Copy link

jsnjack commented Jul 18, 2024

Got it!

I tried setting pythonPath, also no luck

@FilipeBisinella
Copy link
Contributor

Looks like this PR was included in the v0.145.0-pre release.

@jsnjack
Copy link

jsnjack commented Jul 21, 2024

Thanks, I have just updated to 0.145 and it works well 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement [core label] language An umbrella label for all programming languages syntax behaviors python Python programming language support
Projects
None yet
Development

No branches or pull requests

4 participants