Commit Graph

35 Commits

Author SHA1 Message Date
Michael Peyton Jones
71aa2d38e0
Bump to new lsp versions (#4279) 2024-06-06 13:19:32 +00:00
Jan Hrcek
a339277ba1
Upgrade to latest lsp / lsp-types / lsp-test (#4166) 2024-04-30 19:33:24 +02:00
soulomoon
c7f8ceda49
[merge hls-test-utils and ghcide-test-utils] part of #4173 Migrate ghcide tests to hls test utils (#4197)
* pull ghcide-bench out of ghcide and merge some of the hls-test-utils with ghcide-tests

* fix style
2024-04-30 10:20:33 +01:00
Jan Hrcek
e6f7be7ec4
Fix ghc and hlint warnings (#4181) 2024-04-17 08:48:39 +02:00
Peter Matta
c3b0b37adc
hls-eval-plugin: Replicate #4139 (#4140)
* main function eval bug

* hls-eval-plugin: set ghci backend for evaluation

* Fixes #4139

* bench: add hls-eval-plugin experiments

---------

Co-authored-by: Peter Matta <developer@mattepet.com>
Co-authored-by: soulomoon <fwy996602672@gmail.com>
2024-03-27 10:04:05 +00:00
soulomoon
82148dc221
Fix hls-graph: phantom dependencies invoke in branching deps (resolve #3423) (#4087)
phantom depencies is invoke becase dependencies have preconditions in rules, see #3423. This pr is intend to fix that.
This might also fix some of the flaky tests. 

In favor of @wz1000 appoach of running deps linearly. 
It modify the deps result from KeySet to [KeySet] to make sure the result is sorted

we initialy thought it would have performance impact on the build system. But it turns out instead of performance lost, we actaully have performance gain since it avoid building the phantom depencies. 

Overall things have been done:
1. Fix up hls-graph phantom depencies issue by reflesh linear deps in a linear manner.
2. Add semantic tokens bench mark.
3. Add test to hls-graph to ensure phantom depencies would not be invoke.

Result:
Now no more phantom dependencies would be invoked in hls-graph, gaining correctness, less runtime and less mem usage at the some time.
2024-03-16 18:10:10 +08:00
soulomoon
8a8f59bf2e
Benchmark: Enable 9.6, 9.8 (#4118)
Fix bench for newer ghc versions
The following have been done:
1. No longer use the implicit-hie to generate the hie.yaml for the bench examples and in favor of using "cradle:\n cabal:\n", seems to be working with modern cabal.
2. upgrade benchmark to use 9.6, 9.8 (The latest two we support for now).
3. upgrade bench examples to `Cabal version: 3.10.2.1, lsp-types version: 2.1.1.0`
4. fix minor error that `*.hp` files duplicates its extension name

---------

Co-authored-by: fendor <fendor@users.noreply.github.com>
2024-03-07 13:40:18 +00:00
Fendor
26fa28c50e Update HLS version in .cabal files 2024-02-27 15:17:05 +01:00
Michael Peyton Jones
949f3b8d0f
Remove ghcide-test-utils as a separate package (#4032)
* Actually build everything

* Remove ghcide-test-utils as standalone package
2024-02-26 10:49:41 +00:00
Michael Peyton Jones
0b0eee328f
Bump lsp versions (#4052)
* Bump lsp versions

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

* stack

* More fixes
2024-02-08 17:32:10 +00:00
Jan Hrcek
902a62bb6b
Fix -Wunused-imports (#4037)
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2024-02-03 22:22:15 +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
Zubin Duggal
22c0624541 Prepare release 2.6.0.0 2024-01-16 00:35:59 +05:30
Zubin Duggal
f46216835a Prepare release 2.5.0.0 2023-12-12 11:58:59 -08:00
Zubin Duggal
0f240c8540 Prepare release 2.4.0.0 2023-10-10 23:01:28 -07:00
wz1000
d983c89154
Release 2.3.0.0 (#3818)
* Prepare release 2.3.0.0

* release ci: respect ADD_CABAL_ARGS on non-windows builds

* release ci: disable simdutf text for centos

* release ci: disable simdutf text for freebsd

* Fix cabal file of hls-fourmolu-plugin to allow it to be uploaded to hackage

Fixes #3819

* Update ghc version support docs

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-10-06 12:11:38 +00:00
Nathan Maxson
f557e6c4c5
Add code lens and fix code actions experiments (#3791) 2023-09-12 16:14:27 +03: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
Fendor
f5e3fce13f Prepare release 2.2.0.0 2023-08-26 00:24:32 +02: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
wz1000
9effc56ef8
Share ModuleGraphs for all files (#3232)
* Remove GetDependencyInformation in favour of GetModuleGraph.

Computing and storing GetDependencyInformation for each file essentially individually means
that we perform downsweep on each file individually, wasting a lot of work and using an excessive
amount of memory to store all these duplicated graphs individually.

However, we already have the `GetModuleGraph` rule, which we need to compute before compiling
files any way due to being depended on by `NeedsCompilation`, which needs to know if any reverse
dependencies of the module we are compiling requires TH, which meant that each file already depends on
the results of downsweep for the whole project.

Instead, we can compute the whole graph once when we execute the `GetModuleGraph` rule and even use this inside `HscEnv.hsc_mod_graph` to avoid reconstructing the `ModuleGraph` on each invocation of `GhcSessionDeps`.

There may be concerns about excessive build churn due to any change to the result of `GetModuleGraph`
invalidating the result of `GhcSessionDeps` too often, but note that this only happens when something
in the header of a module changes, and this could be solved easily be re-introducing
a version of `GetDependencyInformation` with early cutoff that essentially returns the result of `GetModuleGraph`
but includes the hash of only the `ModSummary`s in the downward dependency closure of the file.

* module graph early cutoff

early cutoff for eval plugin

* allow running benchmarks on examples generated via a script

* Add new benchmarks to config

* Allow pathToId to fail

* Errors

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-08-04 11:58:21 +00:00
Nathan Maxson
a918c02a61
HLS for the new generated LSP 2 release (#3621) 2023-06-19 08:49:38 +03:00
Zubin Duggal
9cc67c5a46 Bump all packages to version 2.0.0.0.
This simplifies the release process as we can bump all package versions in
lockstep prior to a release instead of having to decide version bumps on a case
to case basis while adhering to PVP.

We don't test arbitrary configurations mixing versions of plugins/ghcide which
you might get if you install HLS from hackage. With this in mind, it makes sense
to pin the versions of all packages in this repository

Exceptions include:
- hie-compat (it is used by hiedb and is mostly separate from the other packages - it changes about once a GHC release)
- shake-bench (not meant to be distributed for users, for internal testing only
2023-05-18 17:05:56 +05:30
Zubin Duggal
2df68246f8 Prepare release 1.9.0.0 2022-12-26 16:09:25 +05:30
fendor
9cb3485326
Add CI flows for GHC 9.2.5 (#3376)
* Add CI flows for GHC 9.2.5

* Prefer GHC 9.2.5 over 9.2.4

* Update list of tested-with GHC versions, as we only *test* 9.2.5

* Add GHC 9.2.5 as a supported GHC version

* Update comment in cabal-plugin about disabled test-case

* Disable GHC 9.2.5 on windows

* Fix CI for windows

* Run tests on windows for GHC 9.2.4

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
Co-authored-by: Pepe Iborra <pepeiborra@gmail.com>
2022-12-07 12:49:59 +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
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
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
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
Zubin Duggal
fdbc555a92 Fix benchmarks 2022-08-31 00:56:35 +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