Permalink
Browse files

Add enable_ghc_mod setting

  • Loading branch information...
1 parent 3843a15 commit 8f56bce0f0c8d17ed87d2bfac4ef65f4013d8413 @nh2 nh2 committed Aug 10, 2012
Showing with 12 additions and 2 deletions.
  1. +6 −0 SublimeHaskell.sublime-settings
  2. +2 −1 autocomplete.py
  3. +4 −1 sublime_haskell_common.py
View
6 SublimeHaskell.sublime-settings
@@ -1,4 +1,9 @@
{
+ // Enables ghc-mod (you should have it installed,
+ // e.g. via cabal install ghc-mod).
+ // See the add_to_PATH settings to specify a custom location.
+ "enable_ghc_mod": true,
+
// Enable auto completion of module imports
"auto_complete_imports": true,
@@ -7,5 +12,6 @@
// Extra directories to be added to the front of the PATH environment variable.
// Specify this for using custom ghc, cabal, and ghc-mod
+ // Example: /home/user/.cabal/bin
"add_to_PATH": []
}
View
3 autocomplete.py
@@ -50,7 +50,8 @@ def __init__(self):
self.language_completions = []
- self.init_ghcmod_completions()
+ if get_setting('enable_ghc_mod'):
+ self.init_ghcmod_completions()
# Gets available LANGUAGE options and import modules from ghc-mod
def init_ghcmod_completions(self):
View
5 sublime_haskell_common.py
@@ -109,4 +109,7 @@ def call_ghcmod_and_wait(arg_list):
except OSError, e:
if e.errno == errno.ENOENT:
sublime.error_message("SublimeHaskell: ghc-mod was not found!\n"
- + "Try adjusting the 'add_to_PATH' setting.")
+ + "It is used for LANGUAGE and import autocompletions "
+ + "and type inference.\n"
+ + "Try adjusting the 'add_to_PATH' setting.\n"
+ + "You can also turn this off using the 'enable_ghc_mod' setting.")

0 comments on commit 8f56bce

Please sign in to comment.