Code change:
this._storageListener.dispose(); } <del> $getValue<T>(shared: boolean, key: string): Promise<T | undefined> { </del> <ins> async $getValue<T>(shared: boolean, key: string): Promise<T | undefined> { </ins> if (shared) { this._sharedStorageKeysToWatch.set(key, true); } <del> try { return Promise.resolve(this._getValue<T>(shared, key)); } catch (error) { return Promise.reject(error); } </del> <ins> return this._getValue<T>(shared, key); </ins> } private _getValue<T>(shared: boolean, key: string): T | undefined { const jsonValue = this._storageService.get(key, shared ? StorageScope.GLOBAL : StorageScope.WORKSPACE); <del> if (!jsonValue) { return undefined; </del> <ins> if (jsonValue) { try { return JSON.parse(jsonValue); } catch (error) { // Do not fail this call but log it for diagnostics // https://github.com/microsoft/vscode/issues/132777 this._logService.error(`[mainThreadStorage] unexpected error parsing storage contents (key: ${key}, shared: ${shared}): ${error}`); } </ins> } <del> return JSON.parse(jsonValue); </del> <ins> return undefined; </ins> } <del> $setValue(shared: boolean, key: string, value: object): Promise<void> { let jsonValue: string; try { jsonValue = JSON.stringify(value); // Extension state is synced separately through extensions this._storageService.store(key, jsonValue, shared ? StorageScope.GLOBAL : StorageScope.WORKSPACE, StorageTarget.MACHINE); } catch (err) { return Promise.reject(err); } return Promise.resolve(undefined); </del> <ins> async $setValue(shared: boolean, key: string, value: object): Promise<void> { this._storageService.store(key, JSON.stringify(value), shared ? StorageScope.GLOBAL : StorageScope.WORKSPACE, StorageTarget.MACHINE /* Extension state is synced separately through extensions */); </ins> } $registerExtensionStorageKeysToSync(extension: IExtensionIdWithVersion, keys: string[]): void {

Related discussion:
text: <!-- Please search existing issues to avoid creating duplicates. --- VS Code version: 1.59.1 Extension version (available under the Extensions sidebar): v2021.8. OS and version: Linux x64 5.13.11-1-MANJARO Python version (& distribution if applicable, e.g. Anaconda): 3.9 Type of virtual environment used (N/A ...): virtualenvwrapper Relevant/affected Python-related VS Code extensions and their versions: pylance v2021.8.3, jupyter v2021.8., Visual Studio IntelliCode v1.2.14 Value of the setting: Pylance from the VS Code marketplace to see if that fixes your issue] Extension loads successfuly Extension does not load, console reports "Unexpected token ' in JSON at position " [NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue] the extension by clicking a .py file <!-- Note: If you think a GIF of what is happening would be helpful, consider tools like , or . --<details<summaryOutput for <codePython</codein the <codeOutput</codepanel (<codeView</code→<codeOutput</code, change the drop-down the upper-right of the <codeOutput</codepanel to <codePython</code) </summary<p</p</details
Looks like you might have a bad update. Do the following to remove stale versions of the extension: Python extension (if you have pylance uninstall it first). all instances of VS Code. to, (on windows) or on Linux/Mac. any folder with the name starting with VS Code, and install Python extension (also pylance if you uninstalled it in step 1).
I followed all steps, but nothing changed. should I try to install older version of python ext?
Hi Can you try installing an older version of the Python extension, and if it doesn't work can you try a different version of VS Code (either an old one or the Insiders build)?
I've installed python extension , jupyter and no pylance. here's the log: As you said I'm going to install older version of vscode
Hi Did you try installing an older version of VS Code?
FYI - This looks like some JSON stored via the became corrupt.