|
1 | 1 | # Copyright 2017 Palantir Technologies, Inc. |
2 | 2 | import logging |
3 | | -from pyls.lsp import CompletionItemKind |
4 | | -from pyls import hookimpl |
5 | | - |
6 | 3 | from rope.contrib.codeassist import code_assist, sorted_proposals |
7 | 4 |
|
| 5 | +from pyls import hookimpl, lsp |
| 6 | + |
| 7 | + |
8 | 8 | log = logging.getLogger(__name__) |
9 | 9 |
|
10 | 10 |
|
@@ -62,36 +62,36 @@ def _sort_text(definition): |
62 | 62 | def _kind(d): |
63 | 63 | """ Return the VSCode type """ |
64 | 64 | MAP = { |
65 | | - 'none': CompletionItemKind.Value, |
66 | | - 'type': CompletionItemKind.Class, |
67 | | - 'tuple': CompletionItemKind.Class, |
68 | | - 'dict': CompletionItemKind.Class, |
69 | | - 'dictionary': CompletionItemKind.Class, |
70 | | - 'function': CompletionItemKind.Function, |
71 | | - 'lambda': CompletionItemKind.Function, |
72 | | - 'generator': CompletionItemKind.Function, |
73 | | - 'class': CompletionItemKind.Class, |
74 | | - 'instance': CompletionItemKind.Reference, |
75 | | - 'method': CompletionItemKind.Method, |
76 | | - 'builtin': CompletionItemKind.Class, |
77 | | - 'builtinfunction': CompletionItemKind.Function, |
78 | | - 'module': CompletionItemKind.Module, |
79 | | - 'file': CompletionItemKind.File, |
80 | | - 'xrange': CompletionItemKind.Class, |
81 | | - 'slice': CompletionItemKind.Class, |
82 | | - 'traceback': CompletionItemKind.Class, |
83 | | - 'frame': CompletionItemKind.Class, |
84 | | - 'buffer': CompletionItemKind.Class, |
85 | | - 'dictproxy': CompletionItemKind.Class, |
86 | | - 'funcdef': CompletionItemKind.Function, |
87 | | - 'property': CompletionItemKind.Property, |
88 | | - 'import': CompletionItemKind.Module, |
89 | | - 'keyword': CompletionItemKind.Keyword, |
90 | | - 'constant': CompletionItemKind.Variable, |
91 | | - 'variable': CompletionItemKind.Variable, |
92 | | - 'value': CompletionItemKind.Value, |
93 | | - 'param': CompletionItemKind.Variable, |
94 | | - 'statement': CompletionItemKind.Keyword, |
| 65 | + 'none': lsp.CompletionItemKind.Value, |
| 66 | + 'type': lsp.CompletionItemKind.Class, |
| 67 | + 'tuple': lsp.CompletionItemKind.Class, |
| 68 | + 'dict': lsp.CompletionItemKind.Class, |
| 69 | + 'dictionary': lsp.CompletionItemKind.Class, |
| 70 | + 'function': lsp.CompletionItemKind.Function, |
| 71 | + 'lambda': lsp.CompletionItemKind.Function, |
| 72 | + 'generator': lsp.CompletionItemKind.Function, |
| 73 | + 'class': lsp.CompletionItemKind.Class, |
| 74 | + 'instance': lsp.CompletionItemKind.Reference, |
| 75 | + 'method': lsp.CompletionItemKind.Method, |
| 76 | + 'builtin': lsp.CompletionItemKind.Class, |
| 77 | + 'builtinfunction': lsp.CompletionItemKind.Function, |
| 78 | + 'module': lsp.CompletionItemKind.Module, |
| 79 | + 'file': lsp.CompletionItemKind.File, |
| 80 | + 'xrange': lsp.CompletionItemKind.Class, |
| 81 | + 'slice': lsp.CompletionItemKind.Class, |
| 82 | + 'traceback': lsp.CompletionItemKind.Class, |
| 83 | + 'frame': lsp.CompletionItemKind.Class, |
| 84 | + 'buffer': lsp.CompletionItemKind.Class, |
| 85 | + 'dictproxy': lsp.CompletionItemKind.Class, |
| 86 | + 'funcdef': lsp.CompletionItemKind.Function, |
| 87 | + 'property': lsp.CompletionItemKind.Property, |
| 88 | + 'import': lsp.CompletionItemKind.Module, |
| 89 | + 'keyword': lsp.CompletionItemKind.Keyword, |
| 90 | + 'constant': lsp.CompletionItemKind.Variable, |
| 91 | + 'variable': lsp.CompletionItemKind.Variable, |
| 92 | + 'value': lsp.CompletionItemKind.Value, |
| 93 | + 'param': lsp.CompletionItemKind.Variable, |
| 94 | + 'statement': lsp.CompletionItemKind.Keyword, |
95 | 95 | } |
96 | 96 |
|
97 | 97 | return MAP.get(d.type) |
0 commit comments