Commit Graph

64 Commits

Author SHA1 Message Date
David Schulz
468dcc67cb LSP: remove unused LanguageChooseDelegate
Change-Id: I1003d96e603789a9c627d5ecffb6051722c0862a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-10-16 08:52:27 +00:00
David Schulz
4a7051213b LSP: Create settings widget based on settings type
Change-Id: I4ecdfa386a33114a9d36d21e02ac5eecd9d8f3b7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-10-16 08:43:48 +00:00
David Schulz
c37bedfb02 LSP: split out settings specific for std io clients
Change-Id: I25eebfc15a9d0d5665e57137f016e54a069ca849
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-10-15 11:51:10 +00:00
Christian Stenger
b30f82d3fb LanguageClient: Sync settings on plugin initialization
Otherwise we might end up starting a second language server
when opening options page of Language Client plugin and
closing again with 'Ok' without modifying any setting.

Change-Id: I2b16436b92a0d622dc7df1b5fbdaf9f9f8e717a2
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-10-15 08:23:01 +00:00
David Schulz
df08e1ee3d LSP: Store settings in the settingspage
... and keep just a copy of it in the model. This way we
can easily reset the setting model content to a preedit state
without rereading it from the user settings file.

Change-Id: Id2f094caade7c56eff48fd9abce00d687e607a39
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-10-11 13:15:04 +00:00
Alessandro Portale
e8f28dbef3 LanguageClient: Add an options icon
Server "can" with speech bubble saying "<>".

Change-Id: I7eca0109aa5917f341f6310c8f175b1833ff9c00
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-10-05 07:42:22 +00:00
David Schulz
f5843a29bc LSP: make fromMap() a non static member function
Change-Id: I24844cae784921e0128f475b792453fa65c566ce
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-09-21 07:36:12 +00:00
David Schulz
dc155b407d LSP: rename LanguageClientSettings -> BaseSettings
And move the static init function to a separate class.

Change-Id: I7c924ce72ad74047e6bfdb04fa04a6132050a360
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-09-20 13:08:16 +00:00
David Schulz
d7b4f3fcf2 LSP: store settings on the heap
In preperation for specialized settings other than the stdio client

Change-Id: I20ca33fd1d714e4e0ca527de86261c0a58740d15
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-09-20 13:08:05 +00:00
David Schulz
1b2ad0e989 LSP: let the settings generate the client
In preperation for settings other than the stdio client.

Change-Id: I11635119db9165163947d822e911ee26ce8548f1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-09-20 13:04:54 +00:00
David Schulz
ba5f93003e LSP: correctly shutdown client that is currently being restarted
Change-Id: I9fb0ccd9aa181515efc9368b0b369dfc39dffcd1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-09-19 10:44:58 +00:00
David Schulz
87381bbf90 LSP: use QtcProcess::splitArgs for language server arguments
Also store the executable and arguments in the stdio client to get a
more accurate comparison of clients.

Change-Id: I84fdd4ea5f32b17198d3f08e7f5d494f7fbe67dc
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-09-11 10:04:52 +00:00
David Schulz
51e3613057 LSP: Use MimeType file filter for language servers
Change-Id: I13e06b5513c64e20590ab4caf15093a201025b94
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-09-10 10:49:48 +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