-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathlang_python3.py
More file actions
58 lines (42 loc) · 1.57 KB
/
lang_python3.py
File metadata and controls
58 lines (42 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env python
# Copyright (c) 2010 ActiveState Software Inc.
# See LICENSE.txt for license details.
"""Python 3 support for CodeIntel"""
from __future__ import absolute_import
import logging
from codeintel2.common import LazyClassAttribute
from codeintel2.lang_python import (PythonLexer, PythonLangIntel,
PythonImportsEvaluator, PythonBuffer,
PythonImportHandler, PythonCILEDriver)
#---- globals
lang = "Python3"
log = logging.getLogger("codeintel.python3")
#log.setLevel(logging.DEBUG)
#---- language support
class Python3Lexer(PythonLexer):
lang = lang
class Python3LangIntel(PythonLangIntel):
lang = lang
interpreterPrefName = "python3"
extraPathsPrefName = "python3ExtraPaths"
excludePathsPrefName = "python3ExcludePaths"
@LazyClassAttribute
def keywords(self):
from SilverCity.Keywords import python3_keywords
return python3_keywords.split(" ")
class Python3Buffer(PythonBuffer):
lang = lang
class Python3ImportHandler(PythonImportHandler):
lang = lang
class Python3CILEDriver(PythonCILEDriver):
lang = lang
#---- registration
def register(mgr):
"""Register language support with the Manager."""
mgr.set_lang_info(lang,
silvercity_lexer=Python3Lexer(),
buf_class=Python3Buffer,
langintel_class=Python3LangIntel,
import_handler_class=Python3ImportHandler,
cile_driver_class=Python3CILEDriver,
is_cpln_lang=True)