Python: Centralize interpreter specific function in the aspect

... and expose that instead of the PythonRunConfiguration.

This makes the PythonRunConfiguration more the container of aspects,
similar to where the other runconfigs move.

Change-Id: Ibc76b706f2d4d334640ea8f3b91343f9e7c0f566
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
hjk
2023-07-05 09:30:51 +02:00
parent 7a28ed76b8
commit b3df9a4fcf
3 changed files with 59 additions and 37 deletions

View File

@@ -207,8 +207,9 @@ void PyLSClient::openDocument(TextEditor::TextDocument *document)
const FilePath documentPath = document->filePath();
if (PythonProject *project = pythonProjectForFile(documentPath)) {
if (Target *target = project->activeTarget()) {
if (auto rc = qobject_cast<PythonRunConfiguration *>(target->activeRunConfiguration()))
updateExtraCompilers(project, rc->extraCompilers());
if (RunConfiguration *rc = target->activeRunConfiguration())
if (auto aspect = rc->aspect<PythonInterpreterAspect>())
updateExtraCompilers(project, aspect->extraCompilers());
}
} else if (isSupportedDocument(document)) {
const FilePath workspacePath = documentPath.parentDir();