Commit Graph

177 Commits

Author SHA1 Message Date
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
385f0008a4 Use older version of http2 to avoid breakage with -haddock on 8.10 2023-03-17 19:02:45 +05:30
Zubin Duggal
b9565a1b5a Use hie-bios 0.12 2023-03-17 19:02:45 +05:30
Julian Ospald
a73c07c51b
Bump versions and add changelogs for 1.9.1.0 (#3493)
* Bump versions and add changelogs for 1.9.1.0

* Fix build on windows by disabling ghc-check pkg ABI check

---------

Co-authored-by: Zubin Duggal <zubin.duggal@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-02-14 19:48:11 +00:00
fendor
065957ece3
Use apply-refact 0.12.0 (#3469)
* Use apply-refact 0.12.0

* Limit ormolu version to < 0.5.3
2023-02-02 12:40:38 +00:00
Michael Peyton Jones
ddc67b2d4d
Support stylish-haskell and ormolu in 9.4 (#3446)
* Update index-state

* Enable ormolu on 9.4

* Enable stylish-haskell on 9.4

* Update flake.lock

* Declare 9.4 to be fully supported

* Enable floskell for 9.4
2023-01-09 21:08:08 +00:00
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
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
wz1000
6e4612dc42
Gitlab CI improvements (#3324)
* Add ubuntu builds to gitlab CI

Fixes #3169

* Run pipelines from web interface

* Use nix for darwin

* Drop 9.2.3 and add 9.4.3

* Build in parallel

* Add 9.2.5

* fixes

* Fix x86_64-darwin

* Drop 9.4.3 (ghc-exactprint)

* Revert "Drop 9.4.3 (ghc-exactprint)"

This reverts commit 9f0936d5c4.

* Bump index state to allow 9.4.3

* debug

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes

Co-authored-by: Julian Ospald <hasufell@posteo.de>
2022-12-21 10:53:36 +00:00
Pepe Iborra
6f55ccbc33
Add CI flows for 9.4.3 (#3396)
* Add CI for 9.4.3

* exclude in Windows

* Workaround fourmolu 0.9.0.0 build failure in windows
2022-12-14 11:06:18 +01: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
Lei Zhu
8cef7a456a
Support ghc 9.4 for hls-class-plugin (#3258)
* Support ghc 9.4 for hls-class-plugin

* Update support table

* Update test description

* Update nix dependency
2022-10-16 11:56:43 -04:00
Zubin Duggal
276fb623d4 gitlab-ci: workaround centos failure 2022-09-14 02:27:17 +05:30
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
66a719c50a Add comments 2022-09-02 22:52:01 +05:30
Zubin Duggal
079d3f08e7 Use scoped allow-newer 2022-09-02 22:52:01 +05:30
Zubin Duggal
738e4f636d Use scoped allow-newer 2022-09-02 22:52:01 +05:30
Zubin Duggal
34ac6ead36 Fix entropy to 0.4.1.10 to fix build on windows 2022-09-02 22:52:01 +05:30
Zubin Duggal
6c99563a9f 9.4 support + MHU 2022-09-01 14:47:55 +05:30
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
Pepe Iborra
d0e3e0fe3f
HLS benchmarks (#3117)
* 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
2022-08-25 15:08:57 +01:00
Kobayashi
fe00b3ae37
upgrade ghc-check to fix #3002 (#3034) 2022-08-19 02:24:02 +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
Gregory Gerasev
078fc14dda
Stan integration #258 (#2908) 2022-07-28 02:11:31 +03:00
Matthieu Coudron
100b53a474
build(nix): ghc922 -> ghc923 (#3049)
* build(nix): ghc922 -> ghc923

bumped nixpkgs and add support for ghc923 (replacing ghc922)

* fixes

* fixing for ghc90?

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2022-07-20 16:59:54 +00: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
Kobayashi
344323be54
re-enable haddock (#3015)
* re-enable haddock

* fix it for old GHC

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-07-05 03:49:32 +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
George Thomas
0bbc545300 Bump index state
Allows us to use Fourmolu 0.7.
2022-06-12 19:57:45 +01: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
Michael Peyton Jones
b1bf549915
nix update (#2892)
* Drop -haddock as ghc 8.10.7 fails to build ghc-lib with:

```
compiler/GHC/CmmToAsm/AArch64/CodeGen.hs:176:15: error:
2081
Error:     parse error on input {- | debugIsOn -}
2082
    |
2083
176 | ann doc instr {- | debugIsOn -} = ANN doc instr
2084
    |               ^^^^^^^^^^^^^^^^^
```

  # Please enter the commit message for your changes. Lines starting

* flake.lock: Update

Flake lock file updates:

• Updated input 'flake-compat':
    'github:edolstra/flake-compat/b7547d3eed6f32d06102ead8991ec52ab0a4f1a7' (2022-01-03)
  → 'github:edolstra/flake-compat/b4a34015c698c7793d592d66adbab377907a2be8' (2022-04-19)
• Updated input 'flake-utils':
    'github:numtide/flake-utils/997f7efcb746a9c140ce1f13c72263189225f482' (2021-08-20)
  → 'github:numtide/flake-utils/a4b154ebbdc88c8498a5c7b01589addc9e9cb678' (2022-04-11)
• Updated input 'gitignore':
    'github:hercules-ci/gitignore.nix/211907489e9f198594c0eb0ca9256a1949c9d412' (2021-01-26)
  → 'github:hercules-ci/gitignore.nix/bff2832ec341cf30acb3a4d3e2e7f1f7b590116a' (2022-03-05)
• Updated input 'hie-bios':
    'https://hackage.haskell.org/package/hie-bios-0.9.0/hie-bios-0.9.0.tar.gz?narHash=sha256-nd+FfUQVZNxJfKZkAWA3dF0JwRgXntL+1gGvyNHDbKc='
  → 'https://hackage.haskell.org/package/hie-bios-0.9.1/hie-bios-0.9.1.tar.gz?narHash=sha256-5RqspT27rb%2ftMBwrKr4VfSSbq0+c0LMNuaKlTun0Kkk='
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/c473cc8714710179df205b153f4e9fa007107ff9' (2021-12-13)
  → 'github:NixOS/nixpkgs/ab83c5d70528f1edc7080dead3a5dee61797b3ff' (2022-04-24)
• Updated input 'pre-commit-hooks':
    'github:cachix/pre-commit-hooks.nix/397f0713d007250a2c7a745e555fa16c5dc8cadb' (2021-06-29)
  → 'github:cachix/pre-commit-hooks.nix/e5e7b3b542e7f4f96967966a943d7e1c07558042' (2022-04-04)
• Updated input 'pre-commit-hooks/flake-utils':
    'github:numtide/flake-utils/74f7e4319258e287b0f9cb95426c9853b282730b' (2021-11-28)
  → 'github:numtide/flake-utils/3cecb5b042f7f209c56ffd8371b2711a290ec797' (2022-02-07)
• Updated input 'pre-commit-hooks/nixpkgs':
    'github:NixOS/nixpkgs/6f05cfdb1e78d36c0337516df674560e4b51c79b' (2022-01-01)
  → 'github:nixos/nixpkgs/77a7a4197740213879b9a1d2e1788c6c8ade4274' (2022-02-23)

* nix flake update & bump ghc921 -> ghc922
ghc921 is no longer available on Nix, see:
  https://github.com/NixOS/nixpkgs/pull/163426

* myst-parser: bump docutils version requirements

* fix devShells and packages default

* use ghc-exactprint 1.5.0 for ghc922

* ghc902: add flag hlint34 to nix

* macosx: add SSE-enabled ptr-poker dependency

* ghc902 requires ghc-lib-parser >= 9.2

* nix: ghcDefault supports HLS tweaks

* fix typo

* add support for pre-commit in mkDevShell

* fix typo

* add ptr-poker to nix shell

* add ghc-884 configuration tweaks

* fix stylish-haskell for ghc-884

* fix default ghc lookup

* ghc884: fixup brittany version to 0.13.1.2

* ghc884: fixup aeson version to 1.5.2.0

* ghc884: fixup ormolu/fourmolu

* add configuration tweak for ghc8107

* rename configuration-ghc-xxx.nix files

* update hackage index

* use current cabal/hackage to fetch ptr-poker in mkDevShell

* reinstate .pre-commit.yaml

* nix: temporary disable "build binaries" from the work flow

* nix: temporary disable builds and partially populate cachix

* nix: temporarily disable ghc 884 and 8107

* nix: temporarily disable nix develop run

* nix: re-enable ghc8107/ghc884 builds, disable "build all binaries"

* nix: noop push commit to test cachix

* nix: touch flake.nix, remove ghc 884

* nix: rm ghc 810, ghc88 + disableLibraryProfiling

* nix: build all binaries again

* Update flake.nix

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

* Update flake.nix

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

* Update flake.nix

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

* revert change made on comment

* rm myst-parser.nix

* fix typo (thanks @guibou)

* explain why we disable library profiling with nix

* ghc922, disable "hls-hlint-plugin"

Co-authored-by: Pepe Iborra <pepeiborra@gmail.com>
Co-authored-by: Providence Salumu <Providence.Salumu@smunix.com>
Co-authored-by: Providence Salumu <smunix@users.noreply.github.com>
2022-05-13 10:09:51 +01:00
Pepe Iborra
6524122927
Expose runtime metrics via EKG (#2267)
* Collect metrics and expose an EKG server

* register gc metrics locally

* getDatabaseKeys

* fixups

* Abstract monitoring and put EKG behind a Cabal flag

* Add CI for the new flag

* fix double ifdef

* link to GHC docs for eventlogs

* log when stopping the EKG server

* Allow CPP in modules

* Add doc comments

* Apply suggestions from code review

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

* Compat. with ghc 9.2

* use an ekg-json snapshot that preserves compat. with ghc 8.x

* confine CPP to the EKG module

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2022-05-06 09:58:18 +00:00
Pepe Iborra
8cbefb71bc
Consolidate all cabal.project files (#2866) 2022-05-05 15:07:51 +01:00
Pepe Iborra
2bd9ab4e3c
simplify hlint plugin Cabal descriptor (#2867) 2022-05-01 20:17:13 +00:00
fendor
9f034f290c
Upgrade to hie-bios 0.9.1 (#2766) 2022-03-08 13:24:00 +00:00
Nick Suchecki
911fe59d7f
Change Type Signature Plugin (#2660)
* First go

* Match against specific error message.

* Basic Change Type Signature implementation.

This implementation only matches a single GHC Error message:

```
    • Couldn't match type ‘Int’
                     with ‘Data.HashSet.Internal.HashSet Int’
      Expected type: Int -> Int
        Actual type: Data.HashSet.Internal.HashSet Int -> Int
    • In the expression: head . toList
      In an equation for ‘test’: test = head . toList
```

Specifically on `Expected type: ...`, `Actual type:...` and `In an equation ...`.

There are plenty of error messages that match this format but aren't actually valid.

* GHC 9.2.0 compat change

* Lift expectedError message into a separate binding

* Move ChangeTypeAction into it's own plugin

* Add New Error Message parsing.

- Add new regex for matching extra errors message types

- Revamp original regex to match more.

- Add basic test suite.

- Begin adding `tidyActualType` semantics to provide slightly prettier
TyVars

* Added Error Message Validation to ignore bad Messages.

- Add Pretty Printing for Types
- Added a few test scenarios

* Miscellaneous Cleanup.

* Update Tide Type Signature logic.

- Be able to tidy signatures with operators in it
- Use T.words instead of regex matching to split tyVars

* Remove locA (defaults to id in 8.10) to satisfy 9.0+

* Touch up 9.2.1

* Clean up review notes

* Update stack.yamls

* Fix copy-paste error

* Fix Local Signature resolution

* Improve logging (#2558)

* convert to contravariant logging style part 1, uses additional hardcoded log file to see it side by side with original logging

* convert Session to contravariant logging style

* convert Plugin/HLS and FireStore to contravariant logging style

* convert Rules (and most of the universe) to contravariant logging style

* fix tests, allow old style logging and contravariant logging to write to same log file

* fix import inside wrong CPP

* add CPP for LogTactic constructor

* remove redundant import

* fix ghcide tests

* remove unused import

* fix plugin tests

* LSP_TEST_STDERR should apply to contra logger as well

* fix tactic plugin test

* use CPP for Log datatype plugin constructors, remove unused imports

* add a few Pretty instances, add prettyprinter to haskell-language-sever and hls-plugin-api dependencies

* add Pretty Log instances for Session, FileStore, Notifications

* add remaining Pretty Log instances

* add logToPriorities

* fix slight interleaving issue with hslogger and logger both logging, have default logger be mutex stderr or file handle, use stderr if failing to open log file

* forgot to add .cabal files with hslogger dep

* dont use UnliftIO file IO helpers because they are too new

* remove log helper comments, use Doc instead of Text as final console/file logger input, renaming, export Log constructors

* remove accidentally added useless file, removed prettyprinter dep from hls-plugin-api because stack ghc8.6.5 doesnt have it?

* use deprecated prettyprint modules import for the sake of circleci ghc-8.6.5

* use dummy stderr logger for plugin cli commands, use priorityToHsLoggerPriority function instead of manual mapping

* remove old plugin detritus that somehow got committed

* fix prettyprinter imports for 8.6.5

* try enforcing prettyprinter bounds?

* enforcing bound makes no sense

* maybe changing stack yamls does trick

* filter out warnings when their diags are empty to more closely match original

* add ability to select wanted logging columns, match prev ghcide exe logging behaviour

* dont log anything when diags are empty in some defineEarlyCutoff versions

* use non-deprecated prettyprinter imports

* fix ghcide test module

* change logWith to accept priority at call site, remove all logToPriority functions, add cmapWithPrio that contramaps through WithPriority

* remove useless hiding import list, add comments to default recorder makers

* make cradleToOptsAndLibDir take concrete cradle to remove existential type var in Log constructor

* Types.Logger now re-exports prettyprinter, remove unused dependencies on prettyprinter and hslogger

* existential type var to remove boilerplate in Plugins.hs, remove a few Show instances

* add SourceLoc logging column, inline logToDoc functions, add comment explaining hslogger setup existence

* qualify a name to match original source

* fix -WError

* Delete the Telemetry log level (#2727)

It's a bit non-standard, and moreover it's entirely dead.

* Wall and 9.2 fix

* Remove unneeded comments/code

Co-authored-by: J. S <shenjonathan0@gmail.com>
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
Co-authored-by: Pepe Iborra <pepeiborra@me.com>
2022-03-03 23:08:42 +00:00
fendor
0c018ac826
Upgrade to hie-bios 0.9.0 (#2738)
* Try out new hie-bios

* Update to hie-bios 0.9.0 hackage release

* Use caret operator for hie-bios dependency

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

* Update nix dependency

* Update hie-bios dependency in flake.nix

Co-authored-by: Potato Hatsue <berberman@yandex.com>

Co-authored-by: Julian Ospald <hasufell@posteo.de>
Co-authored-by: Potato Hatsue <berberman@yandex.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-02-27 14:21:20 +00:00
Javier Neira
ce41b6459a
Prepare 1.6.0 release (#2642)
* Add list of merged prs

* Remove branch trigger

* Update release instructions

* Include 9.2.1 in the current release

* Bump up hls version

* remove duplicate mention

* Remove references to branch name

* Fix cabal.project gen

* Correct fail-fast condition

* Bump up minor version

* Bump up major version

* Bump up major version

* Allow brittany only for 9.0.1

* brittany not supported in hackage and 9.0.2

* Not short hls for hackage

* Bump up versions everywhere

* Update hackage index

* Add ghcide in rename plugin

* Apply linter and add selection demo

* Add header linkable

* Add first version of release description

* Add last prs

* Mention wingman

* Grammar corrections

Co-authored-by: Jan Hrcek <2716069+jhrcek@users.noreply.github.com>

* Correct mention

Co-authored-by: Pepe Iborra <pepeiborra@me.com>

* Warn about th in docs

* Remove reference to install doc

* Rephrasing

Co-authored-by: J. S. <document_done@hotmail.com>

* Better style

Co-authored-by: Junyoung "Clare" Jang <jjc9310@gmail.com>

* Use could to stress it likely will not work

* REmove reliable from the warning

* Reorder comments

* Rephrasing

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

* Update docs/supported-versions.md

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

* Use last version of internal deps

* Restore original wording

* One more pr

* One more pr

Co-authored-by: Jan Hrcek <2716069+jhrcek@users.noreply.github.com>
Co-authored-by: Pepe Iborra <pepeiborra@me.com>
Co-authored-by: J. S. <document_done@hotmail.com>
Co-authored-by: Junyoung "Clare" Jang <jjc9310@gmail.com>
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2022-01-28 09:06:56 +00:00
Kobayashi
310e6a4683
support selection range lsp feature (#2565)
* add selection range support

* add the whole import area as a selection step

* add selection range plugin to all project files

* merge type signature with value definition

* support ghc 9

* fix it for ghc-9.0

* remove unnecessary import

* reformat GhcIde.hs

* selection range: make it easier to understand

* selection range: improve error handling

* update lsp-types to 1.4.0.1

* add selection range to doc

* fix comment for findSelectionRangesByPositions

* remove a use of partial function

* update author & maintainer

* use foldlM1 instead of foldl1

* add testdata to cabal file

* update performace tips and log level

* update lsp-types in nix

Co-authored-by: Pepe Iborra <pepeiborra@gmail.com>
2022-01-24 13:13:56 +00:00
Javier Neira
3f4685141c
Add support for ghc 9.0.2 (#2567)
* Extract out ci build setup

* Add required shell property

* Add support for ghc-9.0.2

* Test ghc 9.0.2

* Add unix boot package

* Use primitive-unlifted < 1.0

* Use primitive-unlifted < 1.0 for stack

* Ude 9.0.1 for hackage

We cant use 9.0.2 until all deps do not need allow-newer

* Use a unified cabal-ghc90.project

And bump up index state to get lastest hie-bios

* Use last snapshot with ghc-9.0.2 support

* Use new cabal-ghc90.project in build

* Add stm-containers

* Add specific tweaks for ghc-9.0.2

* Use the las ghc-boot-9.0

* Fix test adding allow-newer

Co-Authored-By: @michaelpj

* Use unix-compat from hackage

* Use unix-compat from hackage

* Make consistent lastest stack.yamls

* Clean up cabal.project

* more cleanups

* Update tweaks in hackage ci

* Correct comment

* Correct fourmolu condition

* Correct fourmolu condition in tests

* Removing the all target from caching

It builds all project packages even if we they are not buildables
(and are not included in hls due to flags)
Its goal was build all tests and benchmarks but --enable-tests
ans --enable-benchmarks should work
Last one does not: https://github.com/haskell/cabal/issues/6259

* exclude Brittany 0.14.0.1

* Update snapshot to get new lsp

* document flag

* Document and build ghcide benchmark

* Doc and use ghc-9.0.2 in hackage

* Add ghc-9.2.1 to tested-with

* Use 9.0.2 in gitlab

* Use last *molus

* Use same versions as cabal build

* Use cabal freeze versions

* Add dep for ghcide tests

* one by one

* Unnecessary change

* Remove unnecessary flag

* Corrections

* Move blocks

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-01-17 01:18:04 +00:00
George Thomas
4ffdf45a39
Bump Ormolu and Fourmolu to GHC-9.2-compatible versions (#2579)
* Bump Ormolu and Fourmolu to latest versions (resp. 0.4 and 0.5)

* Enable Ormolu and Fourmolu on GHC 9.2

* Bump index-state

* enable tests for ghc-9.2.1

* enable fourmolu and ormolu

* Allow newer ghc-lib-parser for *molu

* Fix ormolu

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
Co-authored-by: Javier Neira <atreyu.bbb@gmail.com>
Co-authored-by: Junyoung "Clare" Jang <jjc9310@gmail.com>
2022-01-13 11:35:35 +00:00
Michael Peyton Jones
7518a3a7eb
Upgrade to new version of lsp libraries (#2494)
* 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>
2021-12-29 09:45:25 +01:00
Anton Latukha
e6c1fcab76
CI: caching: fix early termination expression check & cabal.project replacement (#2520)
* CI: caching: fix early termination expression check

It is obscure bug.

Details are in
https://matrix.to/#/!oOjZFsoNYPAbTEgSOA:libera.chat/$tB_L6wbaxe1ElQtYzMI9woID4hZyscS6Rhpn-nsCc6Y?via=libera.chat&via=matrix.org&via=monoid.al

Because after the second path somehow it always returned `False` - the caching
runs always resulted in early termination.

* CI: caching: fx `cabal.project` copying

In the
https://github.com/haskell/haskell-language-server/runs/4596861600?check_suite_focus=true
of
https://github.com/haskell/haskell-language-server/pull/2503

Noted that:

I rm cabal.project. The sources of cabal-ghc921.project contain:
index-state: 2021-12-18T00:00:07Z
cp cabal-ghc921.project cabal.project
Then from cabal.project CI retrieves finderprint 2021-11-29T08:11:08Z.
Seems like GitHub uses alias cp=cp -i - preventing UNIX-like default copying over behaviour.
& rm cabal.project does not remove the file.
cabal.project seems to be protected from deletion.

* cabal*.project: index-state +1s

Renewing cache.

* CI: {caching,test}: make rm/cp comment more informative

* CI: {caching,test}: upd commets

This should short-cirquit.

* cabal*.project: index-state +1s

* Correct small typo

Co-authored-by: Javier Neira <atreyu.bbb@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-12-22 12:59:41 +00:00
Anton Latukha
9bd5271629
cabal-*.project: index-state +1s (#2515)
This is vacuous change, Hackage rerolls to the previous snapshot time
nevertheless of this change, but the caches get a new key namespace.
2021-12-21 06:45:24 +01:00
Pepe Iborra
807cb8f1fe
Warn if TH and Mac and static binary (#2470)
* Warn if TH and Mac and static binary

* fix up the instructions

* use hostIsDynamic

* Upgrade hie-bios version

* bump cabal index

* fix more Stack descriptors

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-12-13 12:35:44 +00:00