Without using the proper tokenizer, I'm not sure we can get around all these edge cases. The current tokenizer absolutely doesn't work across multiple lines, although I think your second example should work if we knew to pass in `StaleResults.No`.

For the first example, we could add some more heuristics so that we do not show the completion list if the longidents/residue are empty *unless* the previous non-whitespace character is a closing bracket of some kind. It is getting more fragile, so either there comes a point where this is "good enough" or we have to switch over to using the tokenizer in the background. This would be a shame for editors using fsautocomplete because I'm not sure it is feasible for that interface.