Skip to content

Commit

Permalink
Don't let PSR4 CodeIntelError kill a lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
ssigwart authored Aug 23, 2019
1 parent e541400 commit bed4d63
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/codeintel/lib/codeintel2/tree_php.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,10 @@ def _classes_from_scope(self, expr, scoperef, allowGlobalClasses=False):
and child.get("symbol"):
module = "\\%s\\%s" % (child.get("module"), child.get("symbol"))
self.attemptingPSR4Autoloading = True
try:
elem, scope = self._hit_from_citdl(module, scoperef)
except CodeIntelError:
elem = None
self.attemptingPSR4Autoloading = False
if elem and scope:
for subelem in elem:
Expand Down Expand Up @@ -1268,8 +1271,12 @@ def _hits_from_first_part(self, tokens, scoperef):
if expr not in attempted_psr4_exprs:
attempted_psr4_exprs[expr] = True
self.attemptingPSR4Autoloading = True
try:
hit = self._hit_from_citdl(expr, scoperef)
except CodeIntelError:
hit = None
self.attemptingPSR4Autoloading = False
if hit:
found_elem, scope = hit
if found_elem and scope and \
found_elem.get("ilk") == "class":
Expand Down

0 comments on commit bed4d63

Please sign in to comment.