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