* Limit completions to top 20
We are overwhelming the LSP client by sending 100s of completions after the
first character. Instead, let's send 20 at a time and refresh for more when the
user types another word
* Simplify (thanks Neil!)
* Magic constant explained and increased to 40
* Add test
* Turn maxCompletions into config
* Fix some inaccuracies in tests
* document haskell.maxCompletions
* Fix another test
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Use completionSnippetsOn flag
* Enable testCase "respects lsp configuration"
* Update README: haskell.completionSnippetsOn is worked now
Co-authored-by: Junyoung/Clare Jang <jjc9310@gmail.com>
* Suggest adding pragmas for parse errors too
Only errors produced by the type checker were checked for mentions of a pragma
that could be enabled. Many parse errors suggest enabling a pragma:
* `@` -> `TypeApplications`
* `forall` -> `RankNTypes`. Although `ScopedTypeVariables` would be a better
suggestion, IMO.
* ...
Generate suggestions for these too.
* Find pragma suggestions for all diagnostics, not just for GHC
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Delete unused utilities for controlling logging.
Delete withFileLogging, logConfig, and noLogConfig.
Logging is turned on by hlsCommand. Should we ever want to disable it for a
certain test, we would create a new version of hlsCommand, say, hlsCommandNoLog.
* Delete unused import.
Co-authored-by: Javier Neira <atreyu.bbb@gmail.com>
Co-authored-by: Junyoung Clare Jang <jjc9310@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Implements splice location detection
* Corrects detection logic
* Changed to use (bogus) message for code action
* Splice location
* Extract `Ide.TreeTransform` as an independent package
* It once worked, but stops...
* Now it works for inplace expansion for expressions
* generalises tree transformation to general AST element
* Done for Types and Patterns!
* Disabled "commented" style of expansion
* kills redundant imports
* Updates cabal.project
* Nix fix
* Nix fix, fix
* Throws away loading hacks entirely
* Type adjusted for inverse dependency
* Resolves merge conflicts
* WIP: Support hover and goto definition for top-level splices
I can't work out how to properly integrate this information into the
.hie file machinery. Perhaps it would be better to upstream this.
* Modifies splice information to store both spliced expression and expanded ones as well
* Avoid name collision
* formatting erros
* Safer error handling
* Rewrote using updated ghcide `TypeCheck` results
* Use `liftRnf rwhnf` to force spine of lists
* Stop using `defaultRunMeta` directly to avoid override of preexisting hooks
* Error report
* Add splice information into HIE generation.
* Resolves interace conflict
* Add test
* Changes to use ParsedModule to detect Splice CodeLens
* formatted
* Implements golden test
* mzero for HsDecl
* Decl Splice
* Workaround for Decl expansion and support type-errored macro expansion.
* Only setting up dflags correcly would suffice
* Removes lines accidentally added
* Regression tests for Declaration splice and kind-error ones
* Workaround for GHC 8.8
* Revert "Workaround for GHC 8.8"
This reverts commit 056f76971f.
* Unsupport pattern splices GHC 8.8
* Corrects line position in GoToHover
* Increases wait time
* Includes only related changes only
* Optimises `something'`
* Adds hie.yaml
* circie ci: Modifies stack-8.10.3.yaml
* Forgot to update dflags in auto-expansion with default strategy
* Forgot to add golden file
* A dummy commit to run CI
* Workaround for GHC 8.8 pattern splices
Co-authored-by: Matthew Pickering <matthewtpickering@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Delete test/testdata/wrapper/*.
This is all dead code. It was brought over from haskell ide engine, but we don't
use it.
Note:
We are deleting test/testdata/wrapper
We are NOT deleting test/wrapper/testdata
wrapper/testdata contains live testdata, which is being used to test that
haskell-language-server-wrapper can load the appropriate version of
haskell-language-server based on the environment that it is running in.
* Delete HaRe test files.
These are dead code, they are very simple so they aren't likely to be useful
when writing new tests, and they have "HaRe" in the name even though HaRe is
gone, which adds mental burden.
* Delete unused test datafiles.
These all came over from Haskell IDE Engine, and we aren't using them. So lets
clean up by deleting them.
Co-authored-by: Javier Neira <atreyu.bbb@gmail.com>
Co-authored-by: Pepe Iborra <pepeiborra@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Make rename tests compile.
(They can't pass since we don't have a renamer yet.)
* Enable some more tests.
Co-authored-by: Pepe Iborra <pepeiborra@gmail.com>
Co-authored-by: Javier Neira <atreyu.bbb@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Move testdata for auto-formatting tests into its own sub-folder.
It's a lot of files, packing them up into their own little folder makes the
testdata directory much cleaner.
* Delete unused test datafiles.
These look like one the files used in the formatting tests, but they aren't.
These files do nothing.
* Fix typo. "Haksell" |-> "Haskell".
Haksell is what we do to our users.
Co-authored-by: Pepe Iborra <pepeiborra@gmail.com>
These tests were underspecified and broke with the recent improvements to ghcide
diagnostics in https://github.com/haskell/ghcide/pull/959 and included in this
merge.
Fixed by waiting specifically for the typecheck diagnostics and by being less
prescriptive in the number and order of code actions
Liquid Haskell is gone, delete the related code. Test the progress messages from
some of our other plugins. Help HLS load the testfiles for the warnings are
warnings test.
Christmas comes early for QuickCheck users! This PR adds support for generating arbitrary --- including the tricky business of ensuring termination. It can be run by calling Attempt to fill hole on anything of the form arbitrary :: Gen A for some type A.
Stop messing around the editing the file and reloading it. We are trying to test
code completion, not editing files, and the extra complexity is making it harder
to maintain the test.
completion/Context.hs used to generate a diagnostic for the unused "x", but no
longer does so without -Wunused-binds.
completion/Completion.hs used to generate a diagnostic for the unused import of
Data.Maybe, but no longer does so without -Wunused-imports.
We could add these flags like:
{-# OPTIONS_GHC -Wunused-binds #-}
But that would force us to update all the hardcoded line numbers in the unit tests.
Instead we just add a redundant id, carefully positioned to avoid disturbing any
hardcoded positions.