Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removed 'ghc-mod info' on module parsing, using it only in symbol inf…

…o command
  • Loading branch information...
commit 99fbd4435dd81e0f2ce629dedcad94e4b144825d 1 parent ae9771c
@mvoidex mvoidex authored
Showing with 7 additions and 8 deletions.
  1. +7 −8 autocomplete.py
View
15 autocomplete.py
@@ -452,6 +452,12 @@ def show_symbol_info(self, decl):
decl = decl_detailed
else:
decl.docs = decl_docs
+ # Symbol from sources, concrete type if it's not specified
+ else:
+ if decl.what == 'function' and not decl.type:
+ info = ghcmod_info(decl.location.filename, decl.module.name, decl.name)
+ if info:
+ decl.type = info.type
# TODO: Move to separate command for Sublime Text 3
edit = output_view.begin_edit()
@@ -869,14 +875,7 @@ def make_import(import_info):
for d in new_info['declarations']:
location = symbols.Location(filename, d['line'], d['column'])
if d['what'] == 'function':
- function_type = d['type']
- if not function_type:
- # No type signature, try get type with ghcmod_info
- info = ghcmod_info(filename, new_module.name, d['name'])
- if info:
- function_type = info.type
-
- new_module.add_declaration(symbols.Function(d['name'], function_type, d['docs'], location))
+ new_module.add_declaration(symbols.Function(d['name'], d['type'], d['docs'], location))
elif d['what'] == 'type':
new_module.add_declaration(symbols.Type(d['name'], d['context'], d['args'], d['docs'], location))
elif d['what'] == 'newtype':
Please sign in to comment.
Something went wrong with that request. Please try again.