You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Find the user or workspace settings.json folder, read settings.json, and append the stubs autocomplete settings to it
💡 Steps for implementing the feature
For updating the user settings.json:
@click.option(
"--settings_location",
default="user",
type=str,
help="Whether to update the settings.json file on the workspace or user level.",
)
if settings_location == "user":
if "win" in sys.platform:
settings_json = Path(os.environ.get("APPDATA")) / "Code" / "User" / "settings.json"
elif "lin" in sys.platform:
settings_json = (
Path(os.environ.get("HOME")) / ".config" / "Code" / "User" / "settings.json"
)
### settings_json_data code
# Combine the existing JSON with the autocomplete paths
combined_dict = {**data, **settings_json_data}
# Write the updated data back to the file
with open(settings_json, "w") as file:
json.dump(combined_dict, file, indent=4)
Unsure how to update workspace settings.json
Look for root pymechanical folder and search for .vscode/settings.json
Or, use javascript and the VSCode API to retrieve the workspace folder(s) - command line input may require the user to include the name of the workspace folder they want to update the settings in if there are multiple
📝 Description of the feature
Find the user or workspace settings.json folder, read settings.json, and append the stubs autocomplete settings to it
💡 Steps for implementing the feature
For updating the user settings.json:
Unsure how to update workspace settings.json
🔗 Useful links and references
Find the location of settings.json for workspace folder
VSCode API workspace folder
json5 - allows trailing commas
The text was updated successfully, but these errors were encountered: