Commit Graph

5 Commits

Author SHA1 Message Date
David Schulz
7a7dcc9064 LSP: Fix positions for code completions
The columns are also zero based. All previously checked language server
that were tested seem to ignore the fact that the completion was
triggered outside of the line when triggering a completion on the last
character in a line. Never the less this issue can easily be reproduced
with other than the go language server when trying to complete code in
the middle of a line.

Fixes: QTCREATORBUG-21325
Change-Id: I1485f041a27b8fe8b85de4e13bac8bbb296dbf69
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-10-17 08:26:48 +00:00
David Schulz
727ea78a5d LSP: restrict automatic completion
Only request an automatic completion if the cursor is after at least 3
'identifier' characters (alphanumerical characters and underscore).

Change-Id: I1bac8f184042fb68135ce24c20d17fc134aae5ac
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-10-16 13:44:14 +00:00
Orgad Shaneh
bdc2b4b59f Remove hard-coded disabling of debug logs
Instead, set the default level of all logs to QtWarningMsg.

The call to setFilterRules overrides the user preferences in qtlogging.ini.

Change-Id: Id5f6cd550d14ff7f45ae04c5d3110e0bafb0f072
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-10-13 16:36:58 +00:00
David Schulz
ff948fad87 LSP: Do not automatically accept completion while typing
Task-number: QTCREATORBUG-21049
Change-Id: If1b944efaaf43d5e400653de9e1371d133bd1228
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-09-11 06:31:28 +00:00
David Schulz
d61d29cf16 Introduce a basic client for the language server protocol
The language server protocol is used to transport language specific
information needed to efficiently edit source files. For example
completion, go to operations and symbol information. These information
are transferred via JSON-RPC. The complete definition can be found under
https://microsoft.github.io/language-server-protocol/specification.

This language server protocol support consists of two major parts, the
C++ representation of the language server protocol, and the client part
for the communication with an external language server.

The TypeScript definitions of the protocol interfaces are transferred to
C++ classes. Those classes have getter and setter for every interface
value. Optional values from the protocol are represented by
Utils::optional<ValueType>. The JSON objects that are used to transfer
the data between client and server are hidden by a specialized
JsonObject class derived from QJsonObject. Additionally this JsonObject
provides a validity check that is capable of creating a detailed error
message for malformed, or at least unexpected JSON representation of the
protocol.

The client is the interface between Qt Creator and language server
functionality, like completion, diagnostics, document and workspace
synchronization. The base client converts the data that is sent from/to
the server between the raw byte array and the corresponding C++ objects.
The transportat layer is defined in a specialized base client (this
initial change will only support stdio language server). The running
clients are handled inside the language client manager, which is also
used to connect global and exclusive Qt Creator functionality to the
clients.

Task-number: QTCREATORBUG-20284
Change-Id: I8e123e20c3f14ff7055c505319696d5096fe1704
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-09-03 08:00:46 +00:00