Commit Graph

75 Commits

Author SHA1 Message Date
fendor
287ee42ab5
Prepare release 2.9.0.0 (#4319)
* Prepare release 2.9.0.0

* Bump 'bytestring' version for release CI test scripts

The older 'bytestring-0.11.1.0' version doesn't compile with the recent
GHC 9.10.1 release. Bump the version to '0.12.1.0' which can be
successfully compiled on all supported GHC versions.

* Update supported GHC version table

* Move plugin ghc support conditionals into .cabal file

Having them in the cabal.project file is a very neat way to
enable/disable a plugin, but it negatively affects Hackage users as they
can no longer trivially install HLS from Hackage.

This discussion might be revisited in the future, but not during a
release process.

* Disable tests and benchmarks in release test pipeline

On some platforms, building bytestring-0.12.1.0 is not fully supported
yet. Hence, we disable tests and benchmarks, to allow building on the
platform Windows with GHC 9.10.1.

* Always show debug output in release test ci

* Upgrade cabal version in the release pipeline

* Switch to `text` for release test package

---------

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2024-06-19 10:35:14 +02:00
wz1000
3009a45c74
Support for 9.10 (#4233)
* Support for 9.10

This includes supports for all plugins, other than formatters and hlint.

We need ghc-exactprint and retrie release before merging this.

* Remove indexed-traversable allow-newer

* Fix couple of warnings

* Fix flags job for hls-graph

* foldl' exposed from Prelude since base 4.20

* Fix flags job for hls-plugin-api

* Fix ghcide hover test

* Fix flags job for hls-eval-plugin

* unzip since 4.19

* More pedantic fixes

* Don't CPP in tests, fix another test

* Switch to ghc-exactprint and witherable from hackage

* Fix all warnings in hls-refactor-plugin

* Remove more no longer necessary allow newers

* Fix all warnings in hls-gadp-plugin and hls-qualify-imported-names-plugin

* Remove allow-newer for boring

* Bump to lsp 2.6, remove more allow-newers

* outline tests

* disable simple plugin on 9.10

* Remove allow-newer for ghc-trace-events

* fix appendConstraint

* stylish

* Remove commutative-semigroups and monoid-subclasses from allow-newer

* Remove free from allow-newer

* Fix 'type wilcard actions' tests

* Remove hie-bios from allow-newer

* Fix suggestNewDefinition tests

* Revert "Fix suggestNewDefinition tests"

This reverts commit 2f3300e964.

* Remove makeDeltaAst breaking tests unrelated to addArgument

* Fix 79 code action tests

* Fix 12 more tests

* Remove co-log-core from allow-newer

* Fix 21 more tests

* Fix 8 import disambiguation tests

* fix windows ghcide tests

* Fix adding argument to function body

* update retrie commit, progress in add argument tests

* Fix few stylish-haskell parse errors

* Fix remaining redundant constraint tests

* Remove allow-newer for constraint-extras

* Fix warnings after master merge

* Fix most add argument tests except for one

* Remove dependent-map from allow-newer

* Try removing some allow-newers from lsp

* Ormolu is updated, add links for other tool dependencies

* Revert "Try removing some allow-newers from lsp"

This reverts commit 6f60029ff2.

* Try this

* Fix all gadt plugin and most class plugin tests, enable 2 tests for ghc 9.4+

* Undo spurious changes

* Update eval plugin tests

* Disable broken refactor plugin test for now

* Fix warnings

* Add source-repository-package to unblock floskell

* Make call hierarchy plugin tests green

* fix semantic tokens 9.10

* Fix remaining class plugin test

* Update hls-change-type tests

* Make class plugin more robust

* Fix stylish parse errors, simplify CPP

* Cleanups

* Remove retrie dep from hls-refactor-plugin

* More retrie fixes

* Fix cabal-plugin-tests by respecting maxCompletions client cfg + a bit of CPP

* Fixup ghcide-tests

* disable retrie, splice and floskell plugins for 9.10

* Update tested-with + fix import warning

* Fix stylish

* Fix compilation with 9.2.8, fix stack jobs

* Remove no longer relevant :type +v test

* Disable tests of disabled plugins in CI

* Try a better broken specifier?

* Fix invalid CI config

* Use getClientConfigAction instead of introducing new HandlerM action

* Move CPPd imports to prevent stylish from evaluating CPP

* Disable stan tests with ghc 9.10 in CI

* attempt fixing exactprint <9.10

* Try enabling fourmolu now

* Revert "Try enabling fourmolu now"

This reverts commit 7142686f62.

* Update code-range-plugin tests

* Fix No newline at the end of file

* Use more recent cabal-gild

* Try setting some linker flags for macos

* Ignore non-local variable completion test on windows for GHC 9.8

---------

Co-authored-by: Jan Hrček <honza.hrk@gmail.com>
Co-authored-by: Patrick <fwy996602672@gmail.com>
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
Co-authored-by: Fendor <fendor@posteo.de>
2024-06-13 14:45:57 +00:00
soulomoon
e9c2f55201
4301 we need to implement utility to wait for all runnning keys in hls graph done (#4302)
* wait for database running keys

* add `waitForDatabaseRunningKeysAction`

* add comments
2024-06-09 14:49:14 +01:00
soulomoon
322ac3505c
Fix resultBuilt(dirty mechanism) in hls-graph (#4238)
* clarify dirty in hls-graph

* fix comment

* hls-graph add `compute` test

* move test to better place

* add detailed test

* fix comment

---------

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2024-06-03 15:37:53 +00:00
wz1000
2b8f3438ca
Prepare release 2.8.0.0 (#4191)
* Prepare release 2.8.0.0

* try maerwald runners

* Update version support

* Schedule nightly job to run weekly instead of daily

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-05-10 22:22:19 +00:00
soulomoon
3084c7f0d0
Stabilize the build system by correctly house keeping the dirtykeys and rule values [flaky test #4185 #4093] (#4190)
The main problem is the out of sync state in the build system. Several states involved, the shake database running result state for key. shake extra's dirty state for key and shake extra's rule values state.
To stablize the build system. This PR force some of the updates of these state into a single STM block.

1. collect dirtykeys and ship it to session restart directly. No more invalid removal before session restart. Fixing Flaky test failure result in error of GetLinkable #4093
2. move the dirtykey removal and rules values updating to hls-graph by adding a call back fucntion to RunResult. Properly handle the dirtykeys and rule value state after session start and closely followed by another session restart Fixing ghcide-tests' addDependentFile test #4194
3. properly handle clean up by wrapping the asyncWithCleanUp to refreshDeps

---------

Co-authored-by: wz1000 <zubin.duggal@gmail.com>
Co-authored-by: Jan Hrcek <2716069+jhrcek@users.noreply.github.com>
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2024-05-11 04:43:26 +08:00
Jan Hrcek
e6f7be7ec4
Fix ghc and hlint warnings (#4181) 2024-04-17 08:48:39 +02:00
soulomoon
3668683c1e
Remove dead code in ghcide and hls-graph for priority (#4151) 2024-03-26 07:23:31 +08: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
Fendor
26fa28c50e Update HLS version in .cabal files 2024-02-27 15:17:05 +01:00
Jan Hrcek
0047d133a1
Fix warnings in hls-graph, enable pedantic in CI (#4047)
* Fix warnings in hls-graph, enable pedantic in CI

* Fix build with flags

* stylish-haskell

* Split Key stuff to separate module with explicit export list

* Try the cabal configure suggestion in CI flags job

* Newline fix

* Enable pedantic for all

* Typo

* stylish-haskell

* pedantic is already enabled for all

* Fix error in hls-plugin-api

* Address nitpick, use lsp-types in tests instead
2024-02-06 15:13:41 +00:00
Jan Hrcek
b91c907636
Fix -Wredundant-constraints (#4044)
* Fix -Wredundant-constraints

* Fixes

---------

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2024-02-04 19:07:56 +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
Jiri Lojda
20a37ece9e
Merge definitions from all plugins for Document(Type)Definition message (#3846)
* Merge definitions from all plugins for Document(Type)Definition message

- enables multiple plugins to provide Document(Type)Definition for the same message

* Remove unnecessary head usage in ghcide TestUtils

* Use Nothing for original selection when upgrading Location to LocationLink

in combineResponses of plugins to TextDocumentDefinition message

* Share combineResponses document definition and document type definition tests

* Downgrade locations to links when missing client capability in combineResponses (plugin API)

- Upgrade locations to links only when necessary (some responses are links)

* Test preserving link data in combineResponses of Definition message

* Add haddock to mergeDefinitions in plugin API

* Replace usage of OverloadedRecordDot with lenses

- to support GHC < 9.2

* Add TypeFamilies extension to TypesTests to support GHC < 9.4

* Require focus >= 1.0.3.2 to fix 9.8 build for ghcide and hls-graph

---------

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2023-11-17 09:33:25 +00: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
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
Nathan Maxson
a918c02a61
HLS for the new generated LSP 2 release (#3621) 2023-06-19 08:49:38 +03:00
HugoPeters1024
fc488d0cfa
fix ISO8601 related deprecation in time (#3654)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-06-14 17:41:40 +00: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
Michael Peyton Jones
8f0d940445
Document exception handling in Actions/Rules (#3407)
* Document exception handling in Actions/Rules

I also took the liberty of removing the `MonadFail` instance for
`Rules`, since failing in `Rules` seems much worse as it won't
automatically be caught. There was only one use of that, which now has
an appropriately threatening comment.

* Tweak

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-01-02 12:51:56 +00:00
Zubin Duggal
2df68246f8 Prepare release 1.9.0.0 2022-12-26 16:09:25 +05:30
Ruslan Gadeev
5d56aa70a8
fix typos (#3325)
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2022-11-09 17:42:12 +00:00
Zubin Duggal
94cd24d9e4 Fix testing hls-graph 2022-10-24 14:50:37 +05:30
Zubin Duggal
3b64a3b1c5 Introduce KeyMap and KeySet 2022-10-24 14:50:37 +05:30
Zubin Duggal
ada1b3dc13 hls-graph - avoid duplicating key texts 2022-10-24 14:50:37 +05:30
wz1000
eafda04529 Update hls-graph/src/Development/IDE/Graph/Internal/Types.hs
Co-authored-by: Pepe Iborra <pepeiborra@gmail.com>
2022-10-24 14:50:37 +05:30
Zubin Duggal
e99772d2d7 Implement sharing for hls-graph Keys 2022-10-24 14:50:37 +05:30
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
Pepe Iborra
9b491f7bbf
Drop compatibility with GHC 8.6.5 (#3101)
* Drop compatibility with GHC 8.6.5

* drop a few more bits

* fixup merge

Co-authored-by: Javier Neira <atreyu.bbb@gmail.com>
2022-10-11 12:18:49 +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
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
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
Dmitry Pogodin
347a7187f2
Run pre-commit hooks (#3059) 2022-07-28 16:48:13 +00:00
ˌbodʲɪˈɡrʲim
ffefe761c8
hls-graph: add lower bound for async (#3021)
`Control.Concurrent.Async` is not available before `async-2.0`

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-07-06 23:17:38 +00:00
Michael Peyton Jones
510bd51e46
Remove some partial functions from Shake.hs (#2986)
Also removes a partial pattern match from Action.hs.
2022-06-29 09:00:49 +01:00
Zubin Duggal
c047b052b1 Generate bytecode/object code on demand
Adds a new rule `GetLinkable` which is called on demand by
hscCompileCoreExprHook whenever a linkable is required for a splice.

Adds a MonadUnliftIO instance for Action to faciliate the above

We write Core Files whenever a linkable could potentially be required for a file
(i.e it is in the transitive closure of a module that uses TH/compile time code
execution)

However, we only generate byte/object code when such a linkable is
really required by a splice (i.e. the module is in the transitive closure
of any symbol called from a splice).

No linkables are stored in `HiFileResult`. If a linkable is required, then
it must be obtained via a call to `GetLinkable`.

Also use hashes to do fine grained recompilation checking for TH instead of
mod times. This simplifies recompilation checking quite a bit.
2022-06-20 02:31:10 +05:30
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
Zubin Duggal
41b30b5706 Prepare 1.7.0.0 2022-04-21 14:08:10 +05:30
Pepe Iborra
8466bc11a6
work on the sync computations first (#2805) 2022-03-29 12:22:24 +00:00
Pepe Iborra
30d48ed705
Fix 2 space leaks (#2774)
* Fix a space leak in hls-graph

* Fix leak in ExportsMap and optimize
2022-03-15 19:13:00 +00:00
Pepe Iborra
fbbf76b146
Review masking and add traces when things don't cancel timely (#2768)
* Review masking and add traces when things don't cancel timely

* fixup

* use sleep consistently

* redundant imports

* hlints

* fix 9.2 build

* Fix 9.2 build for real

* remove unnecessary polymorphism

* Avoid spawning loop async unnecessrily

* flush asyncs ref

* Add comments and apply @michaelpj suggestions
2022-03-11 10:35:37 +00:00
Pepe Iborra
6a8dc225ae
Implement cycle detection in hls-graph (#2756) 2022-03-08 10:34:57 +00:00
Pepe Iborra
30b3fec2f0
Adjust rendering of error logs and drop unneeded MonadUnliftIO instance (#2755)
* drop unneeded MonadUnliftIO instance

* Adjust error message

* fixups
2022-03-06 14:29:20 +00:00
Pepe Iborra
b7f37ad2be
Estimate file versions safely (#2753)
* applyWithoutDependency

* delete dead code

* estimateFileVersionUnsafely

For a long time, defineEarlyCutoff has been accessing the Values store directly
to compute GetModificationTime values instead of calling use, breaking the
invariant. The values are used to associate the rule result to a file version,
which gets recorded in the Value as well as used as the key in the Diagnostics
store.

The problem here is that the GetModificationTime rule computes a new version and
mutates the Values store, so if defineEarlyCutoff peeks in the store before
GetModificationTime has run, it will grab the old version. This leads to lost
diagnostics and potentially to misversioned Values

Fixing the problem is tricky, because we cannot simply use GetModificationTime
inside defineEarlyCutoff for all rules. There are three issues:

1. Creating a dependency on GetModificationTime. If everything depends on it,
then we lose the ability to do early cutoff
2. Creating cycles in the build graph, since GetModificationTime has
dependencies itself. Because hls-graph doesn't implement cycle detection (Shake
did), it is a nightmare to debug these cycles.
3. Creating overhead, since GetModification time calls the file system for non
FOIs and in the past this was very expensive for projects with large cartesian
product of module paths and source folders

To work around these I had to introduce a new hls-graph primitive,
applyWithoutDependency, as well as do a bunch of fragile type tests on the key
type to decide on whether to use GetModificationTime or peek into the values
store. The type casts could be cleaned up by introducing a type class, but I'm
not sure the end result would be any better.

To understand the issue and debug the implementation of the fix, I added a
number of opentelemety traces which I'm leaving in place in case they could be
useful in the future.

* Traces for diagnostics

* handle the empty file path

* return Nothing instead of peeking the store
2022-03-06 11:10:21 +00:00