Itās working for me interactively. Are you getting any console errors?
SublimeLint (Realtime lint highlighting)
Nope, nothing. And I was debugging it last night (putting a bunch of 'printās everywhere) and the same things seemed to be called in the code. Very odd.
By the way thereās a small and inconsequential bug in sublimelint. When thereās nothing selected a bunch of errors go on the console. Basically the line which causes the error is in on_selection_modified where it assumes thereās at least one selection.
A simple git diff for a fix is:
diff --git a/sublimelint_plugin.py b/sublimelint_plugin.py
index e7e3293..c56fd04 100755
--- a/sublimelint_plugin.py
+++ b/sublimelint_plugin.py
@@ -181,8 +181,9 @@ class pyflakes(sublime_plugin.EventListener):
def on_selection_modified(self, view):
vid = view.id()
- lineno = view.rowcol(view.sel()[0].end())[0]
- if vid in lineMessages and lineno in lineMessages[vid]:
- view.set_status('pyflakes', '; '.join(lineMessages[vid][lineno]))
- else:
- view.erase_status('pyflakes')
+ if len(view.sel()):
+ lineno = view.rowcol(view.sel()[0].end())[0]
+ if vid in lineMessages and lineno in lineMessages[vid]:
+ view.set_status('pyflakes', '; '.join(lineMessages[vid][lineno]))
+ else:
+ view.erase_status('pyflakes')
As can be seen, all Iāve done is checked that there is at least one selection (using āif len(view.sel())ā) before executing the code on it. There may be other work that needs doing for this, (maybe adding an āelse:ā that does the āview.erase_status(āpyflakesā)ā bit, I didnāt want to get that far into it).
If you want a pull request let me know, but Iām not exactly all up on github and whatnot so I figured Iād just present the patch here in code and words.
even a single cursor selection counts as a selection with the same start/end point
Iām having a problem where SublimeLint tries to parse HAML files as ruby, throwing errors in the process. Any ideas?
I cant seem to get this working for javascript
im on windows, and added nodejs to my path (node -v returns the current version)
When i try node it returns errors (ie javascript file contains errors), and on a correct file it returns nothing, but i dont see the borders appear where the errors actually are
Also is anyone interested or wiling to write a jquery linting plugin - that would be very very helpful with all the brackets in jquery
Any help is much appreciated
Thank you for this wonderful plugin!
Iām pretty sure Open Komodo has a Javascript linter written in pythonā¦ I donāt know how good that might be, but itās there. The main problem with it is ā¦the license
While I donāt know how difficult it would be (or even possible), I would love to have lint highlighting for Java.
Just a requestā¦
[quote=ākorgothā]I cant seem to get this working for javascript
im on windows, and added nodejs to my path (node -v returns the current version)
When i try node it returns errors (ie javascript file contains errors), and on a correct file it returns nothing, but i dont see the borders appear where the errors actually are[/quote]
Are you using sublimelint or SublimeLinter?
Someone will have to write a wrapper for a checker such as checkstyle (checkstyle.sourceforge.net/).
[quote=āaparajitaā]
[quote=ākorgothā]I cant seem to get this working for javascript
im on windows, and added nodejs to my path (node -v returns the current version)
When i try node it returns errors (ie javascript file contains errors), and on a correct file it returns nothing, but i dont see the borders appear where the errors actually are[/quote]
Are you using sublimelint or SublimeLinter?[/quote]
SublimeLinter that is
Close all windows, then quit and restart ST2. Open the console, and near the top you will see the loading messages for SublimeLinter. If there is an error loading the Javascript module, the reason will be printed there.
I have added support for Java linting, using ājavac -Xlintā, in this pull request:
Awesome, swdunlop. Works great. Now if only it were in Kronuzās linterā¦ so I could lint only on save
Is this plugin still developed? I just see two outstanding pull requests on github, which I think are pretty useful (particularly, the JSlint integration). Just wondering whether it is worthwhile to wait for the master fork to pull these requests or whether I should rather change to a different forkā¦
Thanks!
[quote=āgregor.hochā]Is this plugin still developed? I just see two outstanding pull requests on github, which I think are pretty useful (particularly, the JSlint integration). Just wondering whether it is worthwhile to wait for the master fork to pull these requests or whether I should rather change to a different forkā¦
Thanks![/quote]
There is active work being done on Kronuzās fork, which has become the more popular choice for all your linting needs: https://github.com/Kronuz/SublimeLinter
I pretty much rewrote SublimeLint. The code is now far cleaner, plugins are incredibly simple, and it should never lag the user interface.
Might be worth checking out again for the developers of other versions, and for anyone who switched to a fork.
Iāve put the ālintā folder and sublimelint.py into the User Packages folder, but it does nothing.
ĀæIs it necessary to enable the plugin or something similar?
For example, if I create a file with this content:
[code]<?php
abcde
echo $var;
?>[/code]
shouldnāt it mark the first line as wrong?
The problem is that the syntax is HTML instead of PHP. No matter what the status bar says, is HTML.
Change the syntax to PHP and reopen the file. This should solve the issue.
Yuo can check the current syntax with
sublime.active_window().active_view().settings().get('syntax')