Commit Graph

326 Commits

Author SHA1 Message Date
Jan Hrček
3b24251536 Cleanup CI configs and cabal files 2024-06-20 09:03:31 +01:00
Michael Peyton Jones
e217112604 Fix loss of 9.2 GHC version 2024-06-20 09:03:31 +01:00
Michael Peyton Jones
71aa2d38e0
Bump to new lsp versions (#4279) 2024-06-06 13:19:32 +00:00
soulomoon
838a51f761
Refactor hls-test-util and reduce getCurrentDirectory after initilization (#4231)
What's done
* [x] Refactor the `runSession*` family function, properly add `TestConfig`, `runSessionWithTestConfig`, as the most generic `runSession*` function.
* [x] remove raraly used variants of `runSession*` functions and replaced by `runSessionWithTestConfig`. 
* [x] migrate `ExceptionTests ClientSettingsTests CodeLensTests CPPTests CradleTests` to use the `hls-test-utils`
* [x] Only shift to lsp root when current root is different from the lsp root in DefaultMain of ghcide. 
* [x] Remove most usage for `getCurrentDirectory`(After DefaultMain is called), Only remain those in top level of wrapper and exe, implement https://github.com/haskell/haskell-language-server/issues/3736#issuecomment-1924507928
* [x] add Note [Root Directory]

Co-authored-by: fendor <fendor@users.noreply.github.com>
2024-05-27 14:03:43 +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
soulomoon
61fd5c4648
[Migrate diagnosticTests] part of #4173 Migrate ghcide tests to hls test utils (#4207)
* [x] migrate diagnosticTests, figure out how to pass `--test-no-kick`. 
* [x] migrate openCloseTests
* [x] Lift a few functions from ghcide-test-utils to hls-test-utils
* [x] fixed `deeply nested cyclic module dependency`
* [x] modify `runSessionWithServer'` and ghcIde arguments to admit additional a switch for `no-kick`.

---------

Co-authored-by: fendor <fendor@users.noreply.github.com>
2024-05-13 02:18:51 +00: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
Jan Hrcek
1dd54a5049
Fix references to old CPP names in tests, update tests (#4159) 2024-04-06 19:20:22 +02:00
fendor
16912ccebd
Add cabal-gild as a cabal file formatter plugin (#4101)
* Add cabal-gild as a cabal file formatter plugin

* Add support for multiple cabal formatters

In addition, allow different cabal file formatter provider to specify an
explicit file path, instead of searching only on $PATH.

* Fix cabal formatter test flags
2024-03-11 17:23:29 +00:00
Jan Hrcek
a2a9991158
Enable floskell and hlint plugins for ghc 9.8 (#4125)
* Enable floskell and hlint plugins for ghc 9.8

* Update golden extension schema

* Renererate default-config.golden.json
2024-03-09 21:21:51 +00:00
Jan Hrcek
50923e5c79
Remove more workarounds for GHCs < 9.0 (#4092)
* Remove more workarounds for GHCs < 9.0

* String, not [String]

* Remove GHC810 and GHC90 enum constants

* Fix logic mistake in windows tests

* Inline thDollarIdx

* Troubleshoot wrapper-test

* Troubleshoot

* Try free disk space action

* Run free-space in individual test jobs

* Only run the disk cleanup on ubuntu

* Revert troubleshooting code

* Revert free-disk-space workaround

* Reintroduce workaround

* Revert "Reintroduce workaround"

This reverts commit ec6e8da8c44d0130f0c23aac75df5e461c8f88e2.

* Don't install stack in tests?

* Revert "Don't install stack in tests?"

This reverts commit f53e9932f60eb6789ddef12f370ef81acf65fc58.

* Make the test use ghcup-managed stack

* More maintainable version of stack test
2024-02-27 15:52:07 +00:00
soulomoon
d99d919c9e
semantic tokens: add infix operator (#4030)
* add infix operator

* add test

* mark all infix operator to have operator semantic type

* update scheme

* fix test

* fix more test
2024-02-03 11:01:50 +00:00
Michael Peyton Jones
975db494a2
Use GHC2021 (#4033)
Co-authored-by: Jan Hrček <honza.hrk@gmail.com>
2024-02-02 12:10:51 +00:00
soulomoon
8dfcaf80b3
Semantic tokens: add module name support and improve performance and accuracy by traversing the hieAst along with source code (#3958)
fix https://github.com/haskell/haskell-language-server/issues/3957

Things have been done:
1. Switch `Name` to `Identifier` in the implementation and add `ModuleName` to the `HsSemanticTokenType`
2. Strip ``` ` ` ``` and `()`, and split out qualified names. e.g.``` `Preclude.length` ``` to ```Preclude.```  `length`
3. add tokenizer to walk ast with the souce rope to get more accurate result and faster. Should fix https://github.com/haskell/haskell-language-server/issues/3983.
4. add type sig to semanticConfig's TH result
2024-01-29 17:34:50 +00:00
wz1000
b5a806335c
Exactprint plugins for 9.8 (#3973)
* Exactprint plugins for 9.8

* Fix last test

* comments

* fix borked cpp

* Don't use CPP in refactor plugin tests

* Fix -Wall, -Wunused-packages and hlint warnings in call-hierarchy plugin (#3979)

* Fix -Wall and -Wunused-packages in call-hierarchy plugin

* Make tests more uniform

* accept func test differences

* Run tests for 9.8 plugins in CI

* Fix another test

---------

Co-authored-by: Jan Hrcek <2716069+jhrcek@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-01-18 15:37:56 +00:00
fendor
0d9fd2325a
Document cabal diagnostic options (#3971)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2024-01-17 17:21:10 +00:00
Fendor
f6b92bc317 Update config files for new fourmolu option 2024-01-16 12:24:16 +01:00
Patrick Wales
1c62ba32d4
add config for semantic-tokens-plugin for mapping from hs token type to LSP default token type (#3940)
* add config for semantic tokens for mapping between hs token type to LSP default token type

* fix Missing features header

* Delete plugins/hls-semantic-tokens-plugin/test/testdata/TDatatype.hs

* Delete plugins/hls-semantic-tokens-plugin/test/testdata/TDatafamily.hs

* Delete plugins/hls-semantic-tokens-plugin/test/testdata/TPatternsyn.hs

* update doc

* fix ghc96 schema generation

* remove typedata and add ghc98 scheme generation test file

* Ajust case in mappings

* add ghc92 generate scheme

* add ghc94 generate scheme

* cleanup

* modify the lspTokenReverseMap to take semantic config

* rename fromLspTokenType to lspTokenTypeHsTokenType

* add description for semantic tokens mappings config

* fix doc and cleanup

* delete content for /test/testdata/schema for now, since we are modifying the configuration

* semantic config keys use lower case in the first element

* add config generation scheme test

* fix config generation scheme test

* ajust names for semantic tokens

* add token suffix to token type configuration

* cleanup

* fix merge
2024-01-14 19:23:03 +00:00
Fendor
4b01eb0149 Fix vscode config generation 2024-01-10 10:02:12 +01: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
fendor
93b6bf582e
Add golden tests for public configs (#3922)
Changes to the vscode schema need to be communicated to vscode-haskell plugin maintainers,
otherwise users can't make use of the new configurations.

In general, changes to the schema need to be done consciously when new plugin or features are added.
We add these golden tests as an additional contract to inform relevant
parties whenever the configs change.

To fix a failing of these tests, review the change. If it is expected, accept the change via:

    TASTY_PATTERN="generate schema" cabal test func-test --test-options=--accept

As changes need to be applied for all GHC version specific configs, you either need to run this command for each
GHC version that is affected by the config change, or manually add the change to all other golden config files.
Likely, the easiest way is to run CI and apply the generated diffs manually.

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2024-01-04 18:42:29 +00:00
Nathan Maxson
e5f693195d
Improve no plugin messages (#3864) 2024-01-04 12:03:55 +03:00
Michael Peyton Jones
2b49d9dd7f
Give plugins descriptions, include versions of key dependencies (#3903)
* Plugins have descriptions

* Plugins based on external tools report the version they are built with

* Sort plugins
2023-12-17 21:33:27 +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
fendor
168976d6f5
Cleanup func-test suite (#3828)
* Cleanup func-test suite

This test-suite is vastly legacy from Haskell IDE Engine.
It was originally written before we had a plugin-based architecture
where each plugin tests its feature in isolation.
Over time, this test-suite bitrotted, where a lot of testcases were
either redundant or out-of-date and consequentially disabled.

We clean up the test-suite, delete old tests and remove unused testdata.

* Remove unused config change

* Move qualified import tests to hls-refactor-plugin

* Add README for `func-test`

Provides guidance when to add a test to `func-test` and some historical
context.

* Add fendor as CODEOWNER for `func-test` and `hls-test-utils`

---------

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2023-10-09 13:04:34 +00:00
Fendor
801e365e3b Remove ignored hie-bios integration test 2023-09-20 14:09:24 +02:00
Fendor
2d506c492d Fix hie-bios functional tests 2023-09-20 14:09:20 +02:00
Fendor
9adea757af Force add hie.yaml test setups 2023-08-31 21:06:00 +02:00
Jana Chadt
7f7a9b978a Add test-case for error message 2023-08-31 21:06:00 +02:00
Michael Peyton Jones
861aba7bc5
Drop support for GHC 8.10 (#3434)
* Drop support for 8.10

* Fixes

* Try to fix wrapper test

* Try to fix wrapper test

* Fix
2023-08-31 09:36:18 +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
Elodie Lander
8c22b84f89
Fix other file goto definition (#3725)
* Add gotoDefinition other file tests

* Use correct position mapping in getDefinition
2023-07-21 15:23:43 +00:00
Nathan Maxson
c501f386b5
Resolve refactoring (#3688) 2023-07-17 17:43:39 +00:00
Nathan Maxson
e9c81e4884
Fixes pragma plugin offering incorrect code actions #3673 (#3674)
* Fixes pragma plugin offering incorrect code actions #3673

* Make typecheck and parser sources a constant
2023-06-28 19:36:12 +00:00
Michael Peyton Jones
53604eb494
Add arguments to direct logs to various locations (#3665)
* Add arguments to direct logs to various locations

This adds arguments to HLS to allow the user to select whether to send
logs to any or all of:
- a file
- stderr
- the client

Importantly, we can toggle off the default stderr logging, so the vscode
extension can turn it off to avoid the double logging that arises from
logging to both the client and stderr.

I've set the default to _not_ log to the client. This is a change of
behaviour (today we log to the client by default), but I think it gives
the best experience by default, since most clients do show stderr output
somewhere, and then we probably want to make a case-by-case decision on
whether to use the client logging instead.

* Remove weird test

* Fix warning
2023-06-23 21:45:59 +00:00
Nathan Maxson
a918c02a61
HLS for the new generated LSP 2 release (#3621) 2023-06-19 08:49:38 +03: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
Pepe Iborra
2b691b65cb
Add Inline code action to Retrie plugin (#3444) 2023-01-29 16:31:24 +01:00
Kyriakos Papachrysanthou
d621fc4b14
Add qualified imports in postfix position when ImportQualifiedPost and WarnPrePositiveQualifiedModule are set (#3399)
* Import qualified in postfix when applicable

* Dont import `EnumSet`

* Add `QualifiedImportStyle`

* Add qualified import test

* Ignore functional code action tests for windows-9.4.2

The test fails with:

test\functional\FunctionalCodeAction.hs:116:
expected: "Not in scope: \8216Control.when\8217\nNo module named \8216Control\8217 is imported."
but got: "Variable not in scope: when :: Bool -> IO () -> IO ()"

Seems like diagnostics for missing variables differ

* Add `importQualifiedPostTests`

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-12-27 23:41:23 +00:00
Rebecca Turner
686fa1aa0e
Update refactor/splice/hlint/fourmolu/retrie/gadt plugin for GHC 9.4 (#3317)
* Set buildable on GHC 9.4

* Start work on GHC 9.4 compat

* Use patched `retrie`

* update retrie with github address. circumvent nix-prefetch-url.

* handle ExactPrint

* fix ghc 9.0 env.

* unwrap big CPP conditional for GHC 9.4

* GHC 9.4 buildable by disabling a few suggest.. functions

* enable disabled suggest...!

* hls-fourmolu-plugin is buildable

* hls-splice-plugin is buildable

* hls-hlint-plugin is buildable

* Enable plugins on GHC 9.4

* Add fourmolu for GHC 9.4

* fourmolu tweawk

* Fix `hls-hlint-plugin` build

- Build against GHC 9.4 API
- Increase upper bound on `hlint`

* Fix build of `hls-splice-plugin`

* annotation on close parenthesis. still need more work.

* found where closing parenthesis were missing

* examine internal annotation information.

* make use of makeDeltaAst. This fixes most of test failures in GHC 9.4

* remove dead code

* update apply-refact and hlint deps

* temporarily comment out hls-fourmolu-plugin.

* comment out build-tool-depends. then hls-fourmolu-plugin build succeeds with cabal v2-build

* remove unused fourmolu flake inputs

* fix ghc 9.0 build again.

* hlint and fourmolu for GHC 9.2!

* fix mistakenly overriden nix exp.

* remove unused hlint-3.3.6

* Fix CPP in hls-refactor-plugin

* Fix build error in hls-refactor-plugin

* Fix import

* Use `showErrors` instead of `showBag`

* fix initialization test error in refactor plugin.

* alternateNumberFormat and explicitFixity don't build on GHC 9.4

* force demoteIfDefer = id in typecheckModule for GHC 9.4.

* ignore tests which were already ignored with GHC 9.2

* fix extractDoesNotExportModuleName for GHC 9.4 by adjusting regex match

* use makeDeltaAst in removeRedundantConstraints

* fix addTypeAnnotationsToLiteralsTest

* Revert "alternateNumberFormat and explicitFixity don't build on GHC 9.4"

This reverts commit 4903092780031fb400b28f1e9ce696f1057855d8.

* Update flake lockfile

* Use upstream `retrie`

* Use upstream `retrie`

* Update lockfile

* Use upstream fourmolu

* fix arrow annotation on ghc 9.4

* fix flake.nix issue

* revert demoteIfDefer change for GHC 9.4.

* fix hls-splice-plugin build on GHC 9.0.2

* disable tracy on darwin.

* disable fourmolu plugin and ekg-json for now.

* fourmolu update to 0.10.1.0

* build fix for hls-refactor-plugin after merge

* update index-state.

* downgrade fourmolu to 0.9 for ghc 9.2 and 9.0

* remove unnecessary problematic Cabal-syntax dependency.

* update Cabal for ormolu in ghc 9.0 nix env.

* use custom apply-refact for now for both ghc 9.2 and 9.4

* added ghc >= 9.2 condition

* fix fourmolu with -f-fixity-th in nix env

* limit implicit-hie < 0.1.3

* add fourmolu back to build-tools-depends

* mark GHC92-failing tests to be failed on GHC 9.4

* ci failure test

* bump nix file.

* disable cachix action

* further comment out

* revive cachix action.

* remove commented-out

* fix hls-cabal-plugin by removing Cabal-syntax.
note that this is an opposite to #3383, to prioritize CI fix first.

* limit implicit-hie < 0.1.3

* added a small comment and link to the issue.

* put implicit-hie to ghcide dep

* update apply-refact rev

* use apply-refact-0.11.0.0 on hackage.

* 9.4 support for gadt and retrie plugins

Co-authored-by: Ian-Woo Kim <ianwookim@gmail.com>
Co-authored-by: Gabriella Gonzalez <gabriella@mercury.com>
Co-authored-by: Zubin Duggal <zubin.duggal@gmail.com>
2022-12-21 12:32:31 +00:00
Zubin Duggal
aba2644706 Fixes 2022-12-19 16:57:51 +05:30
Pepe Iborra
6f5a73507f
Support optional plugins (#3193)
* Support initial generic config for plugins

This enables opt-in  plugins, i.e. plugins that are not enabled by default

* Support initial generic config for plugins

This enables opt-in  plugins, i.e. plugins that are not enabled by default

* Address review comments and remove optionality in configInitialGenericConfig

I can't remember why this was optional in the first place, which probably means no good reason for it to be

* use defConfig instead of def

* test

* descriptor is the golden source for plugin default configs

Read plugin defaults from plugin descriptor instead of copying into initial config

This is less fragile as now the initial generic config specified in the plugin
descriptor is enforced by construction.

The downside is that now the descriptor is needed to parse the config, which
means a few places where a plugin id was enough now require a plugin descriptor,
which is much harder to get. We paper over this by moving these call sites to
the Action monad.

* redundant import

* simplify

* Build fixes

* Build fixes

* pedantic fixes
2022-12-11 21:11:34 +01:00
Berk Özkütük
5d5f7e42d4
Make redundant import removal work on PatSyn imports (#3377)
* Make redundant import removal work on patsyn imports

* Make stylish-haskell happy

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2022-12-02 16:46:44 +00:00
fendor
000a76cb95
Delete dead code in hls-test-utils (#3368)
* Remove dead and obsolete code

* Organise export list with respect to utility functions

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-12-02 11:47:48 +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
Michael Peyton Jones
388fd40ade
Purge GHC 8.8 (#3287)
We're also dropping support for this.
2022-10-18 22:12:53 +01:00
Andy
86e3fd6c65
Cleanup GHC macros (because min version is 8.8.4) (#3281)
* 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
2022-10-11 22:35:18 +00:00
Colten Webb
cdbef3e5cb
Feat: basic record dot completions (#3080)
* 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
2022-09-26 16:30:29 +01:00