Commit Graph

490 Commits

Author SHA1 Message Date
Nikolai Kosjar
69504c25ca C++: Document::functionAt provides line information
Needed for the debugger.

Change-Id: I6465f6dc53017df212e403ea8a9a1c7977ac1671
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-11-12 12:29:51 +01:00
Nikolai Kosjar
cefd1832ce C++: Include class name for inline functions in functionAt
The code that constructed the fully qualified name used
enclosingNamespace() which skips classes.

Use LookupContext::fullyQualifiedName() instead.

Change-Id: Ic03a91c0fe120c52dc69f3e78e82a574458d8314
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-11-11 11:50:46 +01:00
Nikolai Kosjar
079e7a500f C++: Tests: Make document_functionAt data driven
Change-Id: I8e811b21c584e7b6a2b8eb61830cb680f6fefa95
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-11-11 11:23:13 +01:00
Christian Kandeler
9d677e3302 qbs build: Remove unneeded import statements.
The respective items are available without it.

Change-Id: Idc840cf08e7bec84f561c096afe8de25b1fb8468
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2014-11-10 15:45:14 +01:00
Orgad Shaneh
e871225057 C++: Add a failing test for pp concat bug
Task-number: QTCREATORBUG-13219
Change-Id: I6278d7977f0ce560e793838c90cfbc867e1af025
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-11-07 08:52:31 +01:00
Orgad Shaneh
b4112d7806 Tests: Fix compilation
Broken by ca151d07fa.

Change-Id: Ic6b58b5749d5811d1250840c81d692837e9a2cea
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-11-07 08:18:28 +01:00
Nikolai Kosjar
390b4f0e0b C++: Fix parsing of "Foo *foo = new Foo()"
It should be parsed as an DeclarationStatement, but instead it was
parsed as an ExpressionStatement.

Regression introduced with

    commit d3c5fff66d.
    C++: Fix expensive parsing of expressions

The introduced ASTCache did not save the correct return value of a
parse* function. Because of that, the first return in
Parser::parseExpressionList returned false on the second invocation
(cache hit), instead of true, which resulted in an ExpressionStatement.

Task-number: QTCREATORBUG-13122
Change-Id: I8dbd8852b0909edddcd3195b484f4cea92328cc5
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2014-10-15 10:08:19 +02:00
Eike Ziller
ea27143239 Merge remote-tracking branch 'origin/3.2'
Conflicts:
	src/libs/utils/ipaddresslineedit.cpp
	src/libs/utils/logging.h
	src/plugins/analyzerbase/AnalyzerBase.pluginspec.in
	src/plugins/android/Android.pluginspec.in
	src/plugins/android/androiddeploystep.cpp
	src/plugins/android/androiddeploystep.h
	src/plugins/android/androiddeploystepfactory.cpp
	src/plugins/android/androiddeploystepwidget.cpp
	src/plugins/android/androidpackagecreationfactory.cpp
	src/plugins/android/androidpackagecreationstep.cpp
	src/plugins/android/androidpackagecreationstep.h
	src/plugins/android/androidpackagecreationwidget.cpp
	src/plugins/android/androidpackagecreationwidget.h
	src/plugins/android/javafilewizard.cpp
	src/plugins/autotoolsprojectmanager/AutotoolsProjectManager.pluginspec.in
	src/plugins/baremetal/BareMetal.pluginspec.in
	src/plugins/bazaar/Bazaar.pluginspec.in
	src/plugins/beautifier/Beautifier.pluginspec.in
	src/plugins/bineditor/BinEditor.pluginspec.in
	src/plugins/bookmarks/Bookmarks.pluginspec.in
	src/plugins/clangcodemodel/ClangCodeModel.pluginspec.in
	src/plugins/clangcodemodel/clanghighlightingsupport.cpp
	src/plugins/clangcodemodel/clangsymbolsearcher.cpp
	src/plugins/classview/ClassView.pluginspec.in
	src/plugins/clearcase/ClearCase.pluginspec.in
	src/plugins/cmakeprojectmanager/CMakeProjectManager.pluginspec.in
	src/plugins/cmakeprojectmanager/cmakeeditorfactory.cpp
	src/plugins/cmakeprojectmanager/cmakehighlighter.cpp
	src/plugins/coreplugin/Core.pluginspec.in
	src/plugins/cpaster/CodePaster.pluginspec.in
	src/plugins/cppeditor/CppEditor.pluginspec.in
	src/plugins/cppeditor/cppfilewizard.cpp
	src/plugins/cpptools/CppTools.pluginspec.in
	src/plugins/cpptools/cpphighlightingsupportinternal.cpp
	src/plugins/cpptools/cppmodelmanagerinterface.cpp
	src/plugins/cpptools/cppmodelmanagerinterface.h
	src/plugins/cvs/CVS.pluginspec.in
	src/plugins/debugger/Debugger.pluginspec.in
	src/plugins/designer/Designer.pluginspec.in
	src/plugins/diffeditor/DiffEditor.pluginspec.in
	src/plugins/emacskeys/EmacsKeys.pluginspec.in
	src/plugins/fakevim/FakeVim.pluginspec.in
	src/plugins/genericprojectmanager/GenericProjectManager.pluginspec.in
	src/plugins/git/Git.pluginspec.in
	src/plugins/git/gitorious/gitorious.cpp
	src/plugins/git/gitorious/gitorious.h
	src/plugins/git/gitorious/gitoriousclonewizard.cpp
	src/plugins/git/gitorious/gitorioushostwidget.cpp
	src/plugins/git/gitorious/gitorioushostwidget.h
	src/plugins/git/gitorious/gitorioushostwizardpage.cpp
	src/plugins/git/gitorious/gitoriousprojectwidget.cpp
	src/plugins/git/gitorious/gitoriousprojectwidget.h
	src/plugins/git/gitorious/gitoriousprojectwizardpage.cpp
	src/plugins/git/gitorious/gitoriousprojectwizardpage.h
	src/plugins/git/gitorious/gitoriousrepositorywizardpage.cpp
	src/plugins/git/gitorious/gitoriousrepositorywizardpage.h
	src/plugins/glsleditor/GLSLEditor.pluginspec.in
	src/plugins/glsleditor/glsleditorfactory.cpp
	src/plugins/glsleditor/glslfilewizard.cpp
	src/plugins/helloworld/HelloWorld.pluginspec.in
	src/plugins/help/Help.pluginspec.in
	src/plugins/imageviewer/ImageViewer.pluginspec.in
	src/plugins/ios/Ios.pluginspec.in
	src/plugins/macros/Macros.pluginspec.in
	src/plugins/mercurial/Mercurial.pluginspec.in
	src/plugins/perforce/Perforce.pluginspec.in
	src/plugins/projectexplorer/ProjectExplorer.pluginspec.in
	src/plugins/pythoneditor/PythonEditor.pluginspec.in
	src/plugins/pythoneditor/pythoneditorwidget.cpp
	src/plugins/pythoneditor/wizard/pythonfilewizard.cpp
	src/plugins/qbsprojectmanager/QbsProjectManager.pluginspec.in
	src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp
	src/plugins/qmakeprojectmanager/QmakeProjectManager.pluginspec.in
	src/plugins/qmakeprojectmanager/profileeditorfactory.cpp
	src/plugins/qmldesigner/QmlDesigner.pluginspec.in
	src/plugins/qmljseditor/QmlJSEditor.pluginspec.in
	src/plugins/qmljseditor/qmljseditorfactory.cpp
	src/plugins/qmljstools/QmlJSTools.pluginspec.in
	src/plugins/qmlprofiler/QmlProfiler.pluginspec.in
	src/plugins/qmlprojectmanager/QmlProjectManager.pluginspec.in
	src/plugins/qnx/Qnx.pluginspec.in
	src/plugins/qtsupport/QtSupport.pluginspec.in
	src/plugins/remotelinux/RemoteLinux.pluginspec.in
	src/plugins/resourceeditor/ResourceEditor.pluginspec.in
	src/plugins/resourceeditor/resourcewizard.h
	src/plugins/subversion/Subversion.pluginspec.in
	src/plugins/tasklist/TaskList.pluginspec.in
	src/plugins/texteditor/TextEditor.pluginspec.in
	src/plugins/texteditor/basetexteditor_p.h
	src/plugins/texteditor/basetextmark.cpp
	src/plugins/texteditor/codeassist/basicproposalitemlistmodel.h
	src/plugins/texteditor/codeassist/defaultassistinterface.h
	src/plugins/texteditor/codeassist/iassistproposalitem.cpp
	src/plugins/texteditor/itexteditor.cpp
	src/plugins/texteditor/itexteditor.h
	src/plugins/texteditor/itextmark.cpp
	src/plugins/texteditor/plaintexteditor.cpp
	src/plugins/texteditor/plaintexteditor.h
	src/plugins/texteditor/texteditoractionhandler.cpp
	src/plugins/todo/Todo.pluginspec.in
	src/plugins/updateinfo/UpdateInfo.pluginspec.in
	src/plugins/valgrind/Valgrind.pluginspec.in
	src/plugins/vcsbase/VcsBase.pluginspec.in
	src/plugins/welcome/Welcome.pluginspec.in
	src/plugins/winrt/WinRt.pluginspec.in
	tests/auto/debugger/temporarydir.h

Change-Id: I254af8be8119fe9855287909e17d4b8ca9d2fc2f
2014-10-14 15:36:16 +02:00
Eike Ziller
8295b503be License update
Change-Id: I3c22ef2685d7aa589f5d0ab74d693653a4c32082
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-10-09 11:41:44 +02:00
Nikolai Kosjar
c2e5f1c819 C++: Pass on the byte offsets of macro arguments
...to the Document/Block.

Change-Id: I1a96dc70ac93254e6030326b36a5df9a2cdc2bd8
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-10-08 09:51:17 +02:00
Nikolai Kosjar
4da91bef8d C++: Fix endless loop in lookup on Windows
...for templates with typedefs referencing the respectively other
template (basic_ostream <-> ostreambuf_iterator).

Tested with MSVC 2013.

Regression introduced by ba42ceb0cb.

Task-number: QTCREATORBUG-13064
Task-number: QTCREATORBUG-13065
Change-Id: I71a45c720663a73c3302eb7da731e6ad2d8f0fbd
Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
2014-09-25 11:35:47 +02:00
Nikolai Kosjar
c9f309f9be C++: Tests: Extract some functions in tst_checksymbols
...so we can use them in a follow-up change.

Change-Id: I0ddc5bb966e72ab5c527f6814650d70492bbbdb5
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-09-25 11:29:23 +02:00
Oswald Buddenhagen
ca492c8fac use DISTFILES instead of OTHER_FILES in creator's own build system
it's the correct variable to use.

Change-Id: I9ec7795099097715a64969516cd3fae9e213a0f4
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
2014-09-15 12:10:01 +02:00
Nikolai Kosjar
89bd4ee3c4 C++: Base parsing on editor document instead of widget
This mainly takes CppEditorSupport apart.

* Parsing is now invoked by CPPEditorDocument itself by listening to
  QTextDocument::contentsChanged().

* Upon construction and destruction CPPEditorDocument creates and
  deletes an EditorDocumentHandle for (un)registration in the model
  manager. This handle provides everything to generate the working copy
  and to access the editor document processor.

* A CPPEditorDocument owns a BaseEditorDocumentProcessor instance that
  controls parsing, semantic info recalculation and the semantic
  highlighting for the document. This is more or less what is left from
  CppEditorSupport and can be considered as the backend of a
  CPPEditorDocument. CPPEditorDocument itself is quite small.

    * BuiltinEditorDocumentProcessor and ClangEditorDocumentProcessor
      derive from BaseEditorDocumentProcessor and implement the gaps.

    * Since the semantic info calculation was bound to the widget, it
      also calculated the local uses, which depend on the cursor
      position. This calculation got moved into the extracted class
      UseSeletionsUpdater in the cppeditor plugin, which is run once the
      cursor position changes or the semantic info document is updated.

    * Some more logic got extracted:
	- SemanticInfoUpdater (logic was in CppEditorSupport)
	- SemanticHighlighter (logic was in CppEditorSupport)

    * The *Parser and *Processor classes can be easily accessed by the
      static function get().

* CppHighlightingSupport is gone since it turned out to be useless.

* The editor dependency in CompletionAssistProviders is gone since we
  actually only need the file path now.

Change-Id: I49d3a7bd138c5ed9620123e34480772535156508
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-08-25 13:06:01 +02:00
Erik Verbruggen
271c1bb89a C++: change return type to enum.
And not have it converted to int after converting to unsigned.

Change-Id: If95caec46936c2a140c3fbd668fa2f085a9287ed
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-08-20 14:08:48 +02:00
Nikolai Kosjar
6a9ae7e25f CppTools: Auto-include pre-compiled headers
So far the pre-compiled headers were processed (thus defines from those
headers were visible), but the actual includes for the documents were
not added, which is necessary for lookup/completion.

Note that this will be only done if pre-compiled headers are not ignored
(Options > C++ > Code Model > [] Ignore pre-compiled headers).

Change-Id: I54a8e6b00597af164d958e3e9f2a1075ea187788
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-07-24 12:25:02 +02:00
Nikolai Kosjar
d3c5fff66d C++: Fix expensive parsing of expressions
For expression statements like "(g(g(g(...(g(0))...))))" we reparsed
quite much again and again for nothing. The high-level trace for this
expression looks like this:

    parseCastExpression
      parseTypeId
        parseAbstractDeclarator
          parseAbstractCoreDeclarator
          parseParameterDeclarationClause (--> DEEP)
            ...

      parseUnaryExpression
        ...
        parseCorePostfixExpression
          parseTypeId (--> DEEP)
          parsePrimaryExpression (--> DEEP)

Especially parseTypeId is expensive in this case and it's called two
times, both from the same token (index).

With this patch, we remember for certain ASTs the parse results and
re-use them when needed.

Change-Id: I013d1c064c655636bc94db408097863b5e183fc2
Task-number: QTCREATORBUG-12252
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-07-24 12:06:50 +02:00
Nikolai Kosjar
1926493fe9 C++: Tests: Run ASTVisitor on parsed document
...as a sanity check.

Change-Id: I391276e41c5180d0df72fa6267f58801bf2d5da3
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-07-24 12:06:36 +02:00
Erik Verbruggen
45b1169d06 C++: Support alignas in C++11 mode.
Change-Id: Ifa81a481bf92b5b71495a105ae292f3e9895f704
Task-number: QTCREATORBUG-9279
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-07-22 16:43:51 +02:00
Erik Verbruggen
5d45e0b69a C++: block recursion when parsing subsequent case statements.
A case or a default statement must be followed by another statement.
When a such a case (or default) statement is followed immediately by
another case (or default) statement, then this would create a linked
list, and the parser will recurse to parse such input.

In order to prevent the parser running out of stack space while
recursing, parse this corner case by blocking parsing a labeled
statement as the first statement after a labeled statement.

The advantage is that these statements do not form a linked list, so any
subsequent visitation of the AST won't run out of stack space either.

Change-Id: Id2111a49509132997f5fbe4bb12c92c729ec2522
Task-number: QTCREATORBUG-12673
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-07-22 15:45:02 +02:00
Nikolai Kosjar
33a80e56cc C++: Fix return type of lambda
Relying on "_type" for the lambda was wrong.

In case of the bug report the return type of the lambda happened to be
the template class. Because of that Clone never stopped cloning.

Change-Id: I377d12e6a8278198abd1488fbdbc89b4157c1357
Task-number: QTCREATORBUG-12631
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-07-10 12:12:46 +02:00
Nikolai Kosjar
04d655dee0 C++: Fix preprocessor line offsets
In TranslationUnit, the "normal" lines are based on utf16char offsets,
but the preprocessor lines were based on byte/latin1 offsets.

The preprocessor lines are now based on utf16char offsets, too.

Task-number: QTCREATORBUG-7356
Change-Id: I3c41d1dcee8e9e487210f36da806b0229d3f4cd0
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-07-04 14:03:44 +02:00
Nikolai Kosjar
06e2c3309e C++: Fix "duplicate data type in declaration" for lambdas
The "_type" wasn't reset.

Task-number: QTCREATORBUG-12521
Change-Id: I0d38cb38e270260065313d1235d42f2689385850
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-07-04 12:29:28 +02:00
Nikolai Kosjar
38b8940bd4 C++: Fix parsing designators vs lambdas
The introduction of C99 designators led to parsing problems with lambdas
that were passed in as a function arguments.

Fixed by prefering to parse without designators first. This will be
cleaner/clearer once the appropriate "LanguageFeatures" from the Project
Parts will be passed in.

Change-Id: Ia9cb7c4a4c9345e729cf2044e1e5411fe63e33ec
Reviewed-by: Wang Hoi <wanghoi@126.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-06-24 16:14:40 +02:00
Wang Hoi
c56b999fff C: Parser: Support parsing of c99 designated initializers
In case:

    int a[6] = { [4] = 29, [2] = 15 };
    struct point { int x, y; };
    struct point p = { .y = 3, .x = 2 };

Grammar change when c99 language feature is enabled:
old grammar:

    braced-init-list :: '{' initializer-list '}'

new grammar:

    braced-init-list :: '{' designated-initializer-list '}'
    designated-initializer-list :: designated-initializer (',' designated-initializer )*
    designated-initializer :: designator* initializer-clause
    designator :: '.' identifier
                | '[' constant-expression ']'

Task-number: QTCREATORBUG-1902
Change-Id: Ib99d6f553f8d0f50ba3eff86f3a2e86d73372426
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-06-17 16:23:23 +02:00
Christian Kamm
e85c6f4b38 C++11: Fix parsing of expressions like vector<int>{1}.
The parser considers '{' an operator and thus thought
"template-id {" couldn't possibly be valid. This patch adds
'{' as an exception to the rule.

Change-Id: I40730fcdc5cade48566b4c8b6fde390f455bbdba
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-06-16 20:06:58 +02:00
Przemyslaw Gorszkowski
9b6d4573aa C++: fix 'using' in separate block of scope
Task-number: QTCREATORBUG-12357
Change-Id: I7397b0e66783d3249daa5a8ee422bfd5f5bc7bea
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-06-13 23:32:07 +02:00
Eike Ziller
2786250c17 Merge remote-tracking branch 'origin/3.1'
Conflicts:
	qtcreator.pri
	qtcreator.qbs
	src/shared/qbs

Change-Id: Iba59e41db72e2afdf594f1f7003215d7d8d1e6d3
2014-06-13 10:51:51 +02:00
Przemyslaw Gorszkowski
21007a6b5d C++: add test for anonymous with __attribute__
Change-Id: I1938ed1bf45523ec62f35bc3324f6553c0dafe22
Sanity-Review: Qt Sanity Bot <qt_sanitybot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-06-13 08:04:37 +02:00
Przemyslaw Gorszkowski
b90452e309 C++: fix nested anonymous with __attribute__
Task-number: QTCREATORBUG-12345
Change-Id: Ib2316ebdc81393b38185b9cb659fb85b78753e7b
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-06-06 15:38:02 +02:00
Nikolai Kosjar
655470cc0c C++: Tests: Fix unicode tests with MSVC
Change-Id: I5575826558bf60982ecc964e4dd85a3f4e920197
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
2014-06-05 08:14:57 +02:00
Christian Kamm
eee94667e6 C++11: Fix parsing of trailing-type-specifier.
In particular "auto foo() -> typename Foo<T>::X;" didn't parse.

Change-Id: I7665c9b387e222e4107f053a529d502813ebf617
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-06-04 09:17:56 +02:00
Christian Stenger
c18eabe1aa Tests: Fix compilation on Win
Change-Id: I19e418fb05462e80b97f4d821cfa72b0b880ea5b
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-05-26 15:22:33 +02:00
Nikolai Kosjar
7e99cf2b69 C++: Tests: Clean up tst_checksymbols
Change-Id: I9859ebbb57c1bb5b1382c7980bedb737df61542a
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-05-23 14:34:45 +02:00
Nikolai Kosjar
c6358e5d38 C++: Add utf16 indices to Macro and Document::MacroUse
In most cases we need to work with the utf16 indices. Only in
cppfindreferences the byte interface is still needed since there we read
in files and work on a QByteArray to save memory.

Change-Id: I6ef6a93fc1875a8c9a305c075d51a9ca034c41bb
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-05-23 14:34:01 +02:00
Nikolai Kosjar
bea8fc8e6a Cpp{Tools,Editor}: Expect UTF-8 encoded literals
Change-Id: I9843c4163aad3fa3f1bfa33060c76328fc2dc25a
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-05-23 14:24:23 +02:00
Nikolai Kosjar
57ff992961 C++/CppTools: Pass UTF-8 encoded source to Lexer
The Lexer can handle it now.

Task-number: QTCREATORBUG-7356
Change-Id: I8c4b03a247656e013d44c3cedca4835e133d4036
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-05-23 14:23:41 +02:00
Nikolai Kosjar
587eb49c4e C++: TranslationUnit::getPosition takes utf16char offsets
...and not byte offsets anymore. This is necessary in order to calculate
the line and column numbers correctly with respect to unicode code
points.

Change-Id: I5d79857b3eaefeb8d563b4f1e3938a64debc5e08
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-05-23 14:23:24 +02:00
Nikolai Kosjar
70122b3061 C++: Support for UTF-8 in the lexer
This will save us toLatin1() conversations in CppTools (which already
holds UTF-8 encoded QByteArrays) and thus loss of information (see
QTCREATORBUG-7356). It also gives us support for non-latin1 identifiers.

API-wise the following functions are added to Token. In follow-up
patches these will become handy in combination with QStrings.
    utf16chars() - aequivalent of bytes()
    utf16charsBegin() - aequivalent of bytesBegin()
    utf16charsEnd() - aequivalent of bytesEnd()

Next steps:
 * Adapt functions from TranslationUnit. They should work with utf16
   chars in order to calculate lines and columns correctly also for
   UTF-8 multi-byte code points.
 * Adapt the higher level clients:
    * Cpp{Tools,Editor} should expect UTF-8 encoded Literals.
    * Cpp{Tools,Editor}: When dealing with identifiers on the
      QString/QTextDocument layer, code points
      represendet by two QChars need to be respected, too.
 * Ensure Macro::offsets() and Document::MacroUse::{begin,end}() report
   offsets usable in CppEditor/CppTools.

Addresses QTCREATORBUG-7356.

Change-Id: I0791b5236be8215d24fb8e38a1f7cb0d279454c0
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-05-23 14:23:15 +02:00
Orgad Shaneh
904a1d78f4 CppTools: Fix indentation of stream operators after string
Task-number: QTCREATORBUG-12053
Change-Id: Ia34165d860bd7fd371a84a8349bed7a3fe1c01a9
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-05-16 15:59:56 +02:00
Nikolai Kosjar
60c4235bec C++: Tests: Allow comparing specific members of Token
A follow-up patch will enhance this.

Change-Id: Ie92ae3542098d8b7c996110152cd83eb85c398e7
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2014-05-16 15:48:36 +02:00
Orgad Shaneh
82aa1380f2 Cleanup whitespace
Mostly trailing whitespace

Change-Id: Ic324d20e8159c9d255895248ce04f25c692daf46
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2014-05-16 14:27:13 +02:00
Alessandro Portale
551f7e1caf QString(QLatin1String()) -> QString::fromLatin1()
Change-Id: I93bdd926ca1c7a37a298335711069d985f1f91dd
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-05-09 09:03:19 +02:00
Orgad Shaneh
e9aaf21517 Centralize addition of plugin library paths
Change-Id: I9ddcc193b4d927c3d566eeb81c41f79a75920696
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-05-08 15:29:21 +02:00
Orgad Shaneh
6aad96d89b Nuke plugins PROVIDER settings
Place all plugins in lib/qtcreator/plugins

Change-Id: I66606910104b28d91038f5607850ce03bdd1b80f
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-05-08 15:29:11 +02:00
Christian Kandeler
5c9f175133 qbs build: Make the autotest template available as an import.
Just like for QtcPlugin, QtcLibrary etc.

Change-Id: I395f5863f31abba589864be3ad41ad7fc893787f
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
2014-05-08 11:01:44 +02:00
Christian Kandeler
eccc1198d6 Use double quotes instead of single quotes as per our guidelines.
Change-Id: Ib608bb49e26781aef1914085a5d801fcdcd5eb56
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
2014-04-22 10:06:40 +02:00
Przemyslaw Gorszkowski
df5d9f99fb C++: fix findusage for member of typedefed anonymous struct
Task-number: QTCREATORBUG-11859
Task-number: QTCREATORBUG-11860
Change-Id: I7484b3b88daefbb3c76bb86a9b573e8291072872
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
(cherry picked from commit 5416557a0b)
Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-04-04 12:07:06 +02:00
Orgad Shaneh
aeb2cfbc4f CppTools: Fix indentation for concatenated strings
Change-Id: I801a56804e7873be75a9ebc085dc3f4a2d64ea35
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-03-31 18:18:42 +02:00
Przemyslaw Gorszkowski
5416557a0b C++: fix findusage for member of typedefed anonymous struct
Task-number: QTCREATORBUG-11859
Task-number: QTCREATORBUG-11860
Change-Id: I7484b3b88daefbb3c76bb86a9b573e8291072872
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-03-31 18:16:52 +02:00