Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions bundled/tool/lsp_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ def _get_global_defaults():
"args": GLOBAL_SETTINGS.get("args", []),
"importStrategy": GLOBAL_SETTINGS.get("importStrategy", "useBundled"),
"showNotifications": GLOBAL_SETTINGS.get("showNotifications", "off"),
"configPath": GLOBAL_SETTINGS.get("configPath", ""),
}


Expand Down Expand Up @@ -499,6 +500,10 @@ def _run_tool_on_document(

argv += TOOL_ARGS + settings["args"] + extra_args

config_path = settings.get("configPath")
if config_path:
argv += ["--config", config_path]

if use_stdin:
# TODO: update these to pass the appropriate arguments to provide document contents
# to tool via stdin.
Expand Down
4 changes: 4 additions & 0 deletions src/common/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export interface ISettings {
interpreter: string[];
importStrategy: string;
showNotifications: string;
configPath: string;
}

export function getExtensionSettings(namespace: string, includeInterpreter?: boolean): Promise<ISettings[]> {
Expand Down Expand Up @@ -71,6 +72,7 @@ export async function getWorkspaceSettings(
interpreter: resolveVariables(interpreter, workspace),
importStrategy: config.get<string>(`importStrategy`) ?? 'useBundled',
showNotifications: config.get<string>(`showNotifications`) ?? 'off',
configPath: config.get<string>('configPath', ''),
};
return workspaceSetting;
}
Expand Down Expand Up @@ -99,6 +101,7 @@ export async function getGlobalSettings(namespace: string, includeInterpreter?:
interpreter: interpreter,
importStrategy: getGlobalValue<string>(config, 'importStrategy', 'useBundled'),
showNotifications: getGlobalValue<string>(config, 'showNotifications', 'off'),
configPath: getGlobalValue<string>(config, 'configPath', ''),
};
return setting;
}
Expand All @@ -111,6 +114,7 @@ export function checkIfConfigurationChanged(e: ConfigurationChangeEvent, namespa
`${namespace}.interpreter`,
`${namespace}.importStrategy`,
`${namespace}.showNotifications`,
`${namespace}.configPath`,
];
const changed = settings.map((s) => e.affectsConfiguration(s));
return changed.includes(true);
Expand Down