* Drop min_version_ghc (8.8.4 is min supported)
* Drop conditional glasgow_haskell cpp
* Inline some imports (review feedback)
* Drop hie-compat 8.6 (review feedback)
* Dropping more ghc 8.6 related code and docs
* Eval: Include tests that were broken for 8.6
* baseline for record completions
* address feedback
* gate ghc version
* add test
* refactor
* fix rope import
* fix plugins from rebase
* gate test by ghc version
* comments, fixes
* fix ghc90 test
Use hiedb from hackage
gitlab-ci: remove workaround for windows 9.2.2
gitlab-ci: remove workaround for windows 9.2.2
hie-bios
update hie bios
update hie bios
bounds
hie-bios fixes
hie-bios fixes
lsp 1.6
cabal.project fixes
hie-bios fixes
lsp and hie-bios from hackage
Mark hie-bios error as expectFail
hie-bios fixes
hie-bios fixes
Stack
Stack
stack fixes
* extract ghcide:experiments-types
* extract haskell-language-server:plugins and let go of examples
The main goal here is to move the Plugins module into an internal
library so that it can be reused from the benchmark suite.
In order to
make that easier, and since they hardly serve a purpose in a repository
with 25 plugins, I delete the Example and Example2 plugin descriptors
and their dependencies.
* HLS benchmark suite
Port the ghcide benchmark suite to HLS and benchmark plugin
"configurations" independently.
This includes the following changes to the ghcide benchmark suite and
HLS:
- Support for "configurations" which are defined as sets of plugin ids.
The benchmark will be run with only these plugins enabled and all
others disabled
- Support for configurable concurrency. This relies on RTS -ol and -po
flags to place the RTS traces in the target location rather than in
the cwd
This change requires two commits, the next one places
ghcide/bench/hist/Main.hs into its final location to help 'git'
recognize the change as a file move
* ghcide/bench/hist/Main.hs -> bench/Main.hs
* CI - fix artifact names for uniqueness
* disable shorten HLS step
* Do not store eventlogs to avoid out of disk space
* render durations up to milliseconds
* shorten titles
Goal is to display the formatted CSV (via column) one row per line
* exclude formatting plugin configurations
* Extract ghcide-bench to a standalone package
* ghcide-bench: fix stderr capturing
* Fix mem stats
We parse maxResidency and allocatedBytes from the RTS -S output, but runSessionWithHandles kills the server without waiting for it to exit and these stats don't get logged.
The solution is to use runSessionWithHandles', but unfortunately it is internal and not exposed. I have raised a PR to expose it and in the meantime we need a source repo package.
* feedbacks
* delete Example plugins
* Log ResponseErrors when returned from Plugins
* Log from Plugins
* Create 'logAndReturnError' that will log any failures in plugins
* Missed opportunity to use logAndReturnError
* Revert throwPluginError to throwE
This reverts a change made previously to try to make pluginErrors have a
common error format. This will be updated in the near future.
* Warning -> Error
* Fix Functional Test for Plugin Response Error
* Add orphan instances for
* Revert back to Warning
* Update log format in test suite
* HLint partial functions
* Delete commented out stuff
* Delete flag-based warnings, unclear they add much
* Delete DA-specific hints
* Delete extra cpp args
* Delete extension options relating to dead build system
* Don't bother trying to restrict CPP for now, it's everywhere
* Make the hlint job fail if there are any errors
* Fix for rebase, add unsafePerformIO and fold1 variants
* Add some more indexing functions
* Try turning off hlint on this test file
* Add .hlint.yaml file for hls-hlint-plugin
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Should no code lens if the module name is correct
* Rerun tests
* Rerun tests
* Try remove hls-eval-plugin known-broken in ghc-9.2
* Rerun tests
* Apply more accurate test name
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
* tests: Test for eval plugin now show correct line in output
Using `HasCallStack`, `testCase` can no pinpoint the call location
instead of pointing inside the utility function.
* Restore eval plugin build for GHC 9.2
It restores the eval plugin. Now annotations with comments are found by
walking the AST and locating specific annotations.
In order to fix unit test, I implemented a new golden test function
which accepts a different naming scheme depending on the GHC version.
* fix: remove unused log mecanism
* Refactor: move pragma to compat module
* refactor: Remove now useless dependency
* fix: remove an unused import
* Disable a test for eval plugin for GHC 9.2
Eval plugin does not report progress, I don't understand why.
* fix: type +v actually also works with GHC 9.0
Co-authored-by: Pepe Iborra <pepeiborra@gmail.com>
* Get rid of come head usages
* Fix typo
* Use pattern guard, move util to hls-test-utils
* Revert the change in ghcide tests
* Fix nonexaustive pattern warning
* Enable brittany for ghc-9.0.2
* Make works using cabal freeze
* Add stack 9.2.1 to ci
* Use new *molu versions
* Enable rename for stack 9.2.1
* Use last ghc-lib
* Use correct boot pkgs
* Use last ghc-exactprint
* Reorganize and use lens-5.1
* update retrie
* Comment class plugin package
* Handle Nothing case
* Restore ghc-typelits deps
* More non-exhaustive patterns
* More non-exhaustive patterns
* Set pedantic (-WError) true for cabal
* Remove pedantic as we set it out in cabal.project
* Not set pedantic for ghc-9.2.1
* Set pedantic in cabal.project's
* More non-exhaustive patterns
* Not set pedantic for ghc-9.0.1
* More incomplete patterns
* Fix WErrors
* Dodgy import
* Correct CPP conditions
* Not MonadFail in Prelude
* Fix more warnings
* Restore missing fun
* unused imports
* Enable refine imports
* more fixes
* Enable brittany in nix for 9.0.1
* Use newer prettyprinter
* Return to master
* Enable tactics in stack-9.2.1.yaml
* Enable pedantic in ci
* Avoid deprecation warning with CPP �
* Use default prettyprinter
* Update refinery for ghc-9.2.1
* Ignore deprecations
* Use dev version of ghc-source-gen
* disable wingman for 9.2.1
* Enable wingman for 9.0.2
* disable tactic with flag
* yaml grammar
* Use setup-build action
* Correct workflow
* Build flags for al major os's
* The integer twaek is needed for the solver
* Disable tests beforehand
* flags only affect local packages
* Exclude 8.6.5
* Exclude 8.8.4
* Initial partially broken ghc9 support for tactics
It compiles and most tests succeed, but some fail.
In particular, the ones where it should suggest `show` fails to find
that as a possible solution and fails to find evidence for `Show a`.
* Enable tactics plugin for nix as well
* Wingman does support ghc9 now
* Fix stack support for tactics ghc-9.0.1
* Enable tests for tactics on ghc-9 on ci
* Actually enable tactics for ghc-9 on nix
* Wingman: Improve test failure messages
Previously when wingman fails to find a solution, the test failure
would say "Timed out when waiting for a message".
Now it instead prints the error message from wingman.
* Get theta
* Make wrapper theta discovery more reliable
* Fix AutoThetaRankN
* Fix FmapJoin and FmapJoinInLet
* Fix MetaBegin
* Cleanup
* Fix merge
More fixing the merge
No, seriously fix the merge
Fix a broken merge
* Need a comma
* Try a better ConPatIn
* Oops
* its a nightmare
* i hate ci
* ok that fixes the conpat
* Maybe this is the end of it
* ci
* refinery
* undo some changes
* no more tctypes?
* maybe it builds now
* omg
* om F g
* expect fail on 9.2
* fix
* fix again
Co-authored-by: Andreas Källberg <anka.213@gmail.com>
Co-authored-by: Javier Neira <atreyu.bbb@gmail.com>
* WIP
* progress
* enable 9.2 in CI
* Sort out some compatibility issues (#2511)
* fix mkPrintUnqualifiedDefault
* fix qualified idents
* Fix a few more ghc compats
* Add new orphans
* Fix runtime APIs
* HsParsedModule
* export GHC.Hs.Utils
* 9.2 compat for unloading and hie file generation
* hlint fix
* Remove 'setupFinderCache' as its never actually used
* 9.2 compat for Development.IDE.Core.Compile
* Stub out 'getDocumentation' on GHC 9.2 (Requires a reimplementation in terms of in-tree annotations)
* Expose binds
* Remove a bit of CPP by refactoring it into Compat layer
* Progress on ghc-exactprint stuff
The Exactprint module compiles, but code actions are the next focus.
* Fix compile on 8.10
* 9.2 compat for CodeAction Exactprint
* 9.2 compat for Outline
* 9.2 compat for Pragmas plugin
* Get the rest compiling with 9.2
* WIP: PLEASE, DROP THIS COMMIT BEFORE MERGE
This hook starts caching pipeline inside of the PR.
If this got merged - all PRs would start to run caching workflow (which is
undesirable, because of platform limitations)
* disabling {test,bench} to properly heat-up the cache
`index-state` change means nothing, but allow to run increment action on
dependency cache pile (as otherwise cache stays idempotent to its key id).
* CI: index-state: +1s refresh
Somehow previous run got early termination. Seems like some GitHub bug, since
cache-hit promises to True only on direct key hit (& we had indirect).
Maybe second time the charm.
* CI: fix early termination
GitHub accepted previous code, & did passed the steps, but somehow ... long
story short, it was pretending to have early termination working, while it just
was always skipping those steps silently.
So, `index-state` needs another +1s.
* WIP: PLEASE, DROP BEFORE MERGE
* WIP: PLEASE, DROP BEFORE MERGE
This reverts commit 064a9b7995.
* WIP: PLEASE, DROP THIS COMMIT BEFORE MERGE
This reverts commit 208f4844f4.
* WIP: PLEASE, DROP THIS COMMIT BEFORE MERGE
This reverts commit ba4d618ba5.
* CI: index-state advance to save cache anew
* CI: apparently GitHub uses alias cp='cp -i'
Another day, another bug.
* WIP: PLESE, REVERT TO TEST ALL GHCs
* CI: index-state +1s
* WIP: PLESE, REVERT TO TEST ALL GHCs
* CI: index-state +1s
* WIP: PLESE, REVERT TO PASS HLINT CI REQUIREMENTS
* Enable tests for ghc-9.2.1
* Use cabal-ghc921.project
* Enable tests for all ghcs
To check changes for ghc-9.2.1 do not break other ghcs
* Address or skip hlint
* Last hlint fixes
* Fix loop when setting DynFlags
* Filter out evidence variables in documentHighlight
* Fix getFlds
* fix GRE
* fix formatting
* fix Compat build in 9.0
* fix collectHsBindsBinders
* remove redundant WarnMsg local typedef
* showSDocForUser
* redundant import
* HsLet
* LetStmt
* fix Completions build
* bump cabal index state
* Literals: replace argument patterns by field patterns
Sadly this is not enough to fix the build
* QualifyImportedNames: fix build with ghc <9.2
* fix <9.2 build Splice plugin
* fix <9.2 build QualifyImportedNames plugin
* Fix <9.2 build Wingman
* fix build example
* Disable a whole bunch of plugins
* Move windows test into the matrix
* Make consistent plugin handling
package commented out <-> flags <-> test suite
* Add a not working stack.yaml for ghc-9.2.1
It starts to build though
* Remove wrong comma
* Restore primitive allow-*
* Use correct UnitId when constructing InstalledModules
* Fix 8.8 build
* Fix hls-test-utils
* Build explicit imports plugin
* Drop Windows build blocked on unix-compat
* bump Cabal index and simplify constraints
* Add comment
* Use GhcSessionDeps in getHieAst
* Use hsConDeclsBinders in Outline generation
* Use the right session in typecheckModule
* Restore some cases in Outline
* Fix Outline build with GHC <9.2
* Remove noisy logMessage notifications in tests
I have never found these useful and they make it much harder to read logs. If there is a test that needs them, please use a custom logger instead of forcing this madness on everyone.
* Build ghcide test and bench suites with 9.2
* Revert "Merge branch 'master' into ghc-9.2"
This reverts commit daf43c86e8, reversing
changes made to f951004021.
* The redundant constraints warning has changed in 9.2
* Fix code action regression
* fix 9.2 ghcide build
* Fix completion snippets
* Fix mismerge
* Bifunctor instance for GenLocated
* Build rename plugin with GHC 9.2
* Helpers for tracing ExactPrint ASTs
* Fix exactprint code actions
* Enable import lens plugin
* WIP test run changes
* Fix GHC 9 build
* Undo WIP test changes
* Fix GHC 8.8 build
* Fix 8.6 build
* Fix another exactprint regression
* Add source repository with ghc-exactprint fixes
* Add source repository for retrie (needed for fixed ghc-exactprint)
* fix ghc <9.2 build
* Another exactprint fix
* Fix benchmarks
* Another exactprint fix
* Disable a plugin test (plugin not compatible anymore)
* Enable windows build
* Fix multiple components by using consistent UnitIds
There are multiple sources of truth for the home unit id now, in the DynFlags and in the hsc_units
* Improve error handling for initPlugins
* Fix two hover tests
* Remove retrie and ghc-exactprint source repos
* Fix version of direct-sqlite
Not sure why this is needed, but without it Cabal is selecting an older version
which fails to build with 9.2
* Fix ci update hackage index
* This test is broken because GHC 9.2 built-in libraries lack docs
The interface files have no docs, checked via:
ghc --show-iface ~/.ghcup/ghc/9.2.1/lib/ghc-9.2.1/lib/x86_64-osx-ghc-9.2.1/base-4.16.0.0/Data/Functor.hi
* Sanitize hiding tests
These tests are reimplementing runWithExtraFiles - let's just use it
* Disable another test
* Fix outline
* Revert "Sanitize hiding tests"
This reverts commit 4f016ddca2.
* Extract out ci build setup
* Correct action path
* Add required shell property
* Remove unused cabal version
* Update .github/actions/setup-build/action.yml
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
* Update .github/actions/setup-build/action.yml
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
* Update .github/actions/setup-build/action.yml
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
* Fix remaining tests and some warnings
* Update .github/actions/setup-build/action.yml
Co-Authored-By: @michaelpj
* Copy alt project file unconditionally
* Make freeze strict
* Actually fix tests
* remove unnecessary? allow-newer
* Drop no longer needed source repo for th-extras
* Add module header comments
* Fix or remove commented out code
* more commented out code
* Disable a couple of func-test tests
* All func-test tests passing now
* fix test matrix
* Update cabal-ghc921.project
* do not test class plugin
* Mark hover test broken in Windows and Mac
* Fix hls-pragmas-plugin test suite
* disable testing of refine imports plugin
* disable rename plugin
* Do not test qualify imported names plugin
* addressing hlint suggestions
* Revert hlint change that breaks due to CPP
Co-authored-by: Alan Zimmerman <alan.zimm@gmail.com>
Co-authored-by: Zubin Duggal <zubin.duggal@gmail.com>
Co-authored-by: Anton Latukha <anton.latukha@gmail.com>
Co-authored-by: jneira <atreyu.bbb@gmail.com>
Co-authored-by: Junyoung "Clare" Jang <jjc9310@gmail.com>
Co-authored-by: Matthew Pickering <matthewtpickering@gmail.com>
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
* Enable tests for brittany and 9.0.2
* Enable tests for floskell plugin
* cabal-ghc901.project: naively enable brittany
* haskell-language-server.cabal: bump brittany flag <(9.0.1->9.2.1)
* Trying to add support for brittany
* Use last hackage floskell version
* Activate floskell in func-test suite
* Restrict brittany in hackage for ghc<9.0.1
* Adapt to Aeson.Key
* Update lsp source repo package
* Refer pr for butcher
* Add missing prefix
* Adapt to aeson-2 (incomplete)
* Use compat module
* Support for aeson-2 and extra-1.7.10
* Remove lsp
* Allow newer aeson for stylish-haskell
* Add needed import for non windows
* Remove insertJson and toJsonKey
* Update cabal-ghc901.project
* Missing import
* Avoid CPP by using lens-aeson
* Update hls-plugin-api/src/Ide/Plugin/ConfigUtils.hs
* Use ghcide compat module
* Use type alias in cpp
* Fix stack build for ghc-8.6.5
* Use lens-aeson key
* Use lens-aeson in func-test
* Fixup shake-bench
* Update docs
* Switch to lens ix
* Try this
Co-authored-by: Anton-Latukha <anton.latukha@gmail.com>
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Update to latest version of lsp libraries
* Compute completions on kick
This is not only for faster completions.
It's also needed to have semi-fresh completions after editing.
This is specially important for the first completion request of a file - without this change there are no completions available at all
* Emit LSP custom messages on kick start/finish
useful to synchonize on these events in tests
* Fix completions tests after https://github.com/haskell/lsp/pull/376
* Restore cabal update with comments
* Use new lsp in stack 9.0.1
Co-authored-by: Pepe Iborra <pepeiborra@gmail.com>
Co-authored-by: jneira <atreyu.bbb@gmail.com>
* Remove support for ghc 8.8.3/8.10.5
* Remove ghc-8.10.5 from circleci
* Correct releases links
* Rename stack test dir
* Parametrize stack wrapper test
* lock-less publishedDiagnostics
* lock-less diagnostics
* move deleteValue and recordDirtyKeys to STM
* Move getDiagnostics to STM
* fix plugins
* Do not send stderr output to a file in func-tests
Stderr output is very useful to diagnose test failures when interleaved with the LSP log. Sending it to a file disrupts this interleaving and makes it harder to retrieve from CI
* Rerun tests between run attempts
* without quotes
* Bump up versions for hackage
* Add support for auth github requests
As anonymous ones reach the api limit quickly
Via a unique argument with a github oauth token
* Add changelog for 1.5.1
* Fix makrdownlint warnings
* Bump up index state
* Bump up plugin version
* build with -v3 on error
* More backjumps for tests and benchs
* Add last prs
* eval plugin needs ghcide>=1.5.0.1
* Include #2395 in the changelog
* Ignore deferred tests for win and 9.0.1
* Ignore tactics tests for ubuntu+8.6.5
* sort completions
* add an example
* Include fuzzy scores in completions sort text
* hlints
* Extend completion documentation to inform whether an identifier is alreaady imported
* Ditch alphabetical ordering - it's incompatible with qualified completions
* Fix bugs in completion help text
This fixes the ugly "Imported from 'Just B'" and other inconsistencies
* added tests for qualified completions
* Fix redundant import
* Inline Fuzzy.match to apply [1] and to be case-sensitive on first match
[1] - https://github.com/joom/fuzzy/pull/4
* fixup! Fix bugs in completion help text
* Sort qualified completions first
* Filter out global suggestions that overlap with local
For example, don't suggest GHC.Exts.fromList when Data.Map.fromList is in scope alraedy
* Sort completions alphabetically
* Show provenance in detail text
* Sort local/in-scope completions first
* Fix build with GHC 9
* Ignore func symbol tests
Co-authored-by: Alex Naspo <alex.naspo@protonmail.com>
Co-authored-by: Javier Neira <atreyu.bbb@gmail.com>
* First temporal changes
* Clean up tests plugin inclusion
Deprecate them as they will be removed when all tests are
moved to their own plugin packages
* Use force-plugins in project files
* Add ghc-9.0.1 to hackage release workflow
Diabling actual upload if the branch contains 'check'
* Improve force-plugins explanation
* Correct deprecated pragma location
* Dont use deprecated pragma
* Correct yaml config error
* Change flag name
* Use new flag name in project files
* Move hlint tests to its package
* Move hlint config tests to its package
* Update extra-source-files
* Remove unused cabal-helper test data
* Add hlint test suite
* Make diganostic tests work without hlint
* Make progressCap test work without hlint files
* No cabal files in hlint test data
* Fix progress test
* Fix parent folder name
* Correct test data dir
* Correct extra-source dir and update maintainer
* Use sendConfigurationChanged everywhere
* Remove outdated setup troubleshooting
* Remove ghc-8.6.4 support
* Remove ghc-8.10.2 support
* Remove ghc-8.10.3 support
* Remove ghc-8.10.4 support
* Complete list of tested ghcs
* Update stack resolvers
* Update hackage index
* Set 8.10.7 as default stack.yaml
* Use extra 1.7.9
It's quite unclear in the spec, but in
microsoft/language-server-protocol#970
it's suggested that the intention is that the kinds given in `only`
should be used as *prefix* filters of the generated code action kinds.
That is to say, if the client asks for `only = [ CodeActionRefactor ]`,
we should give them all kinds of refactoring code actions, including
those whose kind is `CodeActionRefactorInline` (because as "hierarchical
strings" they are represented as `"refactor"` and `"refactor.inline"`).
This is quite important for the client: e.g. I hit this because I wanted
to ask for all the import quickfixes so I could present them to the user
to pick one. But they use various subkinds of `"quickfix.import"`, so
currently you cannot ask for them all (asking for `"quickfix.import"`
currentl returns nothing!).
The ipmlemention is a little ugly: this needs some helper funcitons in
`lsp`, which I'll make a PR for separately, but I didn't want to block
this.
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* auto complete functions from imports
* address PR comments
* clean up
* remove duplicate HashMap import
* use lookupDefault
* fuzzy match filter
* add field to exportsMap
* generate map from modIFace
* Update ghcide/src/Development/IDE/Types/Exports.hs
Co-authored-by: Pepe Iborra <pepeiborra@me.com>
* module name text alias
* use hashset; enable local modules
* local module imports now working
* derive map from exportMap
* generate maps from list
* clean up
* addressing PR comments
* clean up
* clean up
* useWithStaleFast
Co-authored-by: Javier Neira <atreyu.bbb@gmail.com>
Co-authored-by: alexnaspoleap <88672779+alexnaspoleap@users.noreply.github.com>
Co-authored-by: Alex Naspo <alex.naspo@leapyear.io>
Co-authored-by: Pepe Iborra <pepeiborra@me.com>
Co-authored-by: Pepe Iborra <pepeiborra@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* initial commit
project structure
initial test cases
directly modify source to rename references
* code style
* enable for ghc < 8.8.0
* remove aeson from build-depends
* update support
support ghc9
revert retrie version bump
disable feature by default
* enable plugin for testing
* fix test.yml
* code style, ghc9 retrie bump
remove unnecessary flag in test.yml
consistent indentation
increase retrie version for ghc 9.0.1 (decreased by mistake)
* avoid using Data.List.nub
* code style
fix typo in indentation test
break lines at 100 chars
rename some vars
* code style / performance
remove Retire dependency by using exactprint directly
group references by file to increase speed of checking `elem` per file
add test cases (typeclass, let expression)
add some documentation
fix bug when looking up reference in HieDb
improve error messages
rename some function / vars
* replace GhcPlugins import with Name import
* use GHC.Types.Name for ghc >= 9.0.1
* Disable hole fit suggestions for EXTREME SPEED
* Note the new behavior in the README
* Disable the tests
* Update documentation
* Fix tests properly
* Tests that code actions don't appear when Wingman is enabled
* Unset dynflags rather than change their values
* Fix error message
* Revert "Unset dynflags rather than change their values"
This reverts commit 940c535ab9.
* Maybe try unsetting it too?
* Maybe this will elucidate the error
* Disable tests on GHC9 because tactics doesn't build on GHC9
* Revert "Maybe this will elucidate the error"
This reverts commit 6c5b8356a3.
Co-authored-by: Javier Neira <atreyu.bbb@gmail.com>
* Test 9.0.1 for windows and macOS
* Refactorize ghc checking in tests
* Replace CPP checks with ghcVersion
* Use GHC cpp and remove 8.4
* Use the ghc version runtime checker
* HLINT ann ignored for ghc-9 too
* Mark test as broken for win and ghc-9
* Use GHC90 in eval tests
* Disable tests for macos and ghc-9.0.1
* Test 9.0.1 for windows and macOS
* Refactorize ghc checking in tests
* Correct imports/exports
* Replace CPP checks with ghcVersion
* Use GHC cpp and remove 8.4
* Use the ghc version runtime checker
* HLINT ann ignored for ghc-9 too
* Mark test as broken for win and ghc-9
* Use GHC90 in eval tests
* Avoid reformatting code
* Remove not supported ghc-8.4
* Disable tests for macos and ghc-9.0.1
* Ignore hlint+cpp tests for win and ghc-9.0.
Fixes warnings like:
```
Warning: test/testdata/testdata.cabal:3:27: Packages with
'cabal-version:
1.12' or later should specify a specific version of the Cabal spec of
the form
'cabal-version: x.y'. Use 'cabal-version: 2.0'.
```
Co-authored-by: Potato Hatsue <1793913507@qq.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Eval plugin: support ghc 9.0.1
* Update CI and stack
* Use pprTypeForUser for printing kinds
* test: remove forall
* test: [Char] -> String
* test: update forall
* Keep tests only for GHC 9
* Update nix and CI
* Mark one hlint test as known broken
* Re-enable tests for other ghc versions
* Update test
* hie-compat: Add basic support for ghc-9.0.1
A tiny step towards #297
* hie-compat: Remove dependency on ghc-api-compat
* hie-compat: Add more backwards compatability
* Import a bunch of upstream ghc9 fixes
* cabal.project: allow-newer: *:*
The lazy solution to making things compile
* Add more upstream fixes
* Bump patch of ghc-check
* ghcide: Add basic support for GHC-9.0.1
I tried to limit the use of CPP to the Compat module as much as possible
by re-exporting the new functions under the old names,
but there is still plenty of pragmas all over the code.
I'm using ghc-api-compat so the imports doesn't need to be changed as much.
* ghcide: Fix backwards compatability with ghc-8.8.4
* ghc9-ghcide: Fix some more issues that caused runtime errors
* Restore initDynLinker for older versions of ghc
It was probably important for something
* Fix ghc-8.6.5 compatability
* Fix completion test failures for ghc9
With this example:
f asdfgh = asd
it would suggest to complete `asd` into `asd_arNC`,
which seems to be a name it generated because of
deferred-out-of-scope-variables
* Ghc-check now supports ghc-9.0.1
* Retrie now supports ghc-9.0.1
But it's not on hackage yet.
* Restore retrie orphans
* tests: Ghc9 shows [Char] as String by default
This seems like an improvement, so just update the test-suite
* tests: Ghc9 shows TH-errors after the dollar sign
Instead of including it like older versions did
$(foo)
~~~~
some TH error/warning
* Fix two more test failures
- GHC9 uses a more lenient haddock parser
- TH2.17 has polymorphic Q monad with a type class
* ghc9: Fix "Remove redundant imports" code action
In ghc9, only the specific unused function is highlighted,
instead of the whole line.
* ghcide-tests: Show errors where they are caused
instead of deep inside some generic helper function
* Only use nub on SrcSpan for ghc>=9
* Remove more CPP pragmas
* Remove a bit more CPP
This could almost be handled by ghc-api-compat,
but if it was imported from TyCoPpr, it doesn't work with
ghc < 8.10
* Update stack files to support new versions
* Use the version of retire on hackage
The new version is now released
* Don't use allow-newer: *:*
* ghcide-tests: Enable test no longer broken in ghc9
* Update hiedb version for ghcide
* Adjust for a minor change in test output for ghc9
* Fix benchmark test for ghc9
Cabal-3.2 is not buildable on ghc9, but 3.4 is builable on older ghc.
* Mark minor issues as broken for ghc9
Ghc9 highlights both the constructor and the other fields
Maybe this should just be accepted and not seen as broken?
* haddock-comments-plugin: Ghc9 support
* hls-eval-plugin: Partial ghc9 support
* WIP: hls-eval-plugin: Partial ghc9 support
* hls-explicit-imports-plugin: Add ghc9 support
Now ignores any imports with Unhelpful locations,
since we can't make a map of SrcLoc
* hls-retrie-plugin: Add ghc9 support
* hls-hlint-plugin: Add ghc9 support
* Fix backwards compatability of hlint plugin
* Fix stack builds
(Broken by previous hlint fixes)
* Disable tests when their required plugins are disabled
Not all plugins are supported on ghc9 yet, but we
still want to run the tests for the supported parts
* ghc9: Fix module name plugin
* Add a stack file and run tests for ghc9 in ci
* Add missing packages to ghc-9 stack
* Resolve rebase issues
Maybe it's better to create merge commits instead?
* Allow newer for more packages so cabal stops complaining
These aren't really working, but since they are dependencies
of packages in the `packages:` section
the resolver won't allow us to build anything without this, even if
those plugins are disabled.
* Replace MIN_GHC_API_VERSION with MIN_VERSION_ghc
* Revert incorrect change to hlint code
* Remove remaining traces of GHC_LIB flag
* Add back ghc 9 to github workflow
* Revert "Add back ghc 9 to github workflow"
This reverts commit c465a1e51a.
* hie-compat: Add basic support for ghc-9.0.1
A tiny step towards #297
* hie-compat: Remove dependency on ghc-api-compat
* hie-compat: Add more backwards compatability
* Disable CI for ghc9
* Use newer version of apply-refact
* Don't needlessly duplicate code from ghc
* hie-compat: Reexport the original version of HieBin
* Don't include broken "allow-newer"s
* FIx stack build for ghc9
* Fix warning from imperfect merge commit
* Don't needlessly duplicate code from ghc
* hie-compat: Reexport the original version of HieBin
* Add missing ghc-api-compat
* Fix ghc9 build for ModuleName
* Add more conditionals on flags for tests
* Add a separate cabal.project file for ghc9
As far as I know, this is the only way to disable the packages who's
dependencies doesn't compile in GHC9 yet.
* Fix and re-enable CI for GHC9
* Remove accidental non-breaking space
* Fix CI build for ghc9
Since we are changing the flags for haskell-language-server,
which CI renames to hls,
we need to use the shortened name in those flags as well
* Run tests for ghc9 in CI
* Minor CI changes
* Use proper values when enriching hie
* Don't try to test hls-refine-imports-plugin on ghc9
* Update comment about ghc9 crashing on initDynLinker
* setSessionDynamicFlags to prevent ghc9 from crashing
The only way to set the dynamic linker is with the function `setSessionDynFlags`
so we call it with the result from `getSessionDynFlags` to give it a
(hopefully sensible) argument.
See also this commit:
18757cab04
* Revert "setSessionDynamicFlags to prevent ghc9 from crashing"
This reverts commit 4065ac8394.
That change made the "ghcide.cradle.muli" tests fail.
* Simplify logic in hls-hlint-plugin.cabal
* Add comment on OldRealSrcSpan
* Remove source overrides for non-ghc9 builds in cabal.project
* Remove commented out code
Co-authored-by: Pepe Iborra <pepeiborra@me.com>
* Remove resolved question from comment
"This code is only concerned with extracting argument names, so I don't see how multiplicity would be relevant here"
https://github.com/haskell/haskell-language-server/pull/1649#discussion_r642606967
* ghc9: Update to latest version of LSP per
* cabal-ghc901.project: Remove commented out code
* Update the lsp commit hash for stack as well
* Use a version of lsp without haskell/lsp#326
That patch was causing test failures, but the issues
should be fixed for real at some point, so that patch can be incluede
Co-authored-by: Pepe Iborra <pepeiborra@gmail.com>
Co-authored-by: Pepe Iborra <pepeiborra@me.com>
* Unify session loading using implicit-hie
Make Wrapper and Session loader use the same logic to avoid
loading logic divergence.
Cleans up existing usages to use infrastructure in place.
* Add major CLI mode for printing the cradle type
Adds test-case for proving that wrapper and hls report the
same cradle type for a project.
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* added option to always insert pragmas at top of file
* Revert "added option to always insert pragmas at top of file"
This reverts commit 8cebdd5743.
* Pragmas inserted before comments (#1726)
* Code style
* Code style
* Insert pragamas to existing pragma list
* added cpp macro to pragma test for ghc < 810
* Refactor: using file contents to find pragma insertion position
* Update getParsedModule action description
* Code style
Co-authored-by: Javier Neira <atreyu.bbb@gmail.com>
Co-authored-by: Potato Hatsue <1793913507@qq.com>
* Get flags for hlint through user config
* Add test case for hlint flags
* Add documentation for hlint configuration
* Fix build after merging master
* Remove unnecessary functions from hlint plugin
* Add test case that adds hints based on flags
* Fix build after merging master
* Add configHasDiagnostics back in
Co-authored-by: Javier Neira <atreyu.bbb@gmail.com>
* Class plugin
* Splice plugin, extract hlsCommand from hls-test-utils
* Haddock comments plugin
* Update github actions
* Remove invalid import
* Bump up specification version of package description to 2.4
* Fix hls.cabal
* Remove the build of eval plugin's testdata from circle ci
* Limit the parallelism of building test suites in circle ci
Co-authored-by: Pepe Iborra <pepeiborra@gmail.com>
* Extract hls-test-utils
* Use test utils in brittany plugin and stylish haskell plugin
* stack
* Set locale encoding to utf8 in defaultMain
* Remove with-utf8
* Extract a Brittany plugin
* Add the brittany plugin to all the stack descriptors
* Extract tests into a standalone testsuite
* Drop AGPL flag
* Change the default logger to print to stderr
* add hls-brittany-plugin test suite to CI
* Add strict version bounds
These are completely unnecessary, but it's the approach that we seem to be taking
* includes breaking API change: bump ghcide version number
Co-authored-by: Junyoung/Clare Jang <jjc9310@gmail.com>
* Move tactic tests to be standalone
* Cleanup AutoTupleSpec
* Move from tasty to hspec
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Refactor pragmas plugin
* Revert some format changes
* Run pre-commit hook
* Fix and format class test
* Fix and format func-test (code action)
* Update test
* Don't look contents in endOfModuleHeader
* Implement featuresets
* Make Tactics tests run with a full feature set
* Respond to feedback from @wz1000
* Cleanup imports in Types
Co-authored-by: Javier Neira <atreyu.bbb@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Agda splitting machinery
* Expand decls!
* Only very top-level lambda to args
* Preserve top-level args (but it doesnt work very well)
* Preserve existing patterns and matches when agdasplitting
* Add traceFX debug function
* Force a few iterations of splitAgda
* Cleanup imports
* Put wildcard patterns in for unused variables
* Update tests
* Agda-unfold on instance deps
* wildify at the very end of simplifying
* Haddock for top-level functions
* Move case splitting stuff into its own module
* Exactprint comments
* Haddock for casesplit
* Use PatCompat
* Remove HsDumpAst
* Use Pat, not LPat
* More massaging Pats
* Only unXPat on 8.0.8
* Haddock and cleanup -Wall
* Cleanup sus errors
* Fix parse errors in GHC > 8.8
* Update comment around unXPat
* Cleanup ExactPrint to split FunBind matches
* Minor haddock tweak
* Bad suggest, hlint
* I hate hlint with so much passion
Co-authored-by: Pepe Iborra <pepeiborra@gmail.com>
* WIP integrate haskell-lsp-1.0.0.0
some progress
Mostly everything except LanguageServer.hs
make it compile
make it work
fix benchmarks
update
tweaks
fix configuration and tests
simplify handlers
Update to renamed lsp/lsp-types modules
redo plugin api and get library to compile
fill in some missing details
fix main
fix rebase
* handle executeCommand and codeaction compat
* switch back to text
* make ghcide tests compile
* non-formatting plugins
* simplify plugin api
* port default plugins
* fix hls tests
* review comments
* more fixes
* more fixes
* Fix more tests
* cleanup
* fix cabal.project
* restore telemetry
* don't wait for progress response
* warnings and hlint
* rebase fixes
* rebase fixes
* more warnings
* hlint
* warnings
* more warnings
* fix benchmarks
* lsp from hackage
* more stack
* more stack
* more stack
* more stack
* more stack
* more stack
* more stack
* More tests of overlapping methods
* Do a simplification pass of the extract
* Do less work when simplifiying
* Remove unnecessary parens simplification
* Implement simplify as a fold over endos
* Fix tests
* Haddock for the new module
* Minor note on implementation
* Note a TODO
* Use PatCompat to unpack patterns
* Pull out codegen utilities to break a cyclic dependency
* Re-export utils
* No top-level parens for tactics
* Try a different strategy for generalizing PatCompat
* Could this be the answer we've all been waiting for?
* Try, try again to compat
* Reorganize imports
* Fix test
Co-authored-by: Javier Neira <atreyu.bbb@gmail.com>
* More tests of overlapping methods
* Do a simplification pass of the extract
* Do less work when simplifiying
* Remove unnecessary parens simplification
* Implement simplify as a fold over endos
* Fix tests
* Haddock for the new module
* Minor note on implementation
* Note a TODO
* Use PatCompat to unpack patterns
* Pull out codegen utilities to break a cyclic dependency
* Re-export utils
* Try a different strategy for generalizing PatCompat
* Try, try again to compat
* Could this be the answer we've all been waiting for?
* Add name to HyInfo
* Use a newtype for Hypotheses
* Use a set for tracking names in scope
* Remove the internal Map OccName representation of Hypothesis
* Remove most spurious uses of hyByName
* Stop looking up things by name in hyByName; use hi directly
* Cleanup imports
* Add test for invoking methods at different types
* Improve generated names for tyvar applications
* Minor formatting and haddocks
* Minor styling
* Fix test
On serving initialize request, deserializing HIE configuration embedded
in InitializeParam passed by client will result in an error if during
process the server cannot find HIE specific configuration key under
initializationOptions.
This commit changes the initializationOptions deserialization to return
the default configuration if configuration key cannot be found under
initializationOptions. Here, setting the key with a value of null will
also be considered as part of not found condition to accommodate clients
that fills missing user options as null.
* WIP: Comment parsing using module annotations
* Line Comment parsers (wip)
* Line comment implemented (block comment not implemented)
* Completely switches to Megaparsec
* T27 must be fixed
* We can always assume that comment starts with "--" with no space prepended
* must be horizontal space, not ANY whitespace
* Block parser (WIP)
* We don't need whole range; position suffices
* Brutal parsing for block haddock comments
* Brutal line parsing
* unset Opt_Haddock
* Wrong debug messages
* Redundant debug output
* Hacks for indentation levels and LHS
* Updates block comment logic in Literate Haskell
* Updates doctests
* Allows doctest without newline at the end
* Precise handling of line ending
* Corrects last-line block eval handling
* Makes normal line parsing LHS sensitive
* Removes outdated note on block comments in a single line
* Wait a moment before executing each code lenses
* Sorting tests in order
* Sorts lenses in order
* Reverted to use executCmd
* Changes sorting logic
* Fixes test case: trailing space
* Dummy commit to re-invoke CI
* expect fail CPP Eval on Windows
* Corrects typo
* Test for #1258
* Corrects test header
* Ad-hoc treatment for ending brace in nested comment block
* `goldenTest` function from Eval plugin doesn't support multiple tests in the same block but in separate group
* Dummy commit to rerun CI
* Stop using CPP and use `knownBrokenForGhcVersions` and `knownBrokenOnWindows`
* Nested `expectedFailure` didn't work as expected
* Abolishes `Parser` type synonym
* Removes unneccesary comment evals
* Skip failed curentRange resolution
Co-authored-by: Junyoung/Clare Jang <jjc9310@gmail.com>
* Integrate hiedb
1. Add 'indexHieFile' and rule 'GetModIfaceFromDiskAndIndex' to maintain
database integrity
- 'writeHieFile' -> 'writeAndIndexHieFile'
2. References fromm database
3. Use db for go to definition
- Return multiple definitions for things defined in boot files
- More robust definitions for multi-component
4. Add persistent stale rules to answer queries immedidately on startup
- Setup `unsafeGlobalDynFlags` on startup
5. Add hiedb command line to ghcide and hls
Co-authored-by: Pepe Iborra <pepeiborra@me.com>
Co-authored-by: Peter Wicks Stringfield <peterwicksstringfield@gmail.com>
* Update ghcide/bench/lib/Experiments.hs
Co-authored-by: Pepe Iborra <pepeiborra@me.com>
* Clear deleted files from hiedb
* make garbage collection async
* bump hiedb
Co-authored-by: Pepe Iborra <pepeiborra@me.com>
Co-authored-by: Peter Wicks Stringfield <peterwicksstringfield@gmail.com>
* Enforce max completions across HLS plugins
* Fix pragma completions to prefilter
* Fix a completion test
* Add a test
* Fix another inaccurate test
* rename n to limit
* Evaluate completion providers in parallel
* Evaluate all HLS providers concurrently
* Slacken some flaky tests
The properties tested were previously unnecessarily strong and would break witht the addition of irrelevant code actions. We now don't care about position and total quantity of code actions, only that the ones we care about exist.
* Add code action for disabling a warning
* Fix test
* Remove redundant import
* Fix imports
* Fix more tests
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fixes#1187.
Separate the list of pragmas used for completion from the list of pragmas used
to suggest enabling a language extension to fix an error. The former now include
the `No-` variants of the language extensions, e.g., `NoDuplicateRecordFields`.
* Fix duplicating existed comments
* Factorize and do the same to genForRecord
* Remove unused pragmas
* Remove unused identifiers
* Fix code action positions in tests
* Use new rule: GetAnnotatedParsedSource
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* 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>