SublimErl icon indicating copy to clipboard operation
SublimErl copied to clipboard

Saving erl file with Sublimerl enabled causes error

Open sononix opened this issue 11 years ago • 11 comments

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'

sononix avatar Jan 22 '14 03:01 sononix

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

ruanpienaar avatar Oct 23 '14 11:10 ruanpienaar

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

ostinelli avatar Oct 23 '14 11:10 ostinelli

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

ruanpienaar avatar Oct 23 '14 12:10 ruanpienaar

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

ostinelli avatar Oct 23 '14 12:10 ostinelli

-module(m).

ruanpienaar avatar Oct 23 '14 13:10 ruanpienaar

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

ruanpienaar avatar Oct 23 '14 13:10 ruanpienaar

-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 avatar Oct 23 '14 13:10 ruanpienaar

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

ruanpienaar avatar Oct 23 '14 13:10 ruanpienaar

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'

ruanpienaar avatar Oct 23 '14 13:10 ruanpienaar

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

ostinelli avatar Oct 23 '14 14:10 ostinelli

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

ruanpienaar avatar Oct 23 '14 14:10 ruanpienaar