diff options
| author | David Schulz <david.schulz@qt.io> | 2025-02-06 15:20:28 +0100 |
|---|---|---|
| committer | David Schulz <david.schulz@qt.io> | 2025-02-10 12:17:20 +0000 |
| commit | 441a1b3e91ace045d73902122cf9928b23143ba7 (patch) | |
| tree | 1084b519595e2f9c315f9f71c27bab0014b50bc9 /src/plugins/python/pythonlanguageclient.cpp | |
| parent | 5b5423b44220b683a6d3743396792961c7429a68 (diff) | |
Python: Fix assigning python documents to a pyls
The entry for document check was introduced to avolid adding temporary
documents to a python language server, but it seems it does not work
reliable. Using the explicit Document::isTemporary is superior for this
check.
Fixes: QTCREATORBUG-32468
Change-Id: Ie6e920e975a3dcc0fe17eeae02e7d3b9610e08e6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/python/pythonlanguageclient.cpp')
| -rw-r--r-- | src/plugins/python/pythonlanguageclient.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/plugins/python/pythonlanguageclient.cpp b/src/plugins/python/pythonlanguageclient.cpp index 5a77ca7991e..87cb1915023 100644 --- a/src/plugins/python/pythonlanguageclient.cpp +++ b/src/plugins/python/pythonlanguageclient.cpp @@ -342,10 +342,8 @@ void PyLSConfigureAssistant::installPythonLanguageServer(const FilePath &python, void PyLSConfigureAssistant::openDocument(const FilePath &python, TextEditor::TextDocument *document) { resetEditorInfoBar(document); - if (!PythonSettings::pylsEnabled() || !python.exists() - || !Core::DocumentModel::entryForDocument(document)) { + if (!PythonSettings::pylsEnabled() || !python.exists() || document->isTemporary()) return; - } if (auto client = pythonClients().value(python)) { LanguageClientManager::openDocumentWithClient(document, client); |
