Let's say I type this ("|" shows the text cursor): def foo(): a=2 def bar(): b=4 c=b| and move the cursor to the beginning of the line: def foo(): a=2 def bar(): b=4 |c=b If I delete one indentation level by backspacing four spaces: def foo(): a=2 def bar(): b=4 |c=b the code is not reparsed, and 'b' is still highlighted as a known variable, thinking the 'c' assignment is still inside the 'bar' function. Typing *anything* other than a space will trigger a reparse and make 'b' in the last line get highlighted as an unknown variable (yellow underline). Similarly, if I have this: def foo(): a=2 def bar(): b=4 | code completion shows 'a' and 'b' as known local variables. But if I delete one level of indentation and complete again, it still shows 'b' (even though it's not in scope), and typing or deleting anything will trigger a reparse and make completion become correct (not showing 'b'). Very strangely, if I unindent by pressing Shift-Space instead of deleting the four spaces, the code *is* reparsed immediately, and both highlighting and completion correctly reflect the scope change.
Git commit 74926cc388978e376d7ca50d9e1d15bbba6afb81 by Sven Brauch. Committed on 10/10/2015 at 15:25. Pushed by brauch into branch 'master'. Fix the WhitespaceSensitivity feature for reparsing. This never looked at removed text ... M +13 -11 language/backgroundparser/documentchangetracker.cpp http://commits.kde.org/kdevplatform/74926cc388978e376d7ca50d9e1d15bbba6afb81
> Very strangely, if I unindent by pressing Shift-Space > instead of deleting the four spaces, the code *is* reparsed > immediately, and both highlighting and completion correctly reflect the scope change. That is because Shift+Tab removes the line, unindents it and then inserts it again. ;)