Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Changed hdevtools init one more time

  • Loading branch information...
commit 74c3b482215d2ad4617530aa68443534472b10af 1 parent f3556b6
@mvoidex mvoidex authored
Showing with 12 additions and 13 deletions.
  1. +9 −7 autocomplete.py
  2. +3 −6 hdevtools.py
View
16 autocomplete.py
@@ -13,7 +13,7 @@
from ghci import ghci_info, ghci_package_db
from haskell_docs import haskell_docs
from ghcmod import ghcmod_browse_module, ghcmod_info
- from hdevtools import hdevtools_info, start_hdevtools
+ from hdevtools import hdevtools_info, start_hdevtools, stop_hdevtools
else:
from SublimeHaskell.sublime_haskell_common import *
import SublimeHaskell.symbols as symbols
@@ -21,7 +21,7 @@
from SublimeHaskell.ghci import ghci_info, ghci_package_db
from SublimeHaskell.haskell_docs import haskell_docs
from SublimeHaskell.ghcmod import ghcmod_browse_module, ghcmod_info
- from SublimeHaskell.hdevtools import hdevtools_info, start_hdevtools
+ from SublimeHaskell.hdevtools import hdevtools_info, start_hdevtools, stop_hdevtools
# If true, files that have not changed will not be re-inspected.
@@ -852,11 +852,6 @@ def __init__(self):
MODULEMSG = 'Compiling Haskell ModuleInspector'
def run(self):
- # FIXME: We can't call this in hdevtools because it will be called there twice: module is fully initialized twice
- # This workaround works well, but how may we call plugin_unloaded in Sublime Text 2?
- if int(sublime.version()) < 3000:
- start_hdevtools()
-
# Compile the CabalInspector:
# TODO: Where to compile it?
with status_message(InspectorAgent.CABALMSG) as s:
@@ -1240,5 +1235,12 @@ def plugin_loaded():
inspector = InspectorAgent()
inspector.start()
+ # TODO: How to stop_hdevtools() in Sublime Text 2?
+ start_hdevtools()
+
+def plugin_unloaded():
+ # Does this work properly on exit?
+ stop_hdevtools()
+
if int(sublime.version()) < 3000:
plugin_loaded()
View
9 hdevtools.py
@@ -112,13 +112,10 @@ def hdevtools_type(filename, line, column, cabal = None):
"""
return call_hdevtools_and_wait(['type', filename, str(line), str(column)], filename = filename, cabal = cabal)
-def plugin_loaded():
+def start_hdevtools():
thread = threading.Thread(
target=start_server)
thread.start()
-def plugin_unloaded():
- admin(["--stop-server"])
-
-def start_hdevtools():
- plugin_loaded()
+def stop_hdevtools():
+ admin(["--stop-server"])
Please sign in to comment.
Something went wrong with that request. Please try again.