##// END OF EJS Templates
apply lint
Richard Fung -
Show More
@@ -675,19 +675,23 b' class Completer(Configurable):'
675 matches = []
675 matches = []
676 match_append = matches.append
676 match_append = matches.append
677 n = len(text)
677 n = len(text)
678 for lst in [keyword.kwlist,
678 for lst in [
679 keyword.kwlist,
679 builtin_mod.__dict__.keys(),
680 builtin_mod.__dict__.keys(),
680 list(self.namespace.keys()),
681 list(self.namespace.keys()),
681 list(self.global_namespace.keys())]:
682 list(self.global_namespace.keys()),
683 ]:
682 for word in lst:
684 for word in lst:
683 if word[:n] == text and word != "__builtins__":
685 if word[:n] == text and word != "__builtins__":
684 match_append(word)
686 match_append(word)
685
687
686 snake_case_re = re.compile(r"[^_]+(_[^_]+)+?\Z")
688 snake_case_re = re.compile(r"[^_]+(_[^_]+)+?\Z")
687 for lst in [list(self.namespace.keys()),
689 for lst in [list(self.namespace.keys()), list(self.global_namespace.keys())]:
688 list(self.global_namespace.keys())]:
690 shortened = {
689 shortened = {"_".join([sub[0] for sub in word.split('_')]) : word
691 "_".join([sub[0] for sub in word.split("_")]): word
690 for word in lst if snake_case_re.match(word)}
692 for word in lst
693 if snake_case_re.match(word)
694 }
691 for word in shortened.keys():
695 for word in shortened.keys():
692 if word[:n] == text and word != "__builtins__":
696 if word[:n] == text and word != "__builtins__":
693 match_append(shortened[word])
697 match_append(shortened[word])
General Comments 0
You need to be logged in to leave comments. Login now