Commit Graph

557 Commits

Author SHA1 Message Date
Michael Peyton Jones
388fd40ade
Purge GHC 8.8 (#3287)
We're also dropping support for this.
2022-10-18 22:12:53 +01: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
George Thomas
55456fb281
Register Fourmolu plugin properties (#3284)
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2022-10-12 12:15:05 +00: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
Chrizzl
07f14e33b3
Remove unlawful Ord instance and replace it by a compare function (#3271) (#3279) 2022-10-11 09:54:10 +01:00
Chrizzl
e176eca897
Use an importance score to order the suggested import code action (#3234) (#3271)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-10-10 13:29:28 +00:00
Andy
21c8e9b83e
Hlint: A handful of fixes to hints (#3259)
* CI: rwe/actions-hlint-run v2

* fmt script: Fix missing directories

Otherwise will fail

* Hlint: Automatically fix warnings via apply-refact

* Hlint: Do not suggest fromMaybe

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2022-10-10 11:47:42 +00:00
Chrizzl
050497a19f
Exclude the implicit prelude import (#2798) (#3277) 2022-10-09 17:32:17 +00:00
Zdeno Osina
0eb79a4695
Fix action removes ticks from TemplateHaskellQuotes (#628) (#3260) 2022-10-09 13:38:27 +00:00
Kobayashi
d8e1e75241
Move new imports down the code action list (#3235)
* move new imports to the tail

* remove LANGUAGE CPP

Co-authored-by: Pepe Iborra <pepeiborra@gmail.com>
2022-10-08 06:10:57 +00:00
Kobayashi
011d110b4c
Fix error in code range (#3229)
* add test case

* handle error more properly

* add an error type

* fix tests

* log the bad dependency case
2022-09-29 04:54:06 +00:00
hololeap
e09c00588b
hls-hlint-plugin: Update README.md (#3216)
Remove warning about hlint restrictions, as #1340 has been merged.

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2022-09-26 13:37:47 +01:00
Kobayashi
217573f4a1
Improve haddock comments (#3207)
* remove 'buildable: False' in cabal

* remove constraint on ghc-exactprint

* wip

* revert HaddockComments.hs

* generate haddock comments for constructors

* fix tests

* restore constraints

* make it compatible with ghc 9.0

* add more tests

* add comments & fix dp calculation for inline case

* add kokobd to codeowners of haddock-comments plugin

* fix a comment

* rephrase some comments to make them clearer

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-09-26 00:05:19 +00:00
hololeap
c422cf373a
Add source-repository to all cabal files (#3219)
Add a source-repository stanza to any .cabal files in the project that
are missing it.

This metadata can be useful for package maintainers.

See: https://cabal.readthedocs.io/en/stable/cabal-package.html#source-repositories

Signed-off-by: hololeap <hololeap@users.noreply.github.com>

Signed-off-by: hololeap <hololeap@users.noreply.github.com>
2022-09-24 02:50:25 +00:00
Pepe Iborra
fd1a7d1923
Add diagnostics to Stan descriptor (#3213) 2022-09-23 06:01:22 +00:00
Pepe Iborra
dca5cc36c7
Log plugin name and attribute errors to plugins (#3194)
* Log plugin name

* redundant import

* Attribute response error logs to plugins

* remove redundant plugin names from error messages

* improve pretty printing

* Avoid show

* simplify test messages

* Fix
2022-09-21 17:36:19 +00:00
Lei Zhu
b547d4e9ac
Fix broken call-hierarchy-plugin-tests for type signatures (#3188)
* Fix broken tests for signatures

* Remove unused Maybe

* Refactir prepare

* Refactor incoming and outgoing calls

* Fix doc format

Co-authored-by: Pepe Iborra <pepeiborra@gmail.com>
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2022-09-21 14:43:53 +00:00
Aarush Bhat
42bcf9229a
Feat: Folding Ranges (#3058)
* save some progress: add basic starter code for folding ranges

* save some progress: add function to traverse through coderange and form folding ranges

* save some progress: add parsing of folding ranges

* fix: maybe issue with foldingRanges

* add: generate folding ranges from coderange

* add: plugin request method instance for folding ranges

* ref: alter function and var names

* post review: cleanup crk to frk & fix typo

* fix: find folding ranges function

* format: run formatter and add comments

* fix: return all response results of folding range request

* Revert "format: run formatter and add comments"

This reverts commit e6a2b5ca3e.

* add: removed comments after revert

* fix: formatting

* docs: add folding range to features section and cabal file

* refactor: use destructuring for createFoldingRange function and use characters

* test: add basic unit test for findFoldingRanges function

* test: add tests for children and code kind

* test: add more test cases

* test: add test for createFoldingRange

* test: add integration test for folding ranges

* fix: duplicate start line foldingranges and remove single line
foldingranges

* refactor: duplicate folding range functionality

* fix: formatting in code range plugin

* added more descriptive comments and encorporate code review suggestions

* revert: automatic formatting for selection range test case file

* fix: ignoring children if root fails to provide folding ranges

* remove: redundant match on crkToFrk

* revert: filtering same line foldings and multiple foldings on the same line as it can be handled by clients

* revert: formatting change to selection range test file

* fix: entire file folding because of root node

Co-authored-by: Kobayashi <contact@zelinf.net>
2022-09-21 12:59:57 +01:00
Andy
bd1d0a1675
Stylish Haskell: CPP parse issues (#3199)
* Stylish Haskell: Parse issues

* CPP language extension
* Manually fix some files with duplication

* Pre-commit: Fix ignored files

It looks like `ExactPrint` was ignored before, but since absolute paths
are used and weren't adapted it wasn't ignored afterwards.
2022-09-19 20:31:37 +00:00
Andy
362ca34488
Refactor plugin: Prefer code action (#3167)
`isPreferred` can influence the client side order of code actions. The
idea is that an unused import is likely to be removed and less likely
the warning will be disabled. Therefore actions to remove a single or
all redundant imports should be preferred, so that the client can
prioritize them higher.

Followup of
<https://github.com/haskell/haskell-language-server/pull/3018>
2022-09-18 16:58:11 +00:00
Andy
b378de2d42
Solve formatting issues (stylish-haskell, pre-commit CI) (#3171)
* Solve formatting issues

* stylish-haskell parse errors solved (partially)

* Env: Changing order (import)
* Plugins: Dangling `$`

Co-authored-by: Pepe Iborra <pepeiborra@gmail.com>
2022-09-18 08:41:14 +00:00
Andy
855a882382
Allows disabling stan plugin (#3179)
Respects globalOn in stan plugin configuration and won't show hints
anymore if the plugin is disabled.

Co-authored-by: Pepe Iborra <pepeiborra@gmail.com>
2022-09-17 09:08:49 +01: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
Nick Suchecki
aad896cdc5
Update hls-retrie-plugin to be usable with 9.2.4. (#3120)
* Update hls-retrie-plugin to be usable with 9.2.4.

This is the first pass at getting hls-retrie-plugin enabled. Much of the
changes were updating to match the changes in the upstream `retrie`
package.

* Replace GHC.Paths.libdir by querying a ModSummary for the LibDir

* Looks like formatting was missed

* Revert "Looks like formatting was missed"

This reverts commit 4f6eee5a6f.

* Don't build retrie for 9.4

Co-authored-by: Pepe Iborra <pepeiborra@gmail.com>
2022-09-07 17:58:05 +00:00
Zubin Duggal
a2df919078 Make hls-code-range-plugin buildable on 9.4 by removing usused exactprint dependencies 2022-09-06 20:36:24 +05:30
Zubin Duggal
d18743d470 Accept broken call-hierarchy tests 2022-09-06 20:36:24 +05:30
Pepe Iborra
4117da7bc3 fixup refactor onlyWorkForGhcVersions 2022-09-06 20:36:24 +05:30
Pepe Iborra
b60abea0e1 pragmas tests no longer regressing 2022-09-06 20:36:24 +05:30
Pepe Iborra
28cbee9c01 Tag 9.4 regressions in HLS pragmas test suite 2022-09-06 20:36:24 +05:30
Pepe Iborra
d3d4df51c2 refactor onlyWorkForGhcVersions 2022-09-06 20:36:24 +05:30
Pepe Iborra
9297c98c54 enable a bunch of plugins that build with ghc 9.4 2022-09-06 20:36:24 +05:30
Nick Suchecki
08cfc78394 Change Type Signature Plugin buildable with 9.4 2022-09-06 20:36:24 +05:30
Nick Suchecki
26a6ca6079 Special handling of 9.2 2022-09-06 14:45:26 +05:30
Nick Suchecki
608cfd99b4 Alternate Number Format Plugin buildable with GHC 9.4 2022-09-06 14:45:26 +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
Nick Suchecki
9a0684ec28
Remove pluginId from getNormalizedFilePath error message (#3118)
The error message displayed by `prettyResponseError` in
`Development.IDE.Plugin.HLS` looks awkward with the pluginId. This error
is not the fault of plugins anyways, so let's just be generic.
2022-08-21 17:07:53 +00:00
Pepe Iborra
099b4e7b88 Fix priority for pragma completions 2022-08-19 15:49:39 +05:30
Pepe Iborra
9ef66c9679 Add plugin priorities 2022-08-19 15:49:39 +05:30
Lei Zhu
92f4bd4b28
Remove unused config (#3107) 2022-08-16 20:46:29 +01:00
Lei Zhu
49373fd014
Fix #3047 (#3092)
* Make path canonicalized

* Update extra-source-files

* Replace with normalise

* Change to a more detailed log

* Comment patch detail

* 2 spaces indent
2022-08-14 14:44:59 +00:00
Brandon Chinn
548ca17cc7
Support fourmolu-0.8.1.0 (#3103) 2022-08-14 09:43:46 +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
Andy
3b2f9f6d7c
Stan: Avoid terminal colors in messages (#3090) 2022-08-11 23:55:24 +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
Brandon Chinn
abd7a1955c Make even more forwards-compatible 2022-08-05 21:01:32 -07:00
Brandon Chinn
59415bb8f7 Add support for fourmolu-0.8.0.0 2022-08-05 21:00:21 -07:00
Brandon Chinn
425763a589 Consolidate shims 2022-08-05 20:02:26 -07:00