Clang: Fix determining current parameter

...for emphasis in the function signature tooltip when doing function
completion.

Braces, brackets and less/greater were not considered so that arguments
containing initializer lists, lambda captures or templates could lead to
the emphasis of no or the wrong parameter:

  void foo(VariantType t1, VariantType t2);

  void g(int x, int y)
  {
      foo({1,2, // Ops, no parameter emphasized
      foo({1,2}, // Ops, no parameter emphasized

      foo([x, y](){}, // Ops, no parameter emphasized

      foo(Bar<int, // Ops, second parameter emphasized
      foo(Bar<int, int>, // Ops, no parameter emphasized
  }

Change-Id: I2515fcbd892850b608bd90b35dd348ae522144b2
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
This commit is contained in:
Nikolai Kosjar
2015-12-09 18:23:31 +01:00
parent c0e1b1581b
commit f25b9cab14
2 changed files with 43 additions and 18 deletions

View File

@@ -50,7 +50,7 @@ public:
private:
ClangBackEnd::CodeCompletions m_functionSymbols;
mutable int m_currentArg;
mutable int m_currentArgument;
};
} // namespace Internal