Search code examples
pathsublimetext2relative-pathsublimelinter

Setting relative path in SublimeLinter's sublimelinter_executable_map


Setup: Portable editions of Sublime Text 2 with its plugin Sublimelinter and node.exe.

sublimelinter_executable_map has to set in a way so that Sublimelinter uses node.exe as JavaScript engine.

Could one do this using a relative path instead of a fully qualified path?

Trying with different forms of relative paths as given in MSDN, the plugin failed to detect node.exe. The console message i got was SublimeLinter: javascript disabled (One of the following JavaScript engines must be installed: node.js, JavaScriptCore)


Solution

  • Your GitHub issue on this topic:

    Is a duplicate of these:

    This seems to be a hot topic.

    I forked the repository and started to code a patch for you, which seems to center around this segment:

    https://github.com/SublimeLinter/SublimeLinter/blob/4ef4b2ca08e0224b8af59bf3406c4927432efb94/sublimelinter/modules/base_linter.py#L380

    But then, it dawned on me... environment variables. Since this seems to be a prevalent issue with many unsolved requests, it seems that you ought to set the PATH environment variable, and place the location you are looking to be found first, earlier in that variable.

    Don't know your Windows version, and the process to set an environment variable will be different for your version, so you ought to experiment with that, and then use that method as the standard for all your environments ( as it seems implied you have more than one to maintain ).

    Update: Ruby seems to allow relative paths, but JavaScript does not, because of this section:

    https://github.com/SublimeLinter/SublimeLinter/blob/4ef4b2ca08e0224b8af59bf3406c4927432efb94/sublimelinter/modules/base_linter.py#L380

    Which hinges on: JAVASCRIPT_ENGINE_WRAPPERS_PATH

    So the answer is, unless that code is adapted, no. Relative paths cannot be used for JS.