@@ -743,9 +743,9 @@ def trg_from_pos(self, pos, implicit=True):
743743
744744 # Quick out if the preceding char isn't a trigger char.
745745 # Note: Cannot use this now that we have a 2-char locals trigger.
746- #if last_char not in " .(@_":
746+ #if last_char not in " .(@_, ":
747747 # if DEBUG:
748- # print "trg_from_pos: no: %r is not in ' .(@'_" % last_char
748+ # print "trg_from_pos: no: %r is not in ' .(@'_, " % last_char
749749 # return None
750750
751751 style = accessor .style_at_pos (last_pos )
@@ -804,7 +804,7 @@ def trg_from_pos(self, pos, implicit=True):
804804
805805 # Typing a space is very common so lets have a quick out before
806806 # doing the more correct processing:
807- if last_pos - 1 < 0 or accessor .char_at_pos (last_pos - 1 ) not in "tm ," :
807+ if last_pos - 1 < 0 or accessor .char_at_pos (last_pos - 1 ) not in "tme ," :
808808 return None
809809
810810 working_text = accessor .text_range (max (0 ,last_pos - 200 ),
@@ -833,6 +833,10 @@ def trg_from_pos(self, pos, implicit=True):
833833 return Trigger (self .lang , TRG_FORM_CPLN ,
834834 "available-exceptions" , pos , implicit )
835835
836+ if line == "raise" or line .endswith (" raise" ):
837+ return Trigger (self .lang , TRG_FORM_CPLN ,
838+ "available-exceptions" , pos , implicit )
839+
836840 if ch == ',' :
837841 # is it "from FOO import BAR, <|>" ?
838842 if line .startswith ('from ' ) and ' import ' in line :
@@ -1021,6 +1025,17 @@ def trg_from_pos(self, pos, implicit=True):
10211025 if DEBUG : print ("trg_from_pos: no: no chars preceding '('" )
10221026 return None
10231027
1028+ elif last_char == ',' :
1029+ working_text = accessor .text_range (max (0 , last_pos - 200 ), last_pos )
1030+ line = self ._last_logical_line (working_text ).rstrip ()
1031+ if line :
1032+ last_bracket = line .rfind ("(" )
1033+ pos = (pos - (len (line ) - last_bracket ))
1034+ return Trigger (self .lang , TRG_FORM_CALLTIP ,
1035+ "call-signature" , pos , implicit )
1036+ else :
1037+ return None
1038+
10241039 elif pos >= 2 and style in (self .identifier_style , self .keyword_style ):
10251040 # 2 character trigger for local symbols
10261041 if DEBUG :
@@ -1047,7 +1062,7 @@ def trg_from_pos(self, pos, implicit=True):
10471062 preceeding_text = accessor .text_range (start , last_pos - 2 ).strip ()
10481063 if preceeding_text :
10491064 first_word = preceeding_text .split (" " )[0 ]
1050- if first_word in ("class" , "def" , "import" , "from" , "except" ):
1065+ if first_word in ("class" , "def" , "import" , "from" , "except" , "raise" ):
10511066 if DEBUG :
10521067 print (" no trigger, as starts with %r" % (first_word , ))
10531068 # Don't trigger over the top of another trigger, i.e.
0 commit comments