Python: remove static cast of client interface in client constructor

Change-Id: I475a2b79438b8392085f1d9bf2cdb8b7369efa68
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2022-06-15 12:44:44 +02:00
parent e74999cced
commit 591fc12ffa
2 changed files with 4 additions and 3 deletions

View File

@@ -181,9 +181,9 @@ PyLSClient *clientForPython(const FilePath &python)
return client; return client;
} }
PyLSClient::PyLSClient(BaseClientInterface *interface) PyLSClient::PyLSClient(PyLSInterface *interface)
: Client(interface) : Client(interface)
, m_extraCompilerOutputDir(static_cast<PyLSInterface *>(interface)->m_extraPythonPath.path()) , m_extraCompilerOutputDir(interface->m_extraPythonPath.path())
{ {
connect(this, &Client::initialized, this, &PyLSClient::updateConfiguration); connect(this, &Client::initialized, this, &PyLSClient::updateConfiguration);
connect(PythonSettings::instance(), &PythonSettings::pylsConfigurationChanged, connect(PythonSettings::instance(), &PythonSettings::pylsConfigurationChanged,

View File

@@ -40,12 +40,13 @@ namespace Internal {
class PySideUicExtraCompiler; class PySideUicExtraCompiler;
class PythonLanguageServerState; class PythonLanguageServerState;
class PyLSInterface;
class PyLSClient : public LanguageClient::Client class PyLSClient : public LanguageClient::Client
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit PyLSClient(LanguageClient::BaseClientInterface *interface); explicit PyLSClient(PyLSInterface *interface);
~PyLSClient(); ~PyLSClient();
void openDocument(TextEditor::TextDocument *document) override; void openDocument(TextEditor::TextDocument *document) override;