vsapsai added a comment.

A few approaches that I've considered but decided not to pursue:

- Change code completion in comment so we don't exit file early but more 
gracefully. Decided not to do it because I believe early exit is important for 
code completion performance. And `CurLexer`/`CurLexerKind` discrepancy would 
remain anyway, which is not good.
- Use `RemoveTopOfLexerStack` instead of `recomputeCurLexerKind`. It works but 
I'm not confident it doesn't have undesired consequences. And I don't like that 
after removing the top of lexer stack, pushing back tokens would happen on top 
of includer, not on top of includee. But it might be totally OK.
- Add assertion in `InCachingLexMode` that returned value is in sync with 
`CurLexerKind`. It works but I suspect there might be legitimate reasons for 
them to be out of sync for some time. Though it can be a mistake and assertion 
can help to catch it.


https://reviews.llvm.org/D41688



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to