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 [ |
|
|
678 | for lst in [ | |
|
679 | keyword.kwlist, | |
|
679 | 680 |
|
|
680 | 681 |
|
|
681 |
|
|
|
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 |
|
|
|
690 |
|
|
|
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