Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saving erl file with Sublimerl enabled causes error #76

Open
sononix opened this issue Jan 22, 2014 · 11 comments
Open

Saving erl file with Sublimerl enabled causes error #76

sononix opened this issue Jan 22, 2014 · 11 comments

Comments

@sononix
Copy link

sononix commented Jan 22, 2014

Using a Stock install of ST2 - disable Sublimerl files save - enabling Sublimerl file save and generates error

Writing file /Users/studio/CODE/Erlang/hello.erl with encoding UTF-8
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
File "./sublimerl_autocompiler.py", line 86, in on_post_save
File "./sublimerl_autocompiler.py", line 40, in init
File "./sublimerl_core.py", line 224, in init
File "./sublimerl_core.py", line 259, in set_app_name
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'

@ruanpienaar
Copy link

Also getting this issue:

plugin init time: 0.647114
loading bindings
loading pointer bindings
found 1 files for base name Spacegray.sublime-theme
Errors parsing theme:
Unknown attribute value
theme loaded
app ready
pre session restore time: 0.824381
using gpu buffer for window
using gamma: 2 (err: 6.9282)
wrote startup cache, added files: 2 orphaned files: 0 total files: 63 cache hits: 61
startup time: 0.934793 (package setup was not run)
Traceback (most recent call last):
  File "./sublime_plugin.py", line 175, in on_load
  File "./sublime_plugin.py", line 154, in run_timed_function
  File "./sublime_plugin.py", line 174, in <lambda>
  File "./sublimerl_completion.py", line 232, in on_load
  File "./sublimerl_core.py", line 224, in __init__
  File "./sublimerl_core.py", line 259, in set_app_name
  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'
Traceback (most recent call last):
  File "./sublime_plugin.py", line 175, in on_load
  File "./sublime_plugin.py", line 154, in run_timed_function
  File "./sublime_plugin.py", line 174, in <lambda>
  File "./sublimerl_completion.py", line 232, in on_load
  File "./sublimerl_core.py", line 224, in __init__
  File "./sublimerl_core.py", line 259, in set_app_name
  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'
loaded 844 snippets
no command for selector: noop:
Package Control: Skipping automatic upgrade, last run at 2014-10-23 11:31:23, next run at 2014-10-23 12:31:23 or after

@ostinelli
Copy link
Owner

@ruanpienaar can you provide me with the file you're trying to save? Are you using ST2 or ST3?

@ruanpienaar
Copy link

version: Sublime Text 2 Build 2221.
the above is from the ST2 console when ST 2 starts.

@ostinelli
Copy link
Owner

I'll still need some kind of file to reproduce this. :)

@ruanpienaar
Copy link

-module(m).

@ruanpienaar
Copy link

i think i can reproduce how i get this issue. give me a min

@ruanpienaar
Copy link

-package remove SublimErl
-package install SublimErl.
-configure SublimErl settings *( Edit SublimErl.sublime-settings, in ST2 )

pre session restore time: 0.814455
using gpu buffer for window
using gamma: 2 (err: 6.9282)
startup cache, total files: 62 cache hits: 62
startup time: 0.895213 (package setup was not run)
Traceback (most recent call last):
  File "./sublime_plugin.py", line 175, in on_load
  File "./sublime_plugin.py", line 154, in run_timed_function
  File "./sublime_plugin.py", line 174, in <lambda>
  File "./sublimerl_completion.py", line 232, in on_load
  File "./sublimerl_core.py", line 224, in __init__
  File "./sublimerl_core.py", line 259, in set_app_name
  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'
loaded 844 snippets
Package Control: Skipping automatic upgrade, last run at 2014-10-23 13:46:00, next run at 2014-10-23 14:46:00 or after

When i remove the configuration it produce the error.

SublimErl.sublime-settings:

{
    /*
     * SublimErl tries to detect automatically the paths for erl, escript, rebar and dialyzer.
     * If it doesn't succeed or you prefer to manually configure these, you can do so by inputting the paths here.
     *
     * "erl_path": "/usr/local/bin/erl",
     * "escript_path": "/usr/local/bin/escript",
     * "rebar_path": "/usr/local/bin/rebar",
     * "dialyzer_path": "/usr/local/bin/dialyzer"
     */



     // Skip Erlang libs that match the regex
    "completion_skip_erlang_libs": [
        "^[cC]os[A-Z].+",
        ".*orber.*",
        "^oe_.+",
        "^megaco_.+",
        ".*wx.*"
    ]
}

Setting file produces error:

{
    /*
     * SublimErl tries to detect automatically the paths for erl, escript, rebar and dialyzer.
     * If it doesn't succeed or you prefer to manually configure these, you can do so by inputting the paths here.
     *
     * "erl_path": "/usr/local/bin/erl",
     * "escript_path": "/usr/local/bin/escript",
     * "rebar_path": "/usr/local/bin/rebar",
     * "dialyzer_path": "/usr/local/bin/dialyzer"
     */

     "erl_path": "/erlang/bin/erl",
     "escript_path": "/erlang/bin/escript",
     "rebar_path": "/usr/local/bin/rebar",
     "dialyzer_path": "/erlang/bin/dialyzer",

     // Skip Erlang libs that match the regex
    "completion_skip_erlang_libs": [
        "^[cC]os[A-Z].+",
        ".*orber.*",
        "^oe_.+",
        "^megaco_.+",
        ".*wx.*"
    ]
}

@ruanpienaar
Copy link

No Folders added to project. Just 1 file m.erl.

@ruanpienaar
Copy link

No error when i add a Folder to Project, that has a rebar-compatible dir structure.

i guess set_app_name in sublimerl_core.py has a issue with no 'src'

@ostinelli
Copy link
Owner

Having trouble in following you. Does all of this just boil down to the necessity of having a src directory?

@ruanpienaar
Copy link

@ostinelli Yes. it seems sublimerl_core.py set_app_name , can't deal with no src

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants