Builtins highlighting: fixed a regression, added a test.

This commit is contained in:
Dmitry Cheryasov
2010-05-25 19:57:32 +03:00
parent f5c4a5c60b
commit 06b85d2f21
2 changed files with 4 additions and 2 deletions
@@ -64,12 +64,12 @@ public class PyBuiltinAnnotator extends PyAnnotator {
if (tgt != null) {
Annotation ann = getHolder().createInfoAnnotation(tgt, null);
ann.setTextAttributes(PyHighlighter.PY_PREDEFINED_USAGE);
return true;
}
}
}
return false;
}
return true;
return false;
}
}
+2
View File
@@ -3,12 +3,14 @@
# func decl: red bold
# class decl: blue bold
# predefined decl: green bold
# predefined usage: yellow bold
<info descr="null" type="INFORMATION" foreground="0x00ff00" background="0x000000" effectcolor="0xffffff" effecttype="BOXED" fonttype="1">len</info>("")
len = [] # redefine
len # no highlight
class <info descr="null" type="INFORMATION">A</info>(<info descr="null" type="INFORMATION" foreground="0x00ff00" background="0x000000" effectcolor="0xffffff" effecttype="BOXED" fonttype="1">object</info>):
<info descr="null" type="INFORMATION_ATTRIBUTES" foreground="0xffff00" background="0x000000" effectcolor="0xffffff" effecttype="BOXED" fonttype="1">__metaclass__</info> = M # assignment target
<info descr="null" type="INFORMATION" foreground="0x00ff00" background="0x000000" effectcolor="0xffffff" effecttype="BOXED" fonttype="1">@</info><info descr="null" type="INFORMATION">classmethod</info>
def <info descr="null" type="INFORMATION">foo</info>(cls):