Commit Graph

7 Commits

Author SHA1 Message Date
Nikolai Kosjar
07f32ef57a CppTools: Use fallback project part if project is closed
...instead of sticking to the old one.

If a project is closed, the editor should reflect that. It also simplifies the code.

Change-Id: I9b8a94513d3b06a238cfc4ee60c11c0d0da3d93f
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-01-26 07:50:05 +00:00
Nikolai Kosjar
0b8df41387 CppTools: Provide hints about chosen project part for editor document
Parse issues can have multiple reasons (invalid kit, not a project file,
actual parse issue) and we should be able to tell them apart. With this
change, we can distinguish between the fallback project part and a
ambiguous project part.

Follow up changes will use this to display more accurate diagnostics.

Change-Id: Icc8767607cc17dc14d6227b07f34e81ba5525a96
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-01-24 14:41:48 +00:00
Nikolai Kosjar
e4e6572661 CppTools: Allow interpreting ambiguous headers as C headers
...instead of C++ headers.

For the Clang Code Model this results in using "-x c-header" instead of
"-x c++-header".

This introduces a new option in Options > C++ > "Code Model" to
configure this.

Change-Id: I8a0ce8fa6155f5ef58743ebc7f1d0b500fbf6599
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2017-01-16 10:17:50 +00:00
Nikolai Kosjar
9861a58400 CppTools: Prioritize project parts with selectedForBuilding=true
...when selecting one for the editor document.

This flag is only set by the QmakeProject.

Change-Id: I648886e12148bd1ebeccca52d9faaf4b528597c9
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-12-19 09:21:19 +00:00
Nikolai Kosjar
602c873d3e CppTools: Reparse editor documents after active project change
Change-Id: I010709c866291bf59c27f4a05765e1ab0efd28af
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-12-16 13:56:31 +00:00
Nikolai Kosjar
566ab175b3 CppTools: Prioritize project parts from active project
...when selecting one for the editor document.

Change-Id: I85066aaa0862870cb2db2fb2cb40c2b2c23b2cac
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-12-16 13:56:16 +00:00
Nikolai Kosjar
ce1c6b2258 CppTools: Extract ProjectPartChooser
...and put it under tests.

Change-Id: Id4bd2391abd1dfdc23640e871453558566cb0693
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-12-16 13:40:23 +00:00