Commit Graph

115 Commits

Author SHA1 Message Date
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
Zubin Duggal
2df68246f8 Prepare release 1.9.0.0 2022-12-26 16:09:25 +05:30
Zubin Duggal
54128813ae Implement completionItem/resolve 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
9e5fc880d1
Add RangeMap for unified "in-range" filtering (#3343)
* Move RangeMap under hls-plugin-api and add benchmark

* Add some documentation

* Rename benchmark case

* Make explicit fields plugin work with RealSrcSpans

* Add test to ensure both filtering approaches are identical

* Add some coverage checks (for reference)

* Remove outdated comment

* Add use-fingertree flag to hls-plugin-api

* Add more instances to RangeMap

* Extend test generators to cover multiline ranges

* Add more documentation
2022-11-26 16:05:31 +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
Ruslan Gadeev
5d56aa70a8
fix typos (#3325)
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2022-11-09 17:42:12 +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
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
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
Kobayashi
2bd1863eea
unescape printable characters (#3140)
* unescape printable characters

* add comments

* add tests

* improve the parser

* simplify code & add more docs
2022-09-15 15:12:51 +00:00
Pepe Iborra
4ce8f99bcd
Remove unused build-depends and install warnings (#3155)
* Remove unused build-depends and install warnings

* Remove -Werror
2022-09-15 10:44:02 +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
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
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
8d564d1518 Fix test 2022-08-19 15:49:39 +05:30
Pepe Iborra
583904ea1b Fix tests 2022-08-19 15:49:39 +05:30
Pepe Iborra
9ef66c9679 Add plugin priorities 2022-08-19 15:49:39 +05:30
Pepe Iborra
5894b9a306 formatting 2022-08-19 15:49:39 +05:30
Pepe Iborra
df88cd5676 Deduplicate HLS plugins
Use a smart constructor to prevent duplicated plugins. We cannot use a
set since order matters
2022-08-19 15:49:39 +05:30
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
Dmitry Pogodin
347a7187f2
Run pre-commit hooks (#3059) 2022-07-28 16:48:13 +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
ˌbodʲɪˈɡrʲim
12095b2e53
hls-plugin-api: add lower bounds (#3022)
Before `opentelemetry-0.4` `SpanInFlight` is not exported.
Before `dependent-sum-0.7` `GCompare` is not coming from `some`, but is defined elsewhere, which leads to incompatibility with `lsp`.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2022-07-08 10:07:56 +00:00
Nick Suchecki
73652d7515
Log response errors returned from Plugins (#2988)
* Log ResponseErrors when returned from Plugins

* Log  from Plugins

* Create 'logAndReturnError' that will log any failures in plugins

* Missed opportunity to use logAndReturnError

* Revert throwPluginError to throwE

This reverts a change made previously to try to make pluginErrors have a
common error format. This will be updated in the near future.

* Warning -> Error

* Fix Functional Test for Plugin Response Error

* Add orphan instances for

* Revert back to Warning

* Update log format in test suite
2022-07-01 22:52:51 +00:00
fendor
907a6e645b
Teach HLS about different file extensions (#2945)
* Fix parameter switch-up

* Generalise file extension handling for plugins

NotificationHandler now distinguishes between different file extensions
RequestHandler distinguishes between different file extensions

* Introduce PluginMethod Typeclass hierarchy

The hierarchy looks as follows:

            PluginMethod (pluginEnabled)
                          |
         -----------------------------------
         |                                 |
 PluginRequestMethod             PluginNotificationMethod

* Add example plugin

* Improve documentation for plugins

* Simplify Plugin Handling code

Co-authored-by: Jana Chadt <jana.chadt@nets.at>
Co-authored-by: Jana Chadt <jana.chadt@tuwien.ac.at>
Co-authored-by: Fendor <walross.power@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-06-22 15:38:13 +00:00
fendor
44be7416c8
Implement PluginMethod for hard-wired in handlers (#2977)
Don't hard-wire handlers, but make sure all handlers are associated to a
PluginDescriptor, s.t. we can check that the handler is actually enabled
for a given request.
2022-06-20 22:46:42 +00:00
Nick Suchecki
8f68882f81
Add throwPluginError to Plugin Utilities (#2924)
* Add new PluginUtility function.

Add the function `throwPluginError`. This function is intended to
provide a common `ResponseError` message for use in logging.

Renamed `response` to `pluginResponse` for more clarity.

* Call hierarchy clean up

* Make Descriptor usable as String/Text or PluginID

* Update reference to ChangeTypeSignature descriptor

* Use unpack rather than show

* Import cleanup

* Merge cleanup

* Fix test suites for effected plugins

* forgot to change the CodeAction kind in the test suite...

* Update new plugin
2022-05-27 15:11:08 +00: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
Lei Zhu
eeb1d2057d
Replace TextDocumentIdentifier with Uri (#2912) 2022-05-18 08:35:29 +00:00
Zubin Duggal
41b30b5706 Prepare 1.7.0.0 2022-04-21 14:08:10 +05:30
wz1000
3c24c20c5d
Avoid race conditions with VFS and VFS versions (#2789)
* Avoid race conditions with VFS and VFS version

We need to take VFS snapshots as soon as we get a change notification.

Consider the following interleaving of events:

1. Change Notification A (updates LSP VFS)
2. Restart Shake Session (A changed) initiated
3. Change Notification B (updates LSP VFS)
4. Restart Shake Session (A changed) takes VFS snapshot and possibly performs more computation
5. Restart Shake Session (B changed)

In particular, between step 3 and 5, we took a snapshot for a previous build,
but this snapshot included changes from a newer VFS state that the build should
not have seen.

To fix this, we need to take snapshots as soon as a notification handler is
called, before forking any threads. This works because LSP calls all handlers
in a single threaded fashion and these handlers block message processing. It
is essential to this on the LSP handler thread rather than the reactor thread
that GHCIDE sets up in order to maintin the property.

* Disable flaky test 'add missing module (non workspace)'
2022-04-16 20:43:44 +00:00
Michael Peyton Jones
388abc300e
Purge some more hslogger (#2770)
* Purge some more hslogger

At this point we only really need it for `hie-bios`.

* Add StrictData to Hlint plugin
2022-03-10 13:10:17 +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
wz1000
905e2ef778
Track file versions accurately. (#2735) 2022-02-26 12:46:38 +00:00
J. S
3b687a52ac
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
2022-02-20 21:50:28 +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
Kobayashi
ffd0f346d8
fix positionInRange (#2625)
* add a failing test case for positionInRange

* fix positionInRange in PluginUtils

* add hls-plugin-api to CI

* fix ci

Co-authored-by: Javier Neira <atreyu.bbb@gmail.com>
2022-01-22 17:28:26 +00:00
Michael Peyton Jones
b937baa03c
Use helpers from lsp to do code action prefixing (#2614)
Nicer version as promised in
https://github.com/haskell/haskell-language-server/pull/2146.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-01-20 22:24:50 +00:00
Javier Neira
2625689ad4
Add support for brittany (needs aeson-2) and floskell with ghc-9.0.1 (#2551)
* Enable tests for brittany and 9.0.2

* Enable tests for floskell plugin

* cabal-ghc901.project: naively enable brittany

* haskell-language-server.cabal: bump brittany flag <(9.0.1->9.2.1)

* Trying to add support for brittany

* Use last hackage floskell version

* Activate floskell in func-test suite

* Restrict brittany in hackage for ghc<9.0.1

* Adapt to Aeson.Key

* Update lsp source repo package

* Refer pr for butcher

* Add missing prefix

* Adapt to aeson-2 (incomplete)

* Use compat module

* Support for aeson-2 and extra-1.7.10

* Remove lsp

* Allow newer aeson for stylish-haskell

* Add needed import for non windows

* Remove insertJson and toJsonKey

* Update cabal-ghc901.project

* Missing import

* Avoid CPP by using lens-aeson

* Update hls-plugin-api/src/Ide/Plugin/ConfigUtils.hs

* Use ghcide compat module

* Use type alias in cpp

* Fix stack build for ghc-8.6.5

* Use lens-aeson key

* Use lens-aeson in func-test

* Fixup shake-bench

* Update docs

* Switch to lens ix

* Try this

Co-authored-by: Anton-Latukha <anton.latukha@gmail.com>
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-01-12 16:24:53 +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
Jan Hrcek
7c9b9327d8
Fix some hlint warnings (#2523)
* Fix some hlint warnings

* Revert changes in hie-compat

Co-authored-by: Anton Latukha <anton.latukha@gmail.com>
2021-12-24 21:40:17 +00:00
Michael Peyton Jones
47f29daac7
Delete some dead or deprecated settings (#2481)
* Delete diagnosticsOnChange

* Delete liquidOn

* Remove deprecated reference to completionSnippetsOn

* Delete hlintOn

Co-authored-by: Javier Neira <atreyu.bbb@gmail.com>
2021-12-14 14:57:58 +01:00
Nick Suchecki
77d0429561
Centralize common Functions. (#2433)
`response`, `handleMaybe`, `handleMaybeM` are three functions that pop
up in a variety of plugins. This commit centralizes these three
functions into one module, and makes the change across the related
plugins.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Javier Neira <atreyu.bbb@gmail.com>
2021-12-04 17:33:53 +00:00
Javier Neira
311107eabb
Prepare 1.5.0 (#2361)
* Use hackage version of czipwith

* Update stack.yaml's

* Remove source czipwith

* Update index and clean cabal-ghc921.project

* extra-1.7.9 has a breaking change so no way

* Increase resources for circleci

As for November 16, circleci has set a timeout of 1 hour for jobs in free plans
Trying to increase resources to make the build faster as suggested by its support center

* Use more threads reduce build times

* Correct runs-on field

* Update stack.yaml's

* Dont fail fast if we are checking

* Use ref_name to check it is a check

* Bump patch version of brittany plugin

* Allow newer base/th for czipwith

* Add enough allow-newers to allow build the project

Having all subpackages included in the `packages` field

* Correct allow-newer's

* Add missing cd's

* Bump up ghcide to 1.5.0

* Exclude pkgs not buildable with 9.0.1

* Bum up plugins with changes versions

* Bum up subpackages with changes versions

* Bum up hls version to 1.5.0

* Bump up haddock plugin version

* Allow ghcide 1.5

* Use ghcide 1.5.0 in the rest of plugins

* Use ghcide 1.5.0 for pragmas

* Allow tactics 1.5.0 for hls

* Remove czipwith in hackage ci script

* Disable 9.0.1 for hackage ci

* Use bounds operator consistently

* Build formatters with newer ghc-lib-parser

* Only stylish-haskell needs newer ghc-lib

* Avoid ghc-9.0.1 in other way

* Script needs a min time version

* First draft of 1.5.0 changelog

* Comment out hackage for 9.0.1

* allow newer ghc-lib-parser

* Remove redundant entry

* Correct condition

* Cancel previous hackage jobs

* Add link to pepe's talk slides

* Use th-extras master

* Use th-extras master and uncomment packages

* add extra-1.7.9

* Add required extra-deps

* Comment unbuildable packages again

* Add ignore-plugins-ghc-bounds

* Add #2354

* Complete ghc deprecation notice

* Add extra-1.7.9

* Add #2346 to Changelog
2021-11-18 06:28:38 +01:00
Pepe Iborra
2204a16bfb
Garbage collection of dirty keys (#2263) 2021-10-30 13:42:29 +01:00