I added a new āload-saveā mode, see the README.
SublimeLinter
[quote=ādlpriceā]Very odd. I put:
"sublimelinter_executable_map":
{
"php": "C:/xampp/php/php"
}
into every occurrence of Base File.sublime-settings I could find (default, user, and the one in sublimelinter). Figured this would help me determine which Base File it was expecting to find it in. I put a āprint mapā statement in the module_utils.py to see what was happening and to make sure it wasnāt just me putting in an invalid path, and, unfortunately, it consistently shows āNoneā.
My original thought was it was something screwy about using āBase Fileā in the sublimelinter folder, since changing the name of the file from āBase File.sublime-settingsā to āSublimeLinter.sublime-settingsā, and then adjusting the module_utils.py file to reflect the same resolved the issue. But with you being able to get work makes things just that much more confusing. Thanks for checking.[/quote]
Iāve tested this on windows and it does require some workaround. I finally got it working by editing both āPackages\SublimeLinter\Base File.sublime-settingsā and āPackages\User\Base File.sublime-settingsāā¦
With Packages\SublimeLinter\Base File.sublime-settings you must edit the portion where it says āsublimelinter_executable_mapā by adding the necessary path. In my case where I have my php executable using XAMPP installation on D:/DEVIGN/xampp/php/php.exe I used:
"sublimelinter_executable_map":
{
"php": "d:/devign/xampp/php/php"
},
With Packages\User\Base File.sublime-settings you must insert the whole script (as seen above). On my case where I inserted it after my colors scheme setting it looks like this:
{
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
"sublimelinter_executable_map":
{
"php": "d:/devign/xampp/php/php"
}
}
note: to avoid errors add a comma after the previous setting line before adding the script, and then make sure there is no comma between the last inserted setting script and the closing curly brace.
Iāve tested this on windows and it does require some workaround. I finally got it working by editing both āPackages\SublimeLinter\Base File.sublime-settingsā and āPackages\User\Base File.sublime-settingsāā¦
I can guarantee if you provide the correct path and donāt have any missing/extra commas in Packages\User\Base File.sublime-settings it will work correctly without modifying the default.
Hello
I cant get my SublimeLinter plugin to work This is what i get in my console when i save javascript file. Iāve installed node.js. Iām using Windows 7
Writing file /C/Users/Sosnowsd/AppData/Roaming/Sublime Text 2/Packages/SublimeLinter/Base File.sublime-settings with encoding UTF-8
reloading /C/Users/Sosnowsd/AppData/Roaming/Sublime Text 2/Packages/SublimeLinter/Base File.sublime-settings
Unable to open /C/Users/Sosnowsd/AppData/Roaming/Sublime Text 2/Packages/User/JSON.sublime-settings
Writing file /C/Users/Sosnowsd/AppData/Roaming/Sublime Text 2/Packages/SublimeLinter/Base File.sublime-settings with encoding UTF-8
reloading /C/Users/Sosnowsd/AppData/Roaming/Sublime Text 2/Packages/SublimeLinter/Base File.sublime-settings
Traceback (most recent call last):
File ".\SublimeLinter.py", line 259, in _callback
File ".\SublimeLinter.py", line 242, in _update_view
File ".\SublimeLinter.py", line 72, in background_run
File ".\SublimeLinter.py", line 87, in run_once
File ".\sublimelinter\modules\base_linter.py", line 270, in run
File ".\sublimelinter\modules\javascript.py", line 53, in parse_errors
File ".\json\__init__.py", line 307, in loads
File ".\json\decoder.py", line 319, in decode
File ".\json\decoder.py", line 338, in raw_decode
ValueError: No JSON object could be decoded
Writing file /C/Users/Sosnowsd/Work/patient-registry/lib/admin/client/tpl/doctor.tpl.js with encoding UTF-8
Traceback (most recent call last):
File ".\sublime_plugin.py", line 139, in on_post_save
File ".\SublimeLinter.py", line 520, in on_post_save
File ".\SublimeLinter.py", line 72, in background_run
File ".\SublimeLinter.py", line 87, in run_once
File ".\sublimelinter\modules\base_linter.py", line 270, in run
File ".\sublimelinter\modules\javascript.py", line 53, in parse_errors
File ".\json\__init__.py", line 307, in loads
File ".\json\decoder.py", line 319, in decode
File ".\json\decoder.py", line 338, in raw_decode
ValueError: No JSON object could be decoded
What is more strange, is that on the other machine, itās working I have no other plugins installed.
Yes, of course. And it is added to PATH. Editor configuration is default, not changed
I love the idea of a built in linter in Sublime but have run into a bit of a problem.
Iāve been sniffing around in the source code and googled for a half day but canāt find anything anywhere, which makes me think that it might be impossible today. Could also be my google-fu that is weak so close to the holiday.
Is there a way to configure a project so SublimeLinter understands that some javascript variables are global and should not be errors in such a way that is implied on JSHint.com,
var result = JSHINT(source, options, globals);
/*global DISQUS:true, jQuery:false */
Is there a setting which takes care of this? Example below.
example.sublime-project
{
"settings":
{
"SublimeLinter":
{
"jshint_options":
{
// enforcing
"eqeqeq": true,
"immed": true,
"trailing": true,
"strict": true,
// relaxing
"evil": true,
"es5": true,
"regexdash": true,
"sub": true,
// environment
"browser": true,
"devel": true,
"wsh": false
},
// global
"jshint_global":
{
"sp": true,
"exports": true
}
}
}
}
Cheers,
gabbon
Currently there is no facility to specify globals via the settings. If wouldnāt be hard to implement, add a ticket to the issue tracker on github. You can put the declaration directly in your source code at the top:
/*global DISQUS:true, jQuery:false */
One of the options, āpredefā, can be an array of names, which will be used to declare global variables, or an object whose keys are used as global names, with a boolean value that determines if they are assignable.
The trick is that you need to provide the path of your php install to both the sublimelinter_executable_map and the sublimelinter_syntax_map (notice one is executable and the other is syntax). So in my case Iāve got it installed in my xammp directory on a windoz 7 64 box. So leave the default settings folder alone and add the following to your preferences > file settings > user
"sublimelinter_executable_map":
{
"php": "c:/xampp/php/php"
},
"sublimelinter_syntax_map":
{
"php": "c:/xampp/php/php"
}
Put a comma in before the last entry and make sure the whole thing is in curly braces. You need both of these rules for it to work.
[quote=āaparajitaā]>Iāve tested this on windows and it does require some workaround. I finally got it working by editing both āPackages\SublimeLinter\Base File.sublime-settingsā and āPackages\User\Base File.sublime-settingsāā¦
I can guarantee if you provide the correct path and donāt have any missing/extra commas in Packages\User\Base File.sublime-settings it will work correctly without modifying the default.[/quote]
sublimelinter_syntax_map has nothing to do with the executable. It is mapping to a .tmLanguage file, which is not in the php binary distribution, but in the ST2 Packages directory. So I canāt see how that has anything to do with it working or now working, especially since you are providing a path to your php install.
ctrl+alt+e and ctrl+alt+shift+e seem to be broken, Iāve tried adding the bindings to my user settings and still it doesnāt work.
Please folks, always give your full configuration information (platform, versions, etc) and sample files when reporting something.
Windows 7
Dev build 2156
Package List
-
Bracket Highlighter
-
Djaneiro
-
HMTL5
-
Jinja2
-
jQuery Snippets Pack
-
nginx
-
Nodejs
-
Package Control
-
Placeholders
-
Prefixr
-
SideBarEnhancements
-
Sublime Tweet
-
SublimeCodeIntel
-
SublimeLinter
-
SublimePaster
-
SublimeWebColors
-
Tag
-
Theme - Soda
-
Wordpress
-
Zen Coding
Aside from that itās stock with the exception of opening/closing the sidebar being bound to ctrl+5, I havenāt changed any settings across any of these plugins or the preinstalled ones.
[quote=āwilly1234x1ā]
Package List
-
Bracket Highlighter
-
Djaneiro
-
HMTL5
-
Jinja2
-
jQuery Snippets Pack
-
nginx
-
Nodejs
-
Package Control
-
Placeholders
-
Prefixr
-
SideBarEnhancements
-
Sublime Tweet
-
SublimeCodeIntel
-
SublimeLinter
-
SublimePaster
-
SublimeWebColors
-
Tag
-
Theme - Soda
-
Wordpress
-
Zen Coding
Aside from that itās stock[/quote]
Yes, aside from that page long list of plugins, itās stock.
Anyway, I am seeing major weirdness with SublimeLinter on Windows in the latest build of ST2. I am not seeing the same symptoms on other platforms, so it seems to be a Windows-only issue. Iāll look into it some more.
You still didnāt give me any sample files. There are 8 different linters, it would help if I knew under what circumstances next/previous error is not working.