SublimeCodeIntel / SublimeCodeIntel

💡 Full-featured code intelligence and smart autocomplete for Sublime Text
https://www.sublimecodeintel.com
Other
5.06k stars 526 forks source link

PHP not working with ST3 on Ubuntu 13.10 #349

Open rayman22201 opened 10 years ago

rayman22201 commented 10 years ago

langinfo.py consistently throws:

The error occurs with both the autocomplete popup and any go-to function definition. The function or file does not make a difference.

System info:

Any help is much appreciated. :-)

The CodeIntel.log reads as follows:

Unexpected error with evaluator: 'entity_metadata_wrapper' at shows_seat_selector.module#34
Traceback (most recent call last):
  File "/home/ray/.config/sublime-text-3/Packages/SublimeCodeIntel/libs/codeintel2/tree.py", line 331, in eval
    defns = self.eval_defns()
  File "/home/ray/.config/sublime-text-3/Packages/SublimeCodeIntel/libs/codeintel2/tree_php.py", line 353, in eval_defns
    hit = self._hit_from_citdl(self.expr, start_scoperef, defn_only=True)
  File "/home/ray/.config/sublime-text-3/Packages/SublimeCodeIntel/libs/codeintel2/tree_php.py", line 842, in _hit_from_citdl
    hits, nconsumed = self._hits_from_first_part(tokens, scoperef)
  File "/home/ray/.config/sublime-text-3/Packages/SublimeCodeIntel/libs/codeintel2/tree_php.py", line 1195, in _hits_from_first_part
    hit, nconsumed = self._hit_from_elem_imports(tokens, elem)
  File "/home/ray/.config/sublime-text-3/Packages/SublimeCodeIntel/libs/codeintel2/tree_php.py", line 1272, in _hit_from_elem_imports
    curr_buf=self.buf)
  File "/home/ray/.config/sublime-text-3/Packages/SublimeCodeIntel/libs/codeintel2/database/multilanglib.py", line 161, in hits_from_lpath
    self.ensure_all_dirs_scanned(ctlr=ctlr)
  File "/home/ray/.config/sublime-text-3/Packages/SublimeCodeIntel/libs/codeintel2/database/langlibbase.py", line 69, in ensure_all_dirs_scanned
    dir, ctlr=ctlr, reporter=lambda msg: None)
  File "/home/ray/.config/sublime-text-3/Packages/SublimeCodeIntel/libs/codeintel2/database/langlibbase.py", line 104, in ensure_dir_scanned
    lang=self.lang)
  File "/home/ray/.config/sublime-text-3/Packages/SublimeCodeIntel/libs/codeintel2/manager.py", line 462, in buf_from_path
    follow_symlinks=True)
  File "/home/ray/.config/sublime-text-3/Packages/SublimeCodeIntel/libs/textinfo.py", line 191, in textinfo_from_path
    quick_determine_lang=quick_determine_lang)
  File "/home/ray/.config/sublime-text-3/Packages/SublimeCodeIntel/libs/textinfo.py", line 267, in init_from_path
    self._classify_from_magic(lidb)
  File "/home/ray/.config/sublime-text-3/Packages/SublimeCodeIntel/libs/textinfo.py", line 440, in _classify_from_magic
    li = lidb.langinfo_from_magic(head_bytes)
  File "/home/ray/.config/sublime-text-3/Packages/SublimeCodeIntel/libs/langinfo.py", line 385, in langinfo_from_magic
    if pattern.search(head_bytes, start):
TypeError: can't use a string pattern on a bytes-like object
done eval: eval error
Done 'PHP' CodeIntel! Full CodeIntel took 56ms
daften commented 10 years ago

I've got the same error, also Drupal 7 codebase

rayman22201 commented 10 years ago

Considering the last commit to this repo was 4 months ago, It may be a while before the devs ever get back to us on this issue. :-1:

daften commented 10 years ago

Jup, saw that too. Too bad, I' be willing to pay (a small amount of) money, if this would work properly :)

BrianGilbert commented 10 years ago

Also getting seeing this issue with ST3 on OS X

mikerogne commented 10 years ago

So just wondering.... did you guys try manually downloading the development branch & loading the plugin that way? It solved a few issues for me... including a similar "wrong type" error.

rayman22201 commented 10 years ago

Tried downloading the dev branch, and unfortunately it did not work for me.

daften commented 10 years ago

It works for me, but I installed the plugin only after installing phpcs, that seemed to do it.

johngrogg commented 9 years ago

Having the same issue on OS X when I try to code complete $this.

spectacles commented 9 years ago

@johngrogg I "fixed" this error in CodeComplice by catching the TypeError. Can be installed per packageControl! What ST version are you on?

johngrogg commented 9 years ago

@spectacles ST3. Tried out CodeComplice and it worked great, thanks!