Update for new config schema

This commit is contained in:
Jake Howard 2021-04-11 14:24:17 +01:00
parent 0e6581339c
commit 78d92acb15
Signed by: jake
GPG key ID: 57AFB45680EDD477

View file

@ -4,7 +4,6 @@ from pathlib import Path
import json import json
import itertools import itertools
import subprocess import subprocess
from io import StringIO
HOME = Path.home() HOME = Path.home()
@ -29,7 +28,8 @@ def get_search_project_dirs():
def get_vscode_project_dirs(): def get_vscode_project_dirs():
vscode_config = json.loads(VSCODE_CONFIG_FILE.read_text()) vscode_config = json.loads(VSCODE_CONFIG_FILE.read_text())
for recent_path in itertools.chain(*vscode_config['openedPathsList'].values()): for entry in vscode_config['openedPathsList']['entries']:
recent_path = entry.get('folderUri')
if not recent_path: if not recent_path:
continue continue
recent_path_path = Path(recent_path.replace('file://', '')) recent_path_path = Path(recent_path.replace('file://', ''))