ostinelli / SublimErl

An Erlang Plugin for Sublime Text 2, which enables code completion and allows you to run tests within the editor itself.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AttributeError: 'NoneType' object has no attribute 'endswith'

ybogdanov opened this issue · comments

Hi, I'm getting the following error in ST console when press cmd+alt+p, autocomplete seems not work either.

Traceback (most recent call last):
  File "./sublime_plugin.py", line 362, in run_
  File "./sublimerl_core.py", line 331, in run
    if SUBLIMERL.initialized == False:
  File "./sublimerl_function_search.py", line 103, in run_command
    search.show()
  File "./sublimerl_function_search.py", line 48, in show
    self.set_search_completions()
  File "./sublimerl_function_search.py", line 58, in set_search_completions
    searches_filepath = os.path.join(SUBLIMERL.plugin_path, "completion", "Current-Project.searches")
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/posixpath.py", line 67, in join
    elif path == '' or path.endswith('/'):
AttributeError: 'NoneType' object has no attribute 'endswith'

Maybe it's because I'm doing it not within a project?

ST2 Build 2220
OSX 1.8.2
Python 2.7.2
SublimErl 0.5.1

Error when saving .erl file:

Traceback (most recent call last):
  File "./sublime_plugin.py", line 190, in on_post_save
  File "./sublime_plugin.py", line 154, in run_timed_function
  File "./sublime_plugin.py", line 189, in <lambda>
  File "./sublimerl_autocompiler.py", line 86, in on_post_save
    autocompiler = SublimErlAutocompiler(view)
  File "./sublimerl_autocompiler.py", line 40, in __init__
    SublimErlProjectLoader.__init__(self, view)
  File "./sublimerl_core.py", line 224, in __init__
    self.set_app_name()
  File "./sublimerl_core.py", line 259, in set_app_name
    src_path = os.path.join(self.test_root, 'src')
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/posixpath.py", line 67, in join
    elif path == '' or path.endswith('/'):
AttributeError: 'NoneType' object has no attribute 'endswith'

Ah, got it, it was because of incorrect directory layout.
But autocomplete still not working http://o7.no/ZCSfNQ

rebar clean compile and then a restart of sublime text fixed auto complete for me.