Disable language services if Pyrefly extension installed + active by kinto0 · Pull Request #24987 · microsoft/vscode-python (original) (raw)

This error:

2025-04-16 15:22:19.725 [error] [
  'Starting language server, Class name = p, completed in 11208ms, has a falsy return value, , Return Value: undefined',
  [Error: command 'pyright.createtypestub' already exists
      at cw.registerCommand (file:///private/var/folders/x0/z3j4vbzs3wqd0ynb6q24jglm0000gn/T/AppTranslocation/58C97911-06B4-4CA7-9068-D7D7F655735D/d/Visual%20Studio%20Code%202.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:115:31527)
      at Object.registerCommand (file:///private/var/folders/x0/z3j4vbzs3wqd0ynb6q24jglm0000gn/T/AppTranslocation/58C97911-06B4-4CA7-9068-D7D7F655735D/d/Visual%20Studio%20Code%202.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:157:36729)
      at t.ExecuteCommandFeature.register (/Users/kylei/.vscode/extensions/ms-python.python-2025.4.0-darwin-arm64/out/client/extension.js:2:2101514)
      at t.ExecuteCommandFeature.initialize (/Users/kylei/.vscode/extensions/ms-python.python-2025.4.0-darwin-arm64/out/client/extension.js:2:2101091)
      at P.initializeFeatures (/Users/kylei/.vscode/extensions/ms-python.python-2025.4.0-darwin-arm64/out/client/extension.js:2:2041419)
      at P.doInitialize (/Users/kylei/.vscode/extensions/ms-python.python-2025.4.0-darwin-arm64/out/client/extension.js:2:2027694)
      at async P.start (/Users/kylei/.vscode/extensions/ms-python.python-2025.4.0-darwin-arm64/out/client/extension.js:2:2024707)
      at async Object.start (/Users/kylei/.vscode/extensions/ms-python.vscode-pylance-2025.4.1/dist/extension.bundle.js:1:148233)
      at async _0x317b05._startClient (/Users/kylei/.vscode/extensions/ms-python.vscode-pylance-2025.4.1/dist/extension.bundle.js:1:84298)
      at async _0x317b05._createNewRequest (/Users/kylei/.vscode/extensions/ms-python.vscode-pylance-2025.4.1/dist/extension.bundle.js:1:83758)
      at async _0x317b05._enqueueRequestAndWaitForRun (/Users/kylei/.vscode/extensions/ms-python.vscode-pylance-2025.4.1/dist/extension.bundle.js:1:83000)
      at async _0x317b05.startClient (/Users/kylei/.vscode/extensions/ms-python.vscode-pylance-2025.4.1/dist/extension.bundle.js:1:82482)
      at async h.start (/Users/kylei/.vscode/extensions/ms-python.python-2025.4.0-darwin-arm64/out/client/extension.js:2:39831)]
]

Usually happens when pyright and pylance are enabled at the same time. It might also happen if pylance is started twice for some reason.