Commit Graph

256 Commits

Author SHA1 Message Date
Neil Mitchell
3bd0c08d4d Add -Iinclude where it's needed (#86) 2019-09-19 08:06:19 +02:00
Domen Kožar
82da406520 bump to hie-bios 0.2.0 and bump *lsp packages (#83) 2019-09-18 13:42:34 +02:00
Jacek Generowicz
a162e81aa3 Defer type errors (#47)
* TEST: Degrade type error to warning

It will be upgraded again later, but for the time being we want to see
whether the proposed mechanism for deferring type errors works at
all. As it turns out the first, most obvious approach, does not
work: this is documented in the next commit.

A second approach was found that does work, and appears in the commit
after the next.

This test is failing until the second approach is implemented.

* Defer type errors (first approach: FAILED)

The idea is to set the `-fdefer-type-errors` and
`-fwarn-deferred-type-errors` flags, by setting options
programatically inside the `Ghc` monad.

Deferral of type errors was not observed with this approach. The
(less obvious) approach used in the next commit seems to be more
successful.

* Defer type errors (second approach: SUCCESS)

This approach modifies the `ParsedModule` which is passed to
`GHC.typecheckedModule` by hie-core's `typecheckModule`.

Type warning deferral is now observed at run time, and the tests pass.

* TEST: Reinstate severity of type errors

So far, type errors have been deferred and reported as warnings.

The next step is to ensure that the deferred type errors are reported
as errors rather than warnings, once again. This test fails until the
implementation arrives in the next commit.

* Upgrade severity of deferred Type Errors after typecheck

... and make the test pass again.

* Hide helper functions in local scopes

* Stop setting Opt_WarnDeferredTypeErrors

... and the tests still pass, thereby confirming @hsenag's hypothesis
that this flag is not needed.

* TEST: Check that typed holes are reported as errors

* TEST: Downgrade severity of typed holes Error -> Warning

This test fails, thereby falsifying the hypothesis that
`Opt_DeferTypeErrors` implies `Opt_DeferTypedHoles`.

* Defer typed holes

... and pass the failing test.

* TEST: Reinstate severity of typed holes

... failing the test until the implementation catches up in the next
commit.

* Upgrade severity of deferred Typed Holes after typecheck

... and pass the test once again.

* TEST: Degrade variable out of scope from Error to Warning

... test fails until next commit.

* Defer out of scope variables

... passing the test which was changed in the last commit.

* TEST: Reinstate severity of out of scope variables

... failing the test, and forcing the implementation to catch up.

* Upgrade severity of deferred out of scope vars after typecheck

... passing the test once again.

* Add explicit tests for deferrals

* Add IdeOption for deferral switching

* Improve documentation of optDefer

* Add IdeDefer newtype
2019-09-17 14:28:20 +02:00
Moritz Kiefer
819bd4242c
Fix race condition in shakeRun (#80)
* Fix race condition in shakeRun

fixes #79 which also contains a detailed description of the issue.

* Factor out async exception logic into withMVar'
2019-09-17 14:28:03 +02:00
Neil Mitchell
eba0185710 Add section on history and relationship to other IDE's (#78) 2019-09-17 08:52:58 +02:00
Moritz Kiefer
29d84e835b
Enable more warnings for the ghcide codebase (#75) 2019-09-17 08:50:20 +02:00
Moritz Kiefer
8db311cd8d
Fix hlint cpp includes (#76) 2019-09-16 17:19:58 +02:00
jacg
4fc09fafa2 Code actions for filling typed holes (#69)
* Add code action for filling type holes

* Incorporate hole name into action title

Useful if more than one hole appears on the same line. Not so useful
if both of these holes are just `_` rather than `_name` (or more than
one hole on the same line has the same `_name`): In which case perhaps
some numbers could be attached to the action titles, to distinguish
the holes. But I suspect that this would not be worth the effort.

* Add tests for fill-type-hole actions

* Disable two tests on GHC 8.4

These test hints about local bindings, whic GHC 8.4 does not provide.

* Replace compilerVersion with new MIN_GHC_API_VERSION macro
2019-09-16 16:43:50 +02:00
Ollie Charles
9a5ee23c01 Build on GHC 8.8 (#43) 2019-09-16 15:20:48 +02:00
Moritz Kiefer
7133f4192f
Merge pull request #73 from digital-asset/ghc-api-version
Cleanup GHC API version checks
2019-09-16 12:01:36 +02:00
Moritz Kiefer
2c24f2be15 Cleanup GHC API version checks
Previously we had a mix of GHC_STABLE and checks on
__GLASGOW_HASKELL__. This PR changes this to always check on
MIN_GHC_API_VERSION. Depending on whether you use ghc-lib or not (now
controlled by a cabal flag), this macro expands to MIN_VERSION_ghc or
MIN_VERSION_ghc_lib.
2019-09-16 11:34:25 +02:00
Moritz Kiefer
6164d0d17e
Merge pull request #67 from maralorn/patch-1
Add feature list
2019-09-14 17:03:07 +02:00
maralorn
01d423749b
Add organze imports feature to feature list 2019-09-14 15:37:35 +02:00
maralorn
8e0a2cb798
Add display definitions feature 2019-09-14 15:30:40 +02:00
maralorn
fd17b17a23
Add go-to-definition in feature list 2019-09-14 15:26:15 +02:00
maralorn
4d460c43a6
Add feature list
This is a certainly incomplete list of features already implemented. Please expand!
2019-09-14 15:24:26 +02:00
Moritz Kiefer
938a3c6f18
Merge pull request #63 from maralorn/patch-1
Delete non-ghcide options from coc.nvim example
2019-09-14 13:33:27 +02:00
Moritz Kiefer
de7295a89f
Merge pull request #52 from jacg/module-not-found-action
Code action for 'module not found'
2019-09-14 13:02:58 +02:00
Moritz Kiefer
855c18ea93
Merge pull request #58 from hercules-ci/extension-update
migrate to new @types/vscode, add vsce devDependency
2019-09-14 12:52:35 +02:00
Moritz Kiefer
cc4865f979
Merge pull request #55 from 2mol/patch-1
fix type in README
2019-09-14 12:52:23 +02:00
Moritz Kiefer
d669f5306e
Merge pull request #59 from hsenag/unqualified-warnings
Make sure warnings use unqualified names where appropriate
2019-09-14 12:45:14 +02:00
maralorn
17d6dcb880
Delete non-ghcide options from coc.nvim example
These options don‘t work with ghcide as far as I can tell. I believe they stem from copying the config used for hie-wrapper. As ghcide does not support hlint yet I believe this infos to be misleading. That‘s why I suggest deleting it.
2019-09-14 12:36:39 +02:00
Ganesh Sittampalam
316d78a471 Make sure warnings use unqualified names where appropriate
Because we are constructing the message objects ourselves, as
opposed to error messages which are constructed by GHC, we need
to take care to respect the passed-in 'PprStyle'.
2019-09-13 13:43:57 +01:00
Robert Hensing
0fc96368d3 migrate to new @types/vscode, add vsce devDependency
The vscode library is deprecated in favor of @types/vscode.
See https://code.visualstudio.com/api/working-with-extensions/testing-extension#migrating-from-vscode

This also add vsce as a devDependency, so you don't need to install
it globally. Instead you can run it via npm run vscepackage. This
simplifies the README (or future "hacking" instructions when the
extension is published)
2019-09-13 13:16:38 +02:00
2mol
a8d31ce7fa
fix type in README 2019-09-13 11:53:53 +02:00
Jacek Generowicz
a58751e3d6 Apply hlint suggestions 2019-09-13 08:43:16 +02:00
Jacek Generowicz
f53faf8734 Add code action for GHC's suggestions for not-found module 2019-09-13 08:43:16 +02:00
Moritz Kiefer
4aa1821fe2
Merge pull request #41 from ndmitchell/add-preprocessor-module
Add preprocessor module
2019-09-13 06:44:49 +02:00
Moritz Kiefer
8a71bfaa81
Merge pull request #51 from ollef/master
Add support for removing redundant qualified imports
2019-09-13 06:20:11 +02:00
Olle Fredriksson
8d0e4a2ca0 Add support for removing redundant qualified imports 2019-09-12 22:51:46 +02:00
Olle Fredriksson
fdefb6bc6d Add a test for removing an unused module 2019-09-12 22:51:10 +02:00
Neil Mitchell
963cb7f647 PR feedback 2019-09-12 21:49:11 +01:00
Moritz Kiefer
14b0b16aec
Merge pull request #27 from hsenag/type-wildcards
Code action for type wildcards
2019-09-12 15:58:51 +02:00
Ganesh Sittampalam
de35c8fe99 Code action to fill in GHC's suggested type signature for _ 2019-09-12 10:08:01 +01:00
Moritz Kiefer
f4553757dd
Merge pull request #39 from ollef/master
Handle PackageImporting "this"
2019-09-12 10:03:26 +02:00
Olle Fredriksson
2312cba385 Add PackageImport test 2019-09-12 09:39:13 +02:00
Moritz Kiefer
10e5f154d6
Merge pull request #40 from timjb/rename-action
Add code action for fixing misspelled variable names
2019-09-12 09:16:05 +02:00
Neil Mitchell
9cfb9aa9ab Less extensions 2019-09-11 22:45:41 +01:00
Neil Mitchell
99621e5f78 Reformat the import list 2019-09-11 22:45:10 +01:00
Neil Mitchell
20c829038c Avoid 3 space indents 2019-09-11 22:45:03 +01:00
Neil Mitchell
a4fafc2d60 Optimise literate code - avoid a redundant read 2019-09-11 22:43:30 +01:00
Neil Mitchell
1c1f55498b Pull out an isLiterate function 2019-09-11 22:41:57 +01:00
Neil Mitchell
ae87135aa5 Create a dedicated preprocessor function, to apply all the necessary preprocessors 2019-09-11 22:40:21 +01:00
Neil Mitchell
acc834c779 Rename sourcePlugin to the right name 2019-09-11 22:40:02 +01:00
Neil Mitchell
37689a808e Move catchSrcErrors over to GHC.Error 2019-09-11 22:31:59 +01:00
Neil Mitchell
18ee98f069 Pull the preprocessor functions into a separate module 2019-09-11 22:25:07 +01:00
Tim J. Baumann
eb818353fc Add code action for fixing misspelled variable names
The suggestions are extracted from GHC's error messages.

To make parsing these error messages easier, we set the flag
useUnicode=True, which makes GHC always use “smart quotes”.
2019-09-11 22:48:09 +02:00
Olle Fredriksson
d859af2102 Handle PackageImporting "this"
"this" means that we only look for the module in the current package, so
we only look for a file in that case.

Fixes https://github.com/digital-asset/ghcide/issues/37.
2019-09-11 21:02:18 +02:00
Robin Krom
f66c886217
Merge pull request #36 from digital-asset/vim_coc_instructions
Added setup instructions for vim/coc to README
2019-09-11 16:04:47 +02:00
Robin Krom
3589042a3f Added setup instructions for vim/coc to README
Instructions to setup https://github.com/neoclide/coc.nvim and neovim
together with ghcide.
2019-09-11 15:45:15 +02:00