Yes, this is a bug or perhaps a missing feature. I just came to the forum to see if anybody else has reported it.
In the case of () or ], it should find the matching open ( or to the close ) or ] you haven’t yet typed. And in fact, that’s exactly what it’s doing.
Unfortunately, it’s what it does next that fails: it goes to the beginning of the line it found the matching “(” on and then finds the first “(” on that line as the indent position. At least I think that’s what is happening based on this test:
foobar(
self.innerFunctionCall(a,
b))
You can see that if the inner function call is on its own line, it works. If I put the inner call on the same line it fails:
foobar(self.innerFunctionCall(a,
b))
If this were implemented in python (and it should be) it would be easy to sort out.
What I wish for is a better API to manage paren matching in general. I think it might be time to implement one or borrow or modify the awesome BracketHighlighter package.
BTW, in the case of curly braces, it has to (1) find the matching “{” and THEN (for languages like C and Java) needs to go back another set of matching “()” to find the beginning of the if/else if/while/for statement to figure out the proper indent. Again this would be easy to do in python with the right primitives.