Skip to content

Commit 21a9a4e

Browse files
committed
Version bump to v2.0.0-beta.33
+ ECMAScript: Fix imports + ECMAScript: constructor() is non-static
1 parent af4b176 commit 21a9a4e

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

codeintel/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '2.0.0-beta.32'
1+
__version__ = '2.0.0-beta.33'

codeintel/codeintel2/ecmacile.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1155,7 +1155,6 @@ def _visitFunction(self, node, extra_attributes=[]):
11551155
# attributes.append("protected")
11561156
if name == "constructor" and parentIsClass:
11571157
attributes.append("__ctor__")
1158-
attributes.append("__staticmethod__")
11591158

11601159
# process decorators
11611160
if node.static:

codeintel/codeintel2/lang_ecma.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1198,6 +1198,8 @@ def _find_importable(self, imp_dir, name, boost, find_package=True):
11981198
else:
11991199
while main.startswith('./'):
12001200
main = main[2:]
1201+
main_dir = os.path.dirname(main)
1202+
main_base = os.path.join(main_dir, os.path.basename(main).partition('.')[0])
12011203
for subpath in self.subpaths:
12021204
_name = os.path.join(name, self.subpaths_re.sub(r'\1%s\2' % subpath, main))
12031205
if os.path.exists(os.path.join(imp_dir, dirname(_name))):
@@ -1207,6 +1209,22 @@ def _find_importable(self, imp_dir, name, boost, find_package=True):
12071209
module = (module[0], name, module[2])
12081210
return module
12091211

1212+
_name = os.path.join(name, self.subpaths_re.sub(r'\1%s\2' % subpath, main_base))
1213+
if os.path.exists(os.path.join(imp_dir, dirname(_name))):
1214+
module = self._find_importable(imp_dir, _name, boost // 2, find_package=False)
1215+
if module:
1216+
# Remove subpath from module name
1217+
module = (module[0], name, module[2])
1218+
return module
1219+
1220+
_name = os.path.join(name, self.subpaths_re.sub(r'\1%s\2' % subpath, main_dir))
1221+
if os.path.exists(os.path.join(imp_dir, dirname(_name))):
1222+
module = self._find_importable(imp_dir, _name, boost // 2, find_package=False)
1223+
if module:
1224+
# Remove subpath from module name
1225+
module = (module[0], name, module[2])
1226+
return module
1227+
12101228
if not suffix:
12111229
for _suffix in suffixes:
12121230
_name = dirname(name)
@@ -1221,7 +1239,8 @@ def _find_importable(self, imp_dir, name, boost, find_package=True):
12211239
return (suffixes_dict[_suffix] + boost, name, (init, 'index', False))
12221240

12231241
if suffix in suffixes:
1224-
return (suffixes_dict[suffix] + boost, mod, (name, basename(mod), False))
1242+
if os.path.exists(os.path.join(imp_dir, name)):
1243+
return (suffixes_dict[suffix] + boost, mod, (name, basename(mod), False))
12251244

12261245
def find_importables_in_dir(self, imp_dir):
12271246
"""See citadel.py::ImportHandler.find_importables_in_dir() for

0 commit comments

Comments
 (0)