Commit Graph

131 Commits

Author SHA1 Message Date
Marco Bubke
855bf6b007 Clang: Inline TranslationUnitDoesNotExistMessage
Change-Id: Ib1f23410163036eb8de603eb3eef82c14428a8a5
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-07-19 13:51:44 +00:00
Marco Bubke
e840ee3263 Clang: Inline TranslationUnitDoesNotExistMessage
Change-Id: Ib46149912790d7f9e4231d36a4b62cd0d7c66401
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-07-19 13:51:35 +00:00
Marco Bubke
ee87fcb489 Clang: Inline RegisterProjectPartsForEditorMessage
Change-Id: I910c122ae9ab12b9d27d3fd1363e6d3cbe602b46
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-07-19 13:51:28 +00:00
Marco Bubke
5bb5f7ae6d Clang: Inline CodeCompletion
Change-Id: I69871aba33a7ca3b09b00452d07828fc05d605cc
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-07-19 13:51:19 +00:00
Marco Bubke
c62bf3e4e7 Clang: Inline CodeCompletedMessage
Change-Id: I9f65bd95efe3a02848db6e9cadddc22c88b19902
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-07-19 13:51:11 +00:00
Marco Bubke
96e370e1ca Clang: Inline CompleteCodeMessage
Change-Id: I7009ab3986cb2c8ff7b5c7a77ff22a35bc5d2b10
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-07-19 13:51:03 +00:00
Marco Bubke
4eae621df9 Clang: Inline UnregisterTranslationUnitsForEditorMessage
Change-Id: If4adf19cc4ea9325a6f94d4c2b989609e1e83239
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-07-19 13:50:54 +00:00
Marco Bubke
66c8b86ff4 Clang: Inline FileContainer
Change-Id: Id27d0369c7e67fd4aa61b6d908b6cc7a8ee1de75
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-07-19 13:50:43 +00:00
Marco Bubke
32d8e4a74f Clang: Inline RegisterTranslationUnitForEditorMessage
Change-Id: I07b28a757dfc019a46617433491756385d646d96
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-07-19 13:50:36 +00:00
Marco Bubke
73c12e7ebc Clang: Inline EchoMessage
Change-Id: I59821d4b901ef23bb8127c52601dded9c5346544
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-07-19 13:50:22 +00:00
Marco Bubke
3177bbe01c Clang: Inline AliveMessage
Change-Id: Ibe10ff1324bc83d7cc8ddd6ad69bef077d3f1ec8
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-07-19 13:50:13 +00:00
Marco Bubke
df1a197aee Clang: Inline EndMessage
Change-Id: Id24d5f786e5f47798c2d1a8e46081dfcd7f67913
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-07-19 13:50:05 +00:00
Marco Bubke
48bb527607 Clang: Silence warning
Change-Id: I2b3cdc22678b5454fbd831ad41b7186461289441
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-07-19 13:38:01 +00:00
Marco Bubke
6e4da842ef Clang: Fix call of already destroyed virtual table
Task-number: QTCREATORBUG-16597
Change-Id: Ic5391ba7529de5b5ef5de260f4a5e831003ffbf6
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-07-18 16:33:31 +00:00
Nikolai Kosjar
8f9c42c640 Clang: Merge highlighting/diagnostics messages
The messages

    RequestDiagnosticsMessage
    RequestHighlightingMessage

and

    DiagnosticsChangedMessage
    HighlightingChangedMessage

are always send/received together, so merge them into

    RequestDocumentAnnotationsMessage
    DocumentAnnotationsChangedMessage

Change-Id: I6a0b6281ed1e6efe6cb18386afe99b1d1fb58abf
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-07-18 13:17:27 +00:00
Tim Jenssen
dd009004f5 ClangBackend: fix windows build
Change-Id: I10aa1df96d5e1381056b33c03009ae19301a3f3e
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2016-07-14 12:21:02 +00:00
Christian Stenger
13bdf29688 ClangBackend: Fix compile on OSX
Broke with 2c698dff86.

Change-Id: Ie1d5779ffa23fbb75e882d37813900b003266398
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-07-12 10:35:08 +00:00
Marco Bubke
2c698dff86 Clang: Make ConnectionServer adaptable
The server and client are adaptable by template parameter.

Change-Id: Ia28e2863ca73b633689964ea1df6df08f8358ac1
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-07-12 09:08:47 +00:00
Marco Bubke
ae9962c60c Clang: Remove ClangCodeModelClientDispatcher
We always use one client and the dispatching is removing to possibility
of moving commands. Moving the client to IpcServerInterface improves the
code sharing.

Change-Id: I5f102ab7907239572534b7d4c2848abbaade69b6
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-07-12 09:08:28 +00:00
Marco Bubke
c5e79f6269 Clang: Decouple ConnectionClient and ClangCodeModel*
We want to reuse the connection client in other plugins. This is the first
step, the next step is refactoring the IPC mechanismn and move it up to
the IpcServer- and IpcClientInterface.

Change-Id: I6eb6db1e9bc18232c8df350a6303afd2edc68da8
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-07-12 09:08:23 +00:00
Marco Bubke
cda6e3c15a Clang: Start ConnectionClient asynchronously
The connection client can block main thread at start up. This patch is
removing the wait functions and using signals instead.

Change-Id: I847c98b095752f6a875c0365bc27361bc5bdd051
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-07-12 09:07:39 +00:00
Marco Bubke
d027cab44e Clang: Rename Ipc* in ClangCodeModel*
We want to share more functionality of the IPC mechanism and for what we
need more interface classes. But we use this names already for the
ClangCodeModel implementation. So we rename the them to ClangCodeModel*.

Change-Id: Ie320e0d3b993586a9bcc6a5aa0d32427af41202e
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-06-30 09:28:56 +00:00
Marco Bubke
01316c28f2 Clang: Print message if message is lost
If there is a message counter mismatch it is very helpful to get message
content.

Change-Id: I4ea2526bd4b72010627e99de08ff9a8e64ca3d02
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-06-27 14:55:01 +00:00
Nikolai Kosjar
90bd65479b Clang: Fix warning
readmessageblock.cpp:95:36: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]

Change-Id: I24c5125f2116e5538b7d0e2389e66bf5d318640a
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-06-23 06:41:21 +00:00
Marco Bubke
eba6da37c6 Clang: Fix aliasing
Task-number: QTCREATORBUG-15888
Change-Id: I0f2e28e9e0da53481c03707ab0a9abf728c7419f
Reviewed-by: hjk <hjk@theqtcompany.com>
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-06-22 12:44:25 +00:00
David Schulz
80b149935e Clang: Fix incorrect size check of message reader.
Change-Id: Ia734c5234d899e71da46d8111299cf8f86dc67c2
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2016-06-21 09:02:20 +00:00
Christian Kandeler
94d7d18404 qbs build: Remove some differences to qmake build results.
- Install library symlinks.
- Do not create symlinks for plugins.
- Skip some translations.
- Rename some binaries.
- Do not install the ptracepreload library.

Change-Id: I0faa98034154e3840cd2695cab14b72c34cfc5c3
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-05-17 09:10:34 +00:00
Eike Ziller
0f94aa3f4d Merge remote-tracking branch 'origin/4.0'
Conflicts:
	src/plugins/debugger/debuggerruncontrol.cpp
	src/plugins/projectexplorer/projectwizardpage.cpp
	src/plugins/projectexplorer/xcodebuildparser.h
	src/plugins/qmldesigner/qmldesignerplugin.cpp
	src/tools/clangbackend/ipcsource/translationunits.cpp

Change-Id: Ibf0857cf8dbf95fc9ac13d5c2112b3f4a2ca7de6
2016-05-03 11:49:01 +02:00
BogDan Vatra
05739d1d6b Fix compile
Change-Id: I5c8889639c61ff11c8b159c3bd1ef63246664922
Reviewed-by: hjk <hjk@theqtcompany.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-05-02 06:28:02 +00:00
David Schulz
cc04b84917 Fix compiler warnings on windows.
Ignore some warnings inside 3rd party code and fix a lot of conversion
warnings.

Change-Id: I909f2f31a4639015bf7dd028d2d435ff1d1167bc
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-04-22 07:37:31 +00:00
Eike Ziller
ee8bf341c6 Merge remote-tracking branch 'origin/4.0'
Conflicts:
	src/plugins/projectexplorer/session.cpp
	src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp

Change-Id: I6946139f5e5fa3a9cdbb322fd50be248e2c0133f
2016-04-20 14:58:48 +02:00
Nikolai Kosjar
70e3665c86 Clang: Forward clangbackend output to qDebug instead of stdout/stderr
Now the output of the clangbackend can be viewed with DebugView on Windows.

Downside is that qDebug() will append newlines. This can't be turned off
easily. We accept that.

Change-Id: I7d68bfcf05780c8bcb4a05a538d2d1542a6a6f22
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
2016-04-15 14:55:36 +00:00
hjk
39a38d5679 Wholesale conversion to #pragma once
Kudos to cgmb and https://github.com/cgmb/guardonce

Change-Id: Ifa8970734b8d43fd08c9260c645bdb0228633791
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-03-30 15:20:19 +00:00
Marco Bubke
f8e64a87bb Clang: Add Declaration highlighting
We are adding declaration detection for function to the highligher on
user request. Other declaration will follow in separate patches.

Task-number: QTCREATORBUG-15564
Change-Id: I54e97c26425f8d6e9854547d50a9ac8fa076b4e8
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2016-03-07 12:07:21 +00:00
Marco Bubke
2349b13ae5 Clang: Rename HighlightingInformation to HighlightingMark
Change-Id: I3954c7c9abe593ea04092337f48ac2b153e883ba
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2016-03-07 12:06:40 +00:00
Marco Bubke
7984e928d1 UnitTests: Rename CLANGBACKEND_TESTS in UNIT_TESTS
Change-Id: I26635a0c85edcc90cdffb93d3f9ae4ad4c8cb98e
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-17 14:57:53 +00:00
Tobias Hunger
36118a5cb0 ClangBackend: Fix warning about unused member variable
Change-Id: I0608eb32f77bb677f1fecc1c75082ecf29ff1aa8
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-12 10:40:57 +00:00
Marco Bubke
974070d2c8 Clang: Use MessageEnvelop instead of QVariant
QVariant has unwanted dependencies so we provided our own simpler solution.
We want to support move only types and calling the copy constructor as you
move the value in and outside. This copying is adding unwanted overhead
too.

Change-Id: I2e27a7924868efe81e8b8ff3415499c9fa22c2bc
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2016-02-08 14:11:44 +00:00
Tobias Hunger
f72370f20a Update License according to agreement with Free Qt Foundation
* Update remaining files in src

Change-Id: I1896f17fcf34f71c3310c87899fb5171b8e4afb1
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:59:41 +00:00
Nikolai Kosjar
8d6549fa74 Clang: Correct member access operator if possible
1 struct Foo { int member; };
 2 void f(Foo *foo)
 3 {
 4     foo.<REQUEST COMPLETION> // correct '.' to '->' and provide results
 5 }

The preferred approach would be to check if "foo" in line 4 is of
pointer type, but there is no suitable cursor (only CompoundStmt) at
that position since the code is usually not yet parsed and thus invalid.

Thus, just run the completion as is. If there are not any results for a
dot completion, re-run the completion with "." exchanged by "->". This
approach is inherently slower than the preferred approach implemented in
the built-in code model.

The following rare cases are not handled:

 1) Requesting completion after white space:
      Works: foo.<COMPLETE HERE>
      Fails: foo. <COMPLETE HERE>

 2) Opening a file and requesting completion (ctrl+space) without prior
    editing. No editing before triggering completion means that no
    unsaved file is generated on the backend side, which is a
    requirement for the correction.

Task-number: QTCREATORBUG-11581
Change-Id: I6bc8e8594778774ab342755fdb01a8a3e5c52ba0
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2016-01-19 13:20:35 +00:00
Yuchen Deng
fc6a0c68a6 Clang: Clangbackendipc build fix
Change-Id: I750521cca5e101e679b79cf45f995f5cca8f07bb
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2016-01-05 05:15:24 +00:00
Marco Bubke
8d6c10b241 Clang: Flatten code completion chunks
Avoid the sub vector for performance reason and use an flag for every
optional argument because there can be no recursion.

Change-Id: Iae1eaa1f164e4129e30358a1719582e5231f0385
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-12-16 12:16:08 +00:00
Nikolai Kosjar
0af0bd8e36 Clang: Show type icon for usings/typedefs
...in the completion widget.

Task-number: QTCREATORBUG-15078
Change-Id: I1309b628e1f060fa68bdcf13838037728207b035
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-12-08 13:05:02 +00:00
Marco Bubke
19d9dc0ce3 Clang: Use line and column instead of offset for diagnostics
Offsets can be get wrong because of the utf8 <-> utf16 differences. Line
and columns are not that sensitive to it.

Change-Id: I2e3e8c000621b6d694a4ada6df176f29427794f5
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-12-07 11:10:05 +00:00
Marco Bubke
493a2a6189 Clang: Fix slowness of code completion after opening the file
Task-number: QTCREATORBUG-15429
Change-Id: I9a8a582fb3c59a960425f83eb8e7b436f15d1c1a
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-12-02 12:37:25 +00:00
Marco Bubke
5f29a00c89 Clang: Change temporary directory for clangbackend
This is meant to

  1. Work around a libclang bug on Windows (not deleting preamble files)
  2. Delete left-over preamble files in case of a clangbackend crash

The temporary diretory will be removed on Qt Creator exit.

Task-number: QTCREATORBUG-10988
Change-Id: Ia5837c2a6ab2d55366d167dd591d87faaededf3e
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-12-01 12:24:55 +00:00
Marco Bubke
7ce9ef9db4 Clang: Integrate highlighting results from backend
Change-Id: I2c3fb69aabfe075bde76d63eafc2ca370f17493c
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-11-26 15:19:27 +00:00
Nikolai Kosjar
7874d61998 Clang: Enable not exporting symbols
Having a dllexport in the sources for a TEMPLATE=app project (e.g.
unittest.pro) will create a library on Windows, which is not needed.

Change-Id: I1ebdd8b5ada06965c3dd89074ac2bc6dff09299c
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-11-26 13:56:50 +00:00
Marco Bubke
8c3959534d Clang: Add current and visible editor message
Change-Id: Ifd88bc032388ae7a8d3dbc0f1f5746665074cc18
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-11-25 14:48:35 +00:00
Marco Bubke
bcd93b594e Clang: Extract highlighting information
Prepare the move of the semantic highlighting to the clang back end. We
have it under tests too so it should be quite easy to make changes or
corrections.

Change-Id: I5706a8a06fde5a9ba2eba3a8ba62782102ac0bd3
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-11-17 12:41:37 +00:00