Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Initial commit - the plugin runs when a buffer is saved, but does not…

…hing.
  • Loading branch information...
commit 1256e85c4fce1f65c24012dc716fb4a1d93d791c 0 parents
@holmak holmak authored
Showing with 21 additions and 0 deletions.
  1. +2 −0  .hgignore
  2. +5 −0 TODO.txt
  3. +14 −0 haskell_error_checker.py
2  .hgignore
@@ -0,0 +1,2 @@
+syntax: glob
+*.pyc
5 TODO.txt
@@ -0,0 +1,5 @@
+TODO
+====
+
+* Only run the plugin when the file is a Haskell source file.
+* Only run the plugin when the file being edited has a .cabal file in a parent directory.
14 haskell_error_checker.py
@@ -0,0 +1,14 @@
+import sublime, sublime_plugin
+
+class HaskellErrorChecker(sublime_plugin.EventListener):
+ def on_post_save(self, view):
+ print 'error checker online!'
+ self.write_output(view, 'Your program has lots of errors!')
+
+ def write_output(self, view, text):
+ PANEL_NAME = 'haskell_error_checker'
+ output_view = view.window().get_output_panel(PANEL_NAME)
+ edit = output_view.begin_edit()
+ output_view.insert(edit, 0, 'You have errors in your program!')
+ output_view.end_edit(edit)
+ view.window().run_command('show_panel', {'panel': 'output.' + PANEL_NAME})
Please sign in to comment.
Something went wrong with that request. Please try again.