Commit Graph

194 Commits

Author SHA1 Message Date
Jan Hrcek
c11f32b62a
Bump stack configs + CI to 9.6.5 and 9.8.2 (#4316) 2024-06-12 19:37:52 +02:00
Michael Peyton Jones
71aa2d38e0
Bump to new lsp versions (#4279) 2024-06-06 13:19:32 +00:00
Michael Peyton Jones
0651c5c904
Another attempt at using the lsp API for some progress reporting (#4218)
* Another attempt at using the lsp API for some progress reporting

* Fixing tests

* Remove trace

* Make splice plugin tests not depend on progress

* More test fixing

* Switch to hackage

* stack

* warnings

* more

* Put tests back

---------

Co-authored-by: Patrick <fwy996602672@gmail.com>
2024-05-19 16:06:38 +01:00
Jan Hrcek
a339277ba1
Upgrade to latest lsp / lsp-types / lsp-test (#4166) 2024-04-30 19:33:24 +02:00
fendor
a6f0008956
Allow users to specify whether to use cabal's multi-repl feature (#4179)
We add an option to `Config` that allows clients to specify how HLS
should load components.

We support two loading strategies:

* SessionLoadSingleComponent: Always load only a single component
    when a new component is discovered.
* SessionLoadMultipleComponents: Always allow the cradle to load
    multiple components at once. This might not be always possible,
    e.g., if the tool doesn't support multiple components loading.
    The cradle decides how to handle these situations.

By default, we use the conservative `SessionLoadSingleComponent` mode.

Additionally, changing the config at run-time leads to a reload of the
GHC session, allowing users to switch between the modes without
restarting the full server.
2024-04-23 13:53:06 +00:00
Michael Peyton Jones
949f3b8d0f
Remove ghcide-test-utils as a separate package (#4032)
* Actually build everything

* Remove ghcide-test-utils as standalone package
2024-02-26 10:49:41 +00:00
Jan Hrček
e93528bae7 Bump to hiedb 0.6.0.0 2024-02-16 12:07:26 +05:30
Jan Hrcek
b115dc34f4
stack CI: switch to offic. haskell images, bump to lts-22.9 (ghc 9.6.4) (#4060)
* Bump to ghc 9.6.4 based lts-22.9

* Try more recent haskell image

* Fool around

* Cleanup and rename back to nightly

---------

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2024-02-09 09:38:13 +00:00
Michael Peyton Jones
0b0eee328f
Bump lsp versions (#4052)
* Bump lsp versions

Broadly:
- A few places where we need to pipe `ProgressToken`s around.
   - I also just removed the progress reporting from resolve commands,
     since it's going to often be costly to do progress reporting on
     something that short. Possibly we could revisit after https://github.com/haskell/lsp/issues/549
- Some changes to the registration options we infer
- A few places where we need to adapt to ignoring registrations or not
- Adapting to use the ghcide verison of `getCompletionPrefix` everywhere
- Adapting to use the new mixed rope format

* stack

* More fixes
2024-02-08 17:32:10 +00:00
Michael Peyton Jones
06ec06ce58
Merge plugins into the HLS package (#3976)
* Reorganize flags

* hls-alternate-number-format-plugin

* hls-cabal-fmt-plugin

* cabal plugin

* Class plugin

* Call hierarchy plugin

* Eval plugin

* Explicit imports plugin

* Rename plugin

* Retrie plugin

* Hlint plugin

* stan plugin

* Module name plugin

* pragmas plugin

* Splice plugin

* Qualify imported names plugin

* code range plugin

* change type signature plugin

* gadt plugin

* explicit fixity plugin

* explicit record fields plugin

* Overloaded record dot plugin

* Floskell plugin

* fourmolu plugin

* ormolu plugin

* Stylish-haskell plugin

* refactor plugin

* semantic tokesn

* fixup worklows

* Rogue cabal fmt plugin cabal file

* Fix pedantic build

* fix extra-source-files globs

* Fix test name

* Remove pointless version constraints

* Try to just exclude windows+9.2

* More

* More

* More

* more
2024-01-29 09:15:34 +00:00
Zubin Duggal
4ae63f0576 Bump to hiedb 0.5.0.1 incorporating a bug fix to the Read Symbol instance. 2024-01-13 18:55:29 +05:30
Zubin Duggal
1f00735304 Bump to hiedb 0.5.0.0 to fix #3542 2024-01-13 18:55:29 +05:30
0rphee
034b33ebd5
Use stan config files for stan plugin (#3904) (#3914)
* Bump stan

Needed in order to get the functions for getting the config, etc.

* Use stan config files for stan plugin (#3904)

* Add test case for .stan.toml configuration

* Fix windows tests

See https://github.com/kowainik/stan/issues/531

---------

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2024-01-11 08:53:11 +00:00
Peter Becich
92d3ba9816
update Floskell to 0.11.* (#3933)
* update Floskell to 0.11.*

Floskell 0.11.* supports Aeson 2.2.*

* package version 2.5.0.0, Stack Floskell dependency, codeowner

* update GHC 9.4 Stack resolver

https://www.stackage.org/lts-21.25

remove duplicate `extra-deps`
2024-01-06 22:02:27 +00:00
Patrick Wales
37925a03b4
Implement semantic tokens plugin to support semantic highlighting(textDocument/semanticTokens/full) (#3892)
* Implement semantic tokens lsp plugin draft

* SemanticTokens: combine information extracted from HieAst

* clean up

* map to default token types in lsp

* use lsp makeSemanticTokens to convert to lsp SemanticTokens type

* add test and cleanup

* refine semantic type to default one in lsp

* Use tokens from hieAst instead of renamedSource and add test

* use customize RefMap to get semantic type

* use refMap from useAsts

* Also compute imported names

* Also compute semantic type from TyThing

* Fix dependencies version

* fix version

* Retrieve nameSet from renamedSource to prevent names not visible(Such as by instance deriving) being handled

* add hlint config to ignore test data

* cean up test data

* revert flake.nix

* Rename query.hs to Query.hs

* Build: add semantic tokens to lts21

* Refactor and add README

* Semantic token, filter names in Ast

* CI: add consistancy check for wether semantic tokens computations is stable across different ghc versions

* Update documentation, cleanup test, remove default modifiers

* Fix: IO now classfied to TTypcon, add test for GADT and data family, Update documentation

* Restore stack.yaml

* fix stack build

* Refactor, move out ActualToken to Mappings and use ide logger

* Refactor: toLspTokenType should return Maybe type

* Stop use stale hieAst

* add getImportedNameSemanticRule rule to semantic tokens plugin

* do not retrieve hie in getImportedNameSemanticRule

* fix: add description for semantic tokens

* remove TValBind and TPaternBind and Use TFunction and TVariable instead

* cleanup

* Refactor useWithStaleMT and took care of the token range using position map

* fix build for 9.4

* refactor, use golden test

* refactor, use ExceptT for computeSemanticTokens

* Fix 9.2

* add persistentSemanticMapRule to prevent semantic tokens block on startup

* Fix, use hieKind instead of cast the type directly

* add options to turn semantic tokens on and off

* Disable stan plugin by default (#3917)

* Fix positionMapping in stale data (#3920)

* Fix positionMapping in stale data

* add test for updatePositionMapping

* add comment to demonstrate addOldDelta

* cleanup

* fix: for local variable, extract type from contextInfo instead of bind site, thus function in pattern binds can also be indentified

* clean up

* Update plugins/hls-semantic-tokens-plugin/src/Ide/Plugin/SemanticTokens/Query.hs

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>

* refactor: remove TNothing and compact the test output

* refactor: rename SemanticTokenType to HsSemanticTokenType to avoid confusion with lsp' SemanticTokenTypes

* refactor: push the computation of semantic token type to getSemanticTokensRule

* update documentation

* cleanup hieAstSpanNames

* remove renamed source from getSemanticTokensRule and optimize query function for semantic token type

* try to exclude names that is not visible in hie and cleanup

* add HieFunMaskKind, it is to differ wether a type at type index is a function or non-function

* expose function flag to expose (=>, ->, -=>, ==>)

* 1. Relax GetDocMap kindMap to get TyThing for more than type variables.
2. Backport isVisibleFunArg

* use customize logger, add test for unicode

* fix: handle unicode in semantic tokens

* update KindMap to TyThingMap

* cleanup

* add realSrcSpanToCodePointRange, realSrcLocToCodePointPosition to Development.IDE.GHC.Error

* add Note [Semantic information from Multiple Sources]

* move recoverFunMaskArray to Mappings.hs

* fix test, data.Set might not appear

* fix: handle semantic tokens with more than one ast

* fix: instance PluginMethod Request Method_TextDocumentSemanticTokensFull

* clean up

* turn semantic tokens off by default

* fix doc

* clean up doc

---------

Co-authored-by: fendor <fendor@users.noreply.github.com>
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2024-01-06 13:09:19 +00:00
Michael Peyton Jones
bcb83e9744
Remove some buildability blockers that aren't needed (#3899)
* Floskell buildable on 9.6

* Ormolu supports 9.8

* Fourmolu supports 9.8

* Fix some conditional logic

* Fix stack

* Fix a cabal file

* more fix stack

* More

* Grumble spelling

* More stack

* Argh

* Bump index-state, remove some allow-newers

* boo

* More

* Redo stack deps entirely
2023-12-13 16:36:00 +00:00
wz1000
7db6215c6d
Add support for multi unit argument syntax (#3462)
* Add support for the multi unit argument syntax introduced in GHC 9.4: https://downloads.haskell.org/ghc/9.4.4/docs/users_guide/using.html#multiple-home-units

We now support arguments of the form
```
-unit @unitA -unit @unitB
```

where the response files `unitA` and `unitB` contain the actual list of arguments for that unit:

```
-this-unit-id a-0.1.0.0
-i
-isrc
A1
A2
```

Also refactor the session loader and simplify it.

Also adds error messages on GHC 9.4 if the units are not closed (#3422).

fixes

Fix closure check

session-loader: override old units with new in multi-unit support

Remove implicit-hie

session-loader: remember which files caused old components to be loaded, and
also pass them on to hie-bios so it can in turn pass them to `cabal repl` when
loading newer components.

This allows us to create valid set of build flags encompassing both the old and
new components, and the closure of all components in between.

The observation is that if you want to load some components X, Y, Z and so on,
cabal repl X Y Z ... will be more likely to give you a valid multi component
build plan/flags than cabal repl all, or any way of combining the results of
cabal repl X, cabal repl Y ...

Use new hie-bios

Move implicit cradles to HLS

Fix build on 9.0

Werror

Improve handling of specialTarget

* hie-bios doesn't mention the component name in the message anymore

* stack fixes

* wrapper: remove unused argument

* werror

* werror

* Implicit cradle: match implicit-hie-cradle logic

* Fix eval plugin

* ignore multi unit tests on 9.2

* Some fixes for 9.2

* Add hie.yaml for call-hierarchy-plugin tests

* Add hie.yaml for explicit-record-fields-plugin

* Add hie.yaml for hls-overloaded-record-dot-plugin
2023-11-23 00:08:04 +00:00
0rphee
0ec34f0f60
Merge branch 'master' into re-add-stan 2023-11-18 00:49:32 -06:00
wz1000
1c884ea856
Remove head.hackage (#3867)
* Remove head.hackage

Bump to

- lsp-2.3
- lsp-types-2.1
- hiedb-0.4.4
- hie-bios-12.1 (TODO remove source-repository package in favour of hackage release)
- hie-comat-0.3.1.2

* Bump cabal version for CI

* Add comments for allow-newer

* Fix build on 9.6

* Hopefully fix stack extra-deps

---------

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2023-11-14 09:59:59 +00:00
0rphee
01602a539d Add hls-stan-plugin dependencies to stack.yaml 2023-10-30 21:18:15 -06:00
0rphee
2cb98aa420 Re-add deleted stan files from #3782 2023-10-23 14:43:23 -06:00
Michael Peyton Jones
c0f7d4c40b
Simplify cabal.project (#3836)
- entropy has had bounds revised in
- basement/hw-prim bounds empirically unnecessariy
- hyphenation was for wingman
- bound hlint to a version that uses ghc-lib by default
- stylish-haskell has never had a ghc-lib flag
- none of the versions of fourmolu that we use have a fixity-th flag
- remove some other things that lack justification speculatively
2023-10-12 19:48:49 +01:00
Brandon Chinn
bada83097b
Use latest version of fourmolu possible (#3764)
* Remove fourmolu pin in stack.yaml

* Require fourmolu >= 0.9

* Use specific versions of fourmolu for each version of GHC

---------

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2023-09-06 16:05:24 +01:00
Michael Peyton Jones
bfaecfd03c
Delete hls-haddock-comments-plugin, hls-stan-plugin, and hls-tactics-plugin (#3782)
* Delete hls-haddock-comments-plugin

* Delete hls-stan-plugin

* Delete hls-tactics-plugin

* Fix a warning

* Delete some wingman stuff

* Workflows
2023-08-30 12:17:22 +01:00
Michael Peyton Jones
e4234a3a5e
Adapt to lsp changes for workspace/configuration (#3773)
* Adapt to lsp changes for workspace/configuration

This has a few substantive changes and a lot of messing with tests.

- We now tell `lsp` our config section, and parse just that section.
- We move the logic for updating the shake build rules for client config
  from a `workspace/didChangeConfiguration` handler to the new `lsp`
  callback, which will ensure it gets called in all circumstances that
  can be relevant.

The test changes are more annoying:
- We ignore config and logging messages by default now, so we have to
  stop doing that when we care about it.
- Many tests didn't really need to _change_ the config, but rather just
  to set it once at the beginning. I adjusted a lot of test functions to
  allow passing in the initial config for this reason.

* don't reduce the message timeout for wingman

* Fix stan plugin

* Doh
2023-08-25 14:04:42 +00:00
Nathan Maxson
2aecda97c1
Update to latest lsp packages (#3747)
Co-authored-by: fendor <fendor@users.noreply.github.com>
2023-08-08 06:56:42 +00:00
Lei Zhu
c4a8a8eb06 Remove unnecessary allow-newer 2023-08-07 23:13:00 +02:00
Jana Chadt
e1fa7295ab Implement completions for cabal files
Includes:
* completions for keywords, sensitive to stanzas
* value completions for constant values, files, directories and exposed modules
* completion of snippets for different stanzas and the required basic fields
2023-08-03 12:43:38 +02:00
Nathan Maxson
6111a100ab
Add resolve support in refine imports by merging it with explicit imports (#3729) 2023-08-01 01:03:08 +00:00
Lei Zhu
fb5e5c998c
Update stack stuff (#3706)
* Update stack stuff

* Add allow-newer for lts-21

---------

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2023-07-13 16:08:10 +01:00
Nathan Maxson
a918c02a61
HLS for the new generated LSP 2 release (#3621) 2023-06-19 08:49:38 +03:00
Nathan Maxson
1edb4892a6
overloaded record dot plugin intial version (closes #3350) (#3560)
* overloaded record dot plugin initial version (closes #3350)

* Added support to GHC 9.2, and updated documentation

Also, update the CI to test overloaded-record-dot-plugin
and added overloaded-record-dot-plugin to stack.yml

* Apply suggestions from Lei Zhu (July541)

Co-authored-by: Lei Zhu <julytreee@gmail.com>

* Use GHC2021 and updated gif

* Fix test.yml formatting problem

* use coerce instead of unExt (from michaelpj)

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>

* Implements michaelpj code review suggestions

* Collect records on lists instead of maybe
This way we don't need to switch back and forward between the two,
and we can also return more than one match from inside a HsExpanded

* Added documentation

* Reworded comments for spelling and clarity

* use useWithStale for the TypeCheck rule

* Update version to conform with changes on master

* No longer depend on specific hls package versions

* Fixed comments and line length issues

* Added test for HsExpanded expressions

---------

Co-authored-by: Lei Zhu <julytreee@gmail.com>
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2023-05-26 10:58:17 +00:00
wz1000
191bda61fe
9.6 support for HLS (#3480)
* 9.6 support

Fixes

hls-refactor-plugin 9.6 support

hls-gadt-plugin

Fix 9.4 build

Fixes

hls-gadt-plugin fixes

WIP 9.6 patches

fixes

fixes

fixes

fixes

fixes

Fixes and add CI

CI

CI fixes

patch haskell/actions for https://github.com/haskell/ghcup-hs/issues/783

CI fixes

CI fixes

CI fixes

CI

CI

CI

CI

CI

Fix build on 9.0

Fix build on 9.0

hls-splice-plugin 9.6 compat

fixes

fixes

fixes

fixes

Fix benchmark build errors

9.2.5 and 8.10.7 had build errors when running benchmarks due to `mfsolve`
test suite having duplicate instances, so stop building tests for
mfsolve (see: https://github.com/kuribas/mfsolve/issues/8). Also,
`http2-4.0.0` has a parse error due to a misplaced haddock comment that
causes build failure with `-haddock`. It is fixed in the latest commit
of the source repo, so use that in the `cabal.project` for now.

Checkout correct commit on `pull_request` in CI

By default, the `pull_request` event has a `GITHUB_SHA` env variable set to the
"last merge commit on the GITHUB_REF branch"
(see https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request).
But we want to check out the latest commit on the branch whether or not it is a
merge commit. This commit changes the CI actions to do just that.

fixes

Use head.hackage for 9.4

Only use head.hackage for 9.5 and up

Reverts the change that caused head.hackage to be used for 9.4 as
well

Reintroduce source-repo-package for ekg-json

Fix refactor plugin tests

Fix missing constraint detection in refactor plugin

ghc 9.6+ allow newer unordered-containers:template-haskell

Some refactor tests no longer broken for 9.2

Fix simple-multi-test on 9.6

Mark simple-plugin as broken on 9.6

func-test fixes

Disable unsupported plugins on 9.6

Eval plugin fixes

Eval plugin test fixes, debug output in CI script

Restore 'working' setup/actions

WIP Fix GHC prerelease windows install

Fix eval plugin T11

fixes

Eval plugin fixes

Fix splice plugin test

Mark `simple plugin` ghcide test broken on 9.6

fixes

fixes

Use GHC 9.6-rc1 in CI

Try using 9.6.1 for CI

* 9.6 nix

* Remove head.hackage

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes
2023-03-22 13:56:51 +00:00
Zubin Duggal
b9565a1b5a Use hie-bios 0.12 2023-03-17 19:02:45 +05:30
Michael Peyton Jones
05051866b2
Delete the Brittany plugin (#3441)
It's unmaintained and not popular.

Fixes #3346.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-01-06 13:36:42 +00:00
Rune K. Svendsen
5dbbd852ab
Parse .cabal files; show error and warning diagnostics (#2954)
* Extract cabal plugin in its own package

* hls-cabal-plugin: Add plugin

Add golden parse test for test/testdata/simple.cabal
Add module Ide.Plugin.Cabal.Diag
Also: add -Wall

Add parseCabalFileContents
Use VFS for cabal file contents

Diagnostics
 * Parse and display Errors
 * Parse and display Warnings

Code Actions
 * Code Action for License Field

* Add CI workflow

* Add test-suite for hls-cabal-plugin

* Fix various cabal issues

* Update Codeowners file for hls-cabal-plugin

* Document Bytestring is UTF-8 encoded

Co-authored-by: Julian Ospald <hasufell@posteo.de>

* Remove code duplication

* Add cabal files of interest and kick function

Configure a "kick" function for cabal files that is run when the shake
queue needs to be restarted.
Copy pastes from ghcide and 'files of interest'. Maybe more abstraction
needed.

* Add more documentation

* Mark flaky test-case as flaky with issue ref

* Make fendor the only CODEOWNER for hls-cabal-plugin

* Add missing extra-source-files for hls-cabal-plugin

* Add proper CHANGELOG entry for the first version of hls-cabal-plugin

* Add support for Cabal 3.8

* Set diagnostics source to cabal

* Remove unused function

* Add unit tests for code action utilities

* Remove overly specific logging of diagnostics from hls-cabal-plugin

* Improve logging for Cabal FOIs

* Add Range manipulation functions

* Use Range manipulation functions from hls-plugin-api

* Add more documentation for crucial shake restart function

* Add hls-cabal-plugin features to features.md

* Re-use existing GetFileContents rule

Co-authored-by: Fendor <power.walross@gmail.com>
Co-authored-by: fendor <fendor@users.noreply.github.com>
Co-authored-by: Julian Ospald <hasufell@posteo.de>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-11-21 16:45:26 +00:00
VeryMilkyJoe
7020532537
Add formatting plugin for cabal files which uses cabal-fmt (#2047)
* Add plugin for formatting cabal files using cabal-fmt

* Add 'isolateTests' cabal flag to make plugin install cabal-fmt

For CI, we want to run the tests with a specific cabal-fmt version,
installed automatically by cabal.
However, locally, we might want to test with a locally installed
cabal-fmt version.
This flag allows developers to either let cabal install the
build-tool-depends or install a fitting version locally.

* Ignore failing cabal-fmt test on windows

* Add log message for missing cabal-fmt executable

Co-authored-by: Jana Chadt <jana.chadt@tuwien.ac.at>
Co-authored-by: Fendor <power.walross@gmail.com>
2022-11-11 10:25:29 +00:00
Berk Özkütük
85f7881351
New plugin: Explicit record fields (#3304)
* Initial working version

* Auto-add puns pragma, fix behavior with Hs98 fields

* Patch pragma so it adds NamedFieldPuns instead of RecordPuns

* Refactor big do block

* Make it work with record construction

* Convert to a rule based approach

* Cleanup, remove dead code

* Make it compile with all supported GHC versions

* Add tests

* Minor code reorganization

* Move common pragma logic to same file

* Remove strictness annotations

* Improve documentation

* Use interval map for efficient range filtering

* Add external documentation

* Add tests to GitHub CI

* Add debug log for collected records

* Add `getExtensions` to ghcide

* Indicate that it doesn't work with GHC 9.4

https://github.com/haskell/haskell-language-server/pull/3304#discussion_r1008034647

* Relax version bounds on base

* Add plugin to stack packages

* Add GHC 8.10 support

* Fix GHC 9.4 build failure

* Make `conPatDetails` total

* Revert "Indicate that it doesn't work with GHC 9.4"

This reverts commit 57646d35ad.

* Fix unused import caused by new compat exports

* Fix ConPat construction in GHC 8.10

* Rename test-suite to make it shorter

* Fix nix build by collecting latest hw-prim from Hackage

Co-authored-by: Pepe Iborra <pepeiborra@gmail.com>
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2022-11-10 01:17:50 +00:00
Pepe Iborra
a13e1b3c8d
Clean up heapsize bits (#3168) 2022-09-18 09:03:46 +02:00
Zubin Duggal
816cd6301e Prepare 1.8.0.0
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
2022-09-14 02:27:17 +05:30
Kobayashi
3fb4082f80
Improve performance of NormalizedFilePath (#3067)
* upgrade lsp

* modify default benchmark config

* upgrade lsp

* use lsp master

* temp: compare benchmark with previous commit

* use text in NormalizedFilePath

* upgrade to lsp master

* fix stack config

* remove obsolete dir form ghcide.cabal

* run pre-commit without args

* Revert "run pre-commit without args"

This reverts commit 1c2a11df9d.

* remove unnecessary tests
2022-09-08 19:54:24 +00:00
Zubin Duggal
2e484cd1d4 Move ghcide-test-utils to its own package 2022-08-31 00:56:35 +05:30
Zubin Duggal
a9f1c538ac Remove exactprint dependencies from ghcide by introducing hls-refactor-plugin.
All code actions have been moved to hls-refactor-plugin

Mostly straightforward, only slight complication was that completion auto imports
depends on exactprint, but I didn't want to remove all completion logic from ghcide
just for this.

Instead, I added logic to dynamically lookup the plugin that provides
the extend import command, so that auto imports work as expected when you have
hls-refactor-plugin enabled.

Move lookupPluginId out of loop

Replace code actions with lenses in benchmarks

Allow plugins to use GetAnnotatedParsedSource by linking it in when depended on

Move lookupPluginId to IdePlugins

Add default extensions

Move traceAst
2022-08-31 00:56:35 +05:30
Kobayashi
fe00b3ae37
upgrade ghc-check to fix #3002 (#3034) 2022-08-19 02:24:02 +00:00
Kobayashi
255498147a
upgrade lsp to 1.5 (#3072)
* upgrade lsp to 1.5

* fix stack.yaml

* try fix tests

* disable verbose logging in ghcide

* fix more tests in ghcide

* fix floskell test

* disable debug log in func-test

* disable debug log in lsp itself

* Revert "disable debug log in func-test"

This reverts commit 1fd6658c77.

* remove unused import

* fix hls test utils

* upgrade lsp in nix

* fix func-tests

* Revert "fix func-tests"

This reverts commit 2ecd76d0ba.

* fix waitForDiagnosticsFromSourceWithTimeout

* use Null as dummy message in waitForDiagnosticsFromSourceWithTimeout

* simplify a test case

* add comment about lsp bad logs
2022-08-12 09:09:07 +00:00
Lei Zhu
0e74593e8d
hls-explicit-fixity-plugin (#2941)
* init hls-explicit-fixity-plugin

* Update dependencies

* Refactor: Prevent block on startup

* Run pre-commit

* Compatibility: Add emptyMessages

* Remove unused ModIface

* Comment why to make this plugin a lower priority

* Provide hover content while testing fail

* Avoid lambda

* 4 space indent

* Pass Text instead of Name

Co-authored-by: Pepe Iborra <pepeiborra@gmail.com>
2022-08-11 11:48:18 -04:00
Lei Zhu
df77e7dd2d
Support ghc-9.2.4 (#3085)
* Support ghc-9.2.4

* Restore caching workflow for ghc-9.2.3
2022-08-11 09:54:02 +01:00
Kobayashi
445192e21d
refactor selection range plugin (#3003)
* update Gitpod config

* update nix shellHook & docs

* install pre-commit hook

* add kokobd as code owner to .gitpod.*

* add gen-hie to Gitpod

* add tools for doc

* remove .pre-commit-config.yaml from .gitignore

* set vscode formatter to stylish-haskell in Gitpod

* refactor selection range plugin

* refine selection range

* add CodeKind to CodeRange

* rename hls-selection-range-plugin to hls-code-range-plugin

* update docs about selection range

* cleanup RuleTypes.hs

* add the missing bang pattern

* fix subRange

* add some unit tests to CodeRange.Rules

* add tests for removeInterleaving

* add even more tests

* fix extra sources

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-07-11 04:24:35 +00:00
Lei Zhu
e64b61e7fd
Support ghc-9.2.3 (#2936)
* Support ghc-9.2.3

* ormolu-0.5

* Update stack.yaml

Co-authored-by: Pepe Iborra <pepeiborra@gmail.com>
2022-06-16 15:29:38 +08:00
Lei Zhu
faa88f685e
A plugin for GADT syntax converter (#2899)
* initial hls-gadt-plugin

* Correct condition

* Render context correctly

* Fix typo

* Support from ghc-8.6 to ghc-9.0

* ghc8.6 compat

* Try to fix test for ghc-8.6

* Pretty name

* Add GADTs pragma automatically

* Enrich Readme

* Clean up

* Update hls docs

* Update CODEOWNERS

* Fix typo

* Rename withTempDir with withCanonicalTempDir

* Add @michaelpj's suggestions

* Pass PluginId through descriptor

* Explicit forall
2022-05-26 17:13:09 +08:00