Commit Graph

10 Commits

Author SHA1 Message Date
Ivan Donchevskii
918713a059 ClangFormat: Make more readable helper functions
Change-Id: I25828a17104a778d4be156bf2a2879cefbd08691
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-10-24 12:23:49 +00:00
Ivan Donchevskii
cafd5ced1a Clang: Significantly improve ClangFormat plugin usability
What's new:
1. New LibFormat option is used to prevent lines shrink,
   which allows to drop most of tricks used before for that purpose.
2. Cached UTF-8 source code is used to improve performance
3. Improved error handling.
4. Slightly improved UI.

Change-Id: I4605200fa103167369a40650b2e1ad2c61e8133b
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-10-17 07:16:04 +00:00
Ivan Donchevskii
352ac2ccf4 Utils: Fix column returned from helper function
The second function overload must also return 1-based column.

Change-Id: I1d3a58c9267e4a8c8a031c72230f963596a7bb2b
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-10-11 12:13:03 +00:00
Ivan Donchevskii
931ec39f64 Clang: Change the way completion fix-its are shown
Move the completion information to the tooltip and
show fix-it icon on the right of such item.

Change-Id: I7eff410384104387e547695171e4864760c07fb9
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-10-02 12:26:18 +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
Ivan Donchevskii
0f96f735f0 Clang: Provide all overloads for function definition completion
When we complete a function definition with the parameter list
it is important to have multiple entries to select.

Change-Id: I25e94b58cfe4831387d66eecdec74712addb7ec5
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-08-02 12:47:17 +00:00
Orgad Shaneh
7cee991c70 Utils: Remove superfluous qualifications
Change-Id: I36e17dac0cff87f82f0ddaf97bc613389110f218
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-07-19 08:21:29 +00:00
Ivan Donchevskii
a91956f300 Utils: Move common positionInText function to Utils::Text
Change-Id: I5d74a73058ca457b0fb3f13eaf945f224d5699fb
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-06-19 09:20:53 +00:00
Marco Bubke
e0ea602f6c Clang: Use LineColumn instead of explicit integers for line and column
With OptionalLineColumn we don't need any bool return parameter any more.

Change-Id: I6f57f221c1bfdf08a92a87a7d71ea0eecf83dbcf
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-01-17 12:22:30 +00:00
Ivan Donchevskii
80a472740d TextEditor: move convenience from texteditor to utils
Allows to use this header without texteditor dependency.

Change-Id: I706f42799c3ea42473a716fa9ef9f3cfbef6fdd4
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-09-22 12:59:35 +00:00