Python: Use specialized document to check for pylsp

Change-Id: I9ea13df7fc04a4fe35d901da179b9c0ebaf57bb6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2022-03-15 13:14:14 +01:00
parent 4a6d6d1323
commit b8c8e0ccae
4 changed files with 20 additions and 18 deletions

View File

@@ -635,19 +635,6 @@ static void enablePythonLanguageServer(const FilePath &python,
}
}
void PyLSConfigureAssistant::documentOpened(Core::IDocument *document)
{
auto textDocument = qobject_cast<TextEditor::TextDocument *>(document);
if (!textDocument || textDocument->mimeType() != Constants::C_PY_MIMETYPE)
return;
const FilePath &python = detectPython(textDocument->filePath());
if (!python.exists())
return;
instance()->openDocumentWithPython(python, textDocument);
}
void PyLSConfigureAssistant::openDocumentWithPython(const FilePath &python,
TextEditor::TextDocument *document)
{