Hi @ravirahman
Thanks for looking into this. I followed your suggestions, but no luck.
- Python interpreter selected (3.12.8, using the extension Python Envy by teticio to swap between python venvs managed by uv in my multi-project monorepo)
- “python.languageServer”: “None” (in my defaultSettings.json. I don’t have this key in my user settings or workspace settings)
- Cursor Pyright: Import Pylance Settings
- Reload window
Still seeing “No refactorings available” when I right click on a classname and select “Refactor”.
I have the following python-related extensions installed:
- Python by Anysphere
- Ruff by charliermarsh
- Python by ms-python (required by Ruff)
- Python by teticio (I use this for managing multiple python environments in one workspace)
I’ve tried disabling each of them and still had the same problem. Is this an MS Pylance feature that is missing from Cursor Pyright?
In case this helps, here are all of my settings files with any mention of Python I can find:
.vscode/settings.json
{
// Python settings
"[python]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "explicit"
},
"python.analysis.extraPaths": [
"${workspaceFolder}/lib/src",
"${workspaceFolder}/frontend/src",
"${workspaceFolder}/backend/app"
],
},
// Let VS Code discover the Poetry environments
"python.analysis.autoImportCompletions": true,
"python.analysis.indexing": true,
"python.analysis.typeCheckingMode": "basic",
"yaml.schemas": {
"./data/questions/v4/schema-questionnaire-v4.json": ["data/questions/v4/**/*.{yaml,yml}"],
"./data/questions/v1/schema-questionnaire-v1.json": ["data/questions/v1/**/*.{yaml,yml}"]
},
"python.REPL.enableREPLSmartSend": false,
"cursorpyright.analysis.autoImportCompletions": true,
"cursorpyright.analysis.typeCheckingMode": "basic",
}
Cursor/User/settings.json
...
"[python]": {
"diffEditor.ignoreTrimWhitespace": false,
"editor.defaultColorDecorators": "never",
"gitlens.codeLens.symbolScopes": [
"!Module"
],
"editor.formatOnType": true,
"editor.wordBasedSuggestions": "off"
},
...
defaultSettings.json
...
// Path to the State Tool executable for ActiveState runtimes (version 0.36+).
"python.activeStateToolPath": "state",
// List of paths to libraries and the like that need to be imported by auto complete engine. E.g. when using Google App SDK, the paths are not in system path, hence need to be added into this list.
"python.autoComplete.extraPaths": [],
// Path to the conda executable to use for activation (version 4.4+).
"python.condaPath": "",
// Show or hide Create Environment button in the editor for `requirements.txt` or other dependency files.
"python.createEnvironment.contentButton": "hide",
// Detect if environment creation is required for the current project
"python.createEnvironment.trigger": "prompt",
// Path to default Python to use when extension loads up for the first time, no longer used once an interpreter is selected for the workspace. See [here](https://aka.ms/AAfekmf) to understand when this is used
"python.defaultInterpreterPath": "python",
// Absolute path to a file containing environment variable definitions.
"python.envFile": "${workspaceFolder}/.env",
// Enables A/B tests experiments in the Python extension. If enabled, you may get included in proposed enhancements and/or features.
"python.experiments.enabled": true,
// List of experiments to opt into. If empty, user is assigned the default experiment groups. See [here](https://github.com/microsoft/vscode-python/wiki/AB-Experiments) for more details.
"python.experiments.optInto": [],
// List of experiments to opt out of. If empty, user is assigned the default experiment groups. See [here](https://github.com/microsoft/vscode-python/wiki/AB-Experiments) for more details.
"python.experiments.optOutFrom": [],
// Whether to install Python modules globally when not using an environment.
"python.globalModuleInstallation": false,
// Controls when to display information of selected interpreter in the status bar.
// - never: Never display information.
// - onPythonRelated: Only display information if Python-related files are opened.
// - always: Always display information.
"python.interpreter.infoVisibility": "onPythonRelated",
// Defines type of the language server.
// - Default: Automatically select a language server: Pylance if installed and available, otherwise fallback to Jedi.
// - Jedi: Use Jedi behind the Language Server Protocol (LSP) as a language server.
// - Pylance: Use Pylance as a language server.
// - None: Disable language server capabilities.
"python.languageServer": "None",
// [Experimental] Select implementation of environment locators. This is an experimental setting while we test native environment location.
"python.locator": "js",
// This setting is deprecated. Please use command `Developer: Set Log Level...` to set logging level.
// The logging level the extension logs at, defaults to 'error'
"python.logging.level": "error",
// Set severity of missing packages in requirements.txt or pyproject.toml
"python.missingPackage.severity": "Hint",
// Path to the pipenv executable to use for activation.
"python.pipenvPath": "pipenv",
// Path to the pixi executable.
"python.pixiToolPath": "pixi",
// Path to the poetry executable.
"python.poetryPath": "poetry",
// Toggle Smart Send for the Python REPL. Smart Send enables sending the smallest runnable block of code to the REPL on Shift+Enter and moves the cursor accordingly.
"python.REPL.enableREPLSmartSend": true,
// Toggle to provide variables for the REPL variable view for the native REPL.
"python.REPL.provideVariables": true,
// Toggle to send code to Python REPL instead of the terminal on execution. Turning this on will change the behavior for both Smart Send and Run Selection/Line in the Context Menu.
"python.REPL.sendToNativeREPL": false,
// Activate Python Environment in the current Terminal on load of the Extension.
"python.terminal.activateEnvInCurrentTerminal": false,
// Activate Python Environment in all Terminals created.
"python.terminal.activateEnvironment": true,
// When executing a file in the terminal, whether to use execute in the file's directory, instead of the current open folder.
"python.terminal.executeInFileDir": false,
// When launching a python terminal, whether to focus the cursor on the terminal.
"python.terminal.focusAfterLaunch": false,
// Python launch arguments to use when executing a file in the terminal.
"python.terminal.launchArgs": [],
// Enable [shell integration](https://code.visualstudio.com/docs/terminal/shell-integration) for the terminals running python. Shell integration enhances the terminal experience by enabling command decorations, run recent command, improving accessibility among other things.
"python.terminal.shellIntegration.enabled": false,
// Enable auto run test discovery when saving a test file.
"python.testing.autoTestDiscoverOnSaveEnabled": true,
// Glob pattern used to determine which files are used by autoTestDiscoverOnSaveEnabled.
"python.testing.autoTestDiscoverOnSavePattern": "**/*.py",
// Optional working directory for tests.
"python.testing.cwd": null,
// Port number used for debugging of tests.
"python.testing.debugPort": 3000,
// Prompt to configure a test framework if potential tests directories are discovered.
"python.testing.promptToConfigure": true,
// Arguments passed in. Each argument is a separate item in the array.
"python.testing.pytestArgs": [],
// Enable testing using pytest.
"python.testing.pytestEnabled": false,
// Path to pytest. You can use a custom version of pytest by modifying this setting to include the full path.
"python.testing.pytestPath": "pytest",
// Arguments passed in. Each argument is a separate item in the array.
"python.testing.unittestArgs": [
"-v",
"-s",
".",
"-p",
"*test*.py"
],
// Enable testing using unittest.
"python.testing.unittestEnabled": false,
// Folders in your home directory to look into for virtual environments (supports pyenv, direnv and virtualenvwrapper by default).
"python.venvFolders": [],
...