|
10 | 10 |
|
11 | 11 | log = logging.getLogger(__name__)
|
12 | 12 |
|
13 |
| -# Map to the VSCode type |
| 13 | +# Map to the LSP type |
| 14 | +# > Valid values for type are ``module``, `` class ``, ``instance``, ``function``, |
| 15 | +# > ``param``, ``path``, ``keyword``, ``property`` and ``statement``. |
| 16 | +# see: https://jedi.readthedocs.io/en/latest/docs/api-classes.html#jedi.api.classes.BaseName.type |
14 | 17 | _TYPE_MAP = {
|
15 |
| - 'none': lsp.CompletionItemKind.Value, |
16 |
| - 'type': lsp.CompletionItemKind.Class, |
17 |
| - 'tuple': lsp.CompletionItemKind.Class, |
18 |
| - 'dict': lsp.CompletionItemKind.Class, |
19 |
| - 'dictionary': lsp.CompletionItemKind.Class, |
20 |
| - 'function': lsp.CompletionItemKind.Function, |
21 |
| - 'lambda': lsp.CompletionItemKind.Function, |
22 |
| - 'generator': lsp.CompletionItemKind.Function, |
| 18 | + 'module': lsp.CompletionItemKind.Module, |
| 19 | + 'namespace': lsp.CompletionItemKind.Module, # to be added in Jedi 0.18+ |
23 | 20 | 'class': lsp.CompletionItemKind.Class,
|
24 | 21 | 'instance': lsp.CompletionItemKind.Reference,
|
25 |
| - 'method': lsp.CompletionItemKind.Method, |
26 |
| - 'builtin': lsp.CompletionItemKind.Class, |
27 |
| - 'builtinfunction': lsp.CompletionItemKind.Function, |
28 |
| - 'module': lsp.CompletionItemKind.Module, |
29 |
| - 'file': lsp.CompletionItemKind.File, |
30 |
| - 'path': lsp.CompletionItemKind.Text, |
31 |
| - 'xrange': lsp.CompletionItemKind.Class, |
32 |
| - 'slice': lsp.CompletionItemKind.Class, |
33 |
| - 'traceback': lsp.CompletionItemKind.Class, |
34 |
| - 'frame': lsp.CompletionItemKind.Class, |
35 |
| - 'buffer': lsp.CompletionItemKind.Class, |
36 |
| - 'dictproxy': lsp.CompletionItemKind.Class, |
37 |
| - 'funcdef': lsp.CompletionItemKind.Function, |
38 |
| - 'property': lsp.CompletionItemKind.Property, |
39 |
| - 'import': lsp.CompletionItemKind.Module, |
40 |
| - 'keyword': lsp.CompletionItemKind.Keyword, |
41 |
| - 'constant': lsp.CompletionItemKind.Variable, |
42 |
| - 'variable': lsp.CompletionItemKind.Variable, |
43 |
| - 'value': lsp.CompletionItemKind.Value, |
| 22 | + 'function': lsp.CompletionItemKind.Function, |
44 | 23 | 'param': lsp.CompletionItemKind.Variable,
|
45 |
| - 'statement': lsp.CompletionItemKind.Keyword, |
| 24 | + 'path': lsp.CompletionItemKind.File, |
| 25 | + 'keyword': lsp.CompletionItemKind.Keyword, |
| 26 | + 'property': lsp.CompletionItemKind.Property, # added in Jedi 0.18 |
| 27 | + 'statement': lsp.CompletionItemKind.Variable |
46 | 28 | }
|
47 | 29 |
|
48 | 30 | # Types of parso nodes for which snippet is not included in the completion
|
|
0 commit comments