* Extract a minimal Abortable abstraction from shakeRun
* Add an Abortable implementation with Async
* Switch to async implementation
Off-sourcing the details of aborting computations to a mature library
* Inline the async implementation
Abortable is nothing but a thin wrapper for 'Async'
* Call logDebug out of the withMVar lock
* Simplify withMVar'
* Keywords in completion
* Update src/Development/IDE/Core/Completions.hs
Co-Authored-By: fendor <fendor@users.noreply.github.com>
* Fix the other usage of "keywrd"
Co-authored-by: fendor <fendor@users.noreply.github.com>
This has caused a bunch of issues in DAML where GHC seems to randomly
panics when completions are requested, see
https://github.com/digital-asset/daml/issues/4152 for the error. I am
not entirely sure what is going wrong there but `getDocs` also goes
through the GHCi codepaths which are known to cause issues with
ghc-lib so for now, let’s disable it.
This was causing the following error when trying to build under MinGW:
[28 of 38] Compiling Development.IDE.Core.FileStore
C:\Snapshot\src\ghcide\src\Development\IDE\Core\FileStore.hs:142:20: error:
Not in scope: `Dir.getModificationTime'
No module named `Dir' is imported.
|
142 | do time <- Dir.getModificationTime f
| ^^^^^^^^^^^^^^^^^^^^^^^
* Fix the build for ghc-8.8.2.
* Match the single-element list first.
Co-Authored-By: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
* Show kinds in hover
* Documentation on hover
* Enable kind tests
* Fix tests
* Print literals
* Show (some) overloaded literals
* Fix for 8.4
* Fix tests
* Do not consider literals for definitions
* Suggestions by @cocreature
* No warning for 8.4
* More fixes for 8.4
* Make it work with ghc-lib
* More fixes for warnings when compiled with ghc-lib
* More fixes to build in ghc-lib
* Try once again to build with ghc-lib
* More fixes for ghc-lib
* Fix warning with ghc-lib
* Improve hover performance by speeding up getFileExists
We touch the file system only the first time.
After that, we rely on the lsp client to tell us if a file is created or deleted
Fixes#101
This fixes an issue that we encountered in DAML. I’ll add a test for
this in the DAML repo since we cannot test the ghc-lib codepath
here (since we don’t setup an environment that works).
* Fix source spans for multi-clause definitions
Currently, we use the source span of the match which corresponds to
the whole clause instead of just the function identifier. This
resulted in us pointing every goto definition request within a clause
to the function if there is no other information (either because it
failed because it came from an external package or simply because you
are not on an identifier).
This PR fixes this by getting the proper source spans frmo the
HsMatchContext. Somewhat annoyingly, we have to get it from the parsed
module since GHC messes this up during typechecking but it’s
reasonably simple.
* Remove JSON instances for completions, since we are not implementing "resolve"
* Remove completion resolve data from tests
* Better docs
* Fix tests
* Fix for 8.4
* Turn Haddock markup into Markdown
* Add types to completion items
* Make it work on 8.8 and 8.4
* Revert "Remove completion resolve data from tests"
This reverts commit 625d710f11.
* Revert "Remove JSON instances for completions, since we are not implementing "resolve""
This reverts commit 12ff27dce7.
* Fix tests
* Require higher version of regex-pcre-builtin
* Replace Pandoc with direct conversion from Haddock to Markdown
* Show kinds of type constructors too
* A few fixed to Markdown conversion
* Check optNewColonConvention
* Fix build on 8.4 and 8.8
* More fixes for 8.4 and 8.8
* Check only the common part of the completion text
* Make icons consistent with Outline
* Test docs for completions
* Make constructors return the corresponding CompletionItem + tests for that behavior
* Make test work on 8.4
* Tests for issue 310 (misleading hover on inner signature)
The most important pair of tests here is the "inner signature" pair. The others
serve mainly to document, compare and contrast what is happening in related
situations.
In summary, hover and gotoDef
+ on inner signatures: give type and location information for the outer
definition; this is misleading,
+ on outer signatures: give no information at all,
+ on inner definitions: give correct information for the inner definition,
+ on outer definitions: give correct information for the outer definition.
Should hover and gotoDef do anything at all for signatures? or is the current
behaviour for outer signatures (doing nothing at all) what we want?
* Require signature hover/gotoDef to point to first clause of definition
* Remove perhaps superfluous tests for definitions
* Smarter logic to remove redundant import bindings
The new code finds the spans to remove using the GHC parse tree, then manually
extends them to include commas/spaces.
Fixes#299
* Compatibility with GHC 8.4
* Improve comment
Co-Authored-By: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>
* Use breakOnEnd in unqualify
This will handle A.foo as well as A.B.foo
Co-authored-by: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>
We already normalise filepaths in NormalizedFilePath. haskell-lsp
changed things such that the conversion from Uri to NormalizedUri
normalises the filepath again which caused a significant slowdown in
GetFileExists.
We already have a wrapper for converting from NormalizedFilePath to
NormalizedUri so this PR changes this wrapper to inline the definition
without the additional layer of normalisation.
fixes#298
* Document symbols provider
* Compatibility with GHC 8.4
* Replace large number with more descriptive maxBound
Co-Authored-By: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>
* Use SkFunction for all Val Declarations
* Improve outlining of PatBind and FunBind
No longer relying on gfindtype
Co-authored-by: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>
* Test for #45
* Remove redundant symbols from imports
Fixes#45
* Update src/Development/IDE/LSP/CodeAction.hs
Co-Authored-By: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>
* Apply suggestions from code review
Co-Authored-By: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>
* Add regex-tdfa extra deps to ghc-lib build
* Fix for GHC 8.4 (error message prints qualified binding)
GHC ticket #14881 changed this to print identifiers unqualified
* dropBindingsFromImportLine: make total
Co-authored-by: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>
* Initial implementation of completion support
* Add fuzzy to set of additional dependencies in 8.8
* Fix test
* Work a bit more on completion
* Attempt at getting completions from last good tckd module
* Revert "Attempt at getting completions from last good tckd module"
This reverts commit 04ca13b9d8.
* "useWithStale" everywhere
* Some suggestions by @cocreature
* Adjust positions in the document
* Start working on tests
* Fix compilation problem
* Fix tests
* Better type tests