Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use hdevtools for error checking #47

Closed
nh2 opened this issue Mar 29, 2013 · 9 comments
Closed

Use hdevtools for error checking #47

nh2 opened this issue Mar 29, 2013 · 9 comments

Comments

@nh2
Copy link
Member

nh2 commented Mar 29, 2013

We don't actually use hdevtools's speed with hdevtools check yet, do we?

@nh2
Copy link
Member Author

nh2 commented Mar 29, 2013

In the meantime, I use this Build system:

{
  "cmd": ["/home/niklas/.cabal/bin/hdevtools", "check", "-g", "-Wall", "$file"],
  "file_regex": "^(.*?):(\\d+):(\\d+):", // Don't end with $ to also parse Warnings
  "selector": "source.haskell"
}

Update: Made it parse warnings
Update: Made it recognize the column number

You can jump through the errors with Sublime's inbuilt F4 / Shift+F4 keyboard shortcuts.

@mvoidex
Copy link
Member

mvoidex commented Mar 29, 2013

There are hdevtools.py module with call_hdevtools_and_wait same as call_ghcmod_and_wait
It can be easily used to check file.
But seems that hdevtools check shows only errors, does it?

@nh2
Copy link
Member Author

nh2 commented Apr 4, 2013

If you pass -g -Wall you will get warnings.

However, we have to watch out that like in ghci, the warnings will only be shown once (at the first successful compile), and then only as soon as you change something in the file (doing that and re-checking is super fast in hdevtools though).

@nh2
Copy link
Member Author

nh2 commented Apr 4, 2013

Also relevant: bitc/hdevtools#18 (Using multiple files with same htdevtools instance)

@mvoidex
Copy link
Member

mvoidex commented Apr 4, 2013

What kind of cache do you mean there? hdevtools doesn't make any special caches, the only benefit is that it doesn't initialize&configure ghc every time.

@nh2
Copy link
Member Author

nh2 commented Apr 5, 2013

I just mean the information that is loaded into memory - probably the same as would be loaded in a ghci session:

:l Module1 -- takes long to load
:l Module2 -- takes long
:l Module1 -- takes long again

It would be nice if you could load both modules at the same time, getting the speed benefit hdevtools gives you across multiple modules.

@mvoidex
Copy link
Member

mvoidex commented Apr 5, 2013

GHC.setTarget allows to specify several modules, but I don't know If

setTarget ["Module1"]
...
setTarget ["Module1", "Module2"]

will reload "Module1" or just add "Module2".

@nh2
Copy link
Member Author

nh2 commented Aug 21, 2013

@mvoidex I implemented your suggestion for hdevtools and ghc-mod.

nh2/hdevtools@e9fced6

nh2/ghc-mod@3f9c1c2

This allows us to type check whole projects really fast.

@bscottm
Copy link
Contributor

bscottm commented Mar 24, 2017

Closing this issue. Assuming it was implemented.

@bscottm bscottm closed this as completed Mar 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants