mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fixed content assist in if conditional to take into account the if loop.
This commit is contained in:
parent
6a40f67a52
commit
40969959b8
1 changed files with 10 additions and 4 deletions
|
@ -1871,11 +1871,17 @@ public abstract class AbstractGNUSourceCodeParser implements ISourceCodeParser {
|
||||||
condition = condition();
|
condition = condition();
|
||||||
if (LT(1) == IToken.tEOC) {
|
if (LT(1) == IToken.tEOC) {
|
||||||
// Completing in the condition
|
// Completing in the condition
|
||||||
result = createIfStatement();
|
IASTIfStatement new_if = createIfStatement();
|
||||||
result.setCondition(condition);
|
new_if.setCondition(condition);
|
||||||
condition.setParent(result);
|
condition.setParent(new_if);
|
||||||
condition.setPropertyInParent(IASTIfStatement.CONDITION);
|
condition.setPropertyInParent(IASTIfStatement.CONDITION);
|
||||||
return result;
|
|
||||||
|
if (if_statement != null) {
|
||||||
|
if_statement.setElseClause(new_if);
|
||||||
|
new_if.setParent(if_statement);
|
||||||
|
new_if.setPropertyInParent(IASTIfStatement.ELSE);
|
||||||
|
}
|
||||||
|
return result != null ? result : new_if;
|
||||||
}
|
}
|
||||||
consume(IToken.tRPAREN);
|
consume(IToken.tRPAREN);
|
||||||
} catch (BacktrackException b) {
|
} catch (BacktrackException b) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue