Commit Graph

3648 Commits

Author SHA1 Message Date
Zubin Duggal
13e579519d ci: upgrade macOS runners to macOS 12 2024-07-05 14:51:10 +05:30
Zubin Duggal
636b194edf ci: work around centos7 deprecation 2024-07-05 14:51:10 +05:30
Zubin Duggal
d72a6a0bec Prepare release 2.9.0.1
This is a bindist only release with no code changes
2024-07-05 14:51:10 +05:30
soulomoon
fa48fdaa69
Fix core file location in GetLinkable (#4347)
Fix #4145
The error case is demonstrated in #4145 (comment)

Include ModLocation in the ModSummaryResult fingerprint.
Instead of getting the core file location from GetModSummary, get it from the result of GetModIface directly since that is the actual location the core file written to.
2024-07-04 22:27:20 +08:00
soulomoon
f0ba40baf6
capture error in worker thread (#4342)
* use safe try that does not catch the asyncException
2024-07-02 21:29:18 +08:00
soulomoon
012e809054
Simplify initPlugins (#4344)
* simplify initPlugins

* fix cabal

* remove initializePlugins

---------

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2024-07-01 12:20:41 +00:00
soulomoon
1f5c60d068
ignore simple-multi-def-test for windows since #4270 (#4345) 2024-07-01 10:49:10 +00:00
soulomoon
495af1f565
Formalize the ProgressReporting Type (#4335)
* add ProgressReportingNoTrace

* fix doc

* cleanup

* stylish

* turn ProgressReporting into IO

* rename

* Revert "rename"

This reverts commit 03961fa085.

* rename

* rename to PerFileProgressReporting

* prefix hidden field with `_`
2024-06-30 16:45:02 +00:00
soulomoon
376f7f1802
fix future index time (#4343) 2024-06-29 19:50:34 +00:00
Jan Hrcek
124691f950
Cleanup disabled warnings (#4341)
* Cleanup unnecessarily disabled warnings

* Fix stack nighly build

* stylish
2024-06-28 15:38:40 +01:00
Jan Hrcek
147fb4a291
Cleanup imports after CPP removal + few hlint fixes (#4337) 2024-06-27 06:38:22 +02:00
soulomoon
f523690ada
Migrate indexHieFile progress notification to ProgressReporting API (#4205)
What's done
1. Refactor ProgressReporting to allow external state management
2. Migrate `indexHieFile` progress to ProgressReporting API
3. Add Note [ProgressReporting API and InProgressState] to demonstrate the current status
2024-06-20 18:17:44 +00:00
Michael Peyton Jones
2f00507d97
Remove final allow-newer for 9.10 (#4329)
* Remove final allow-newer for 9.10

Revised on hackage

* Bound cabal-gild to avoid new broken versions
2024-06-20 18:13:36 +01:00
Jan Hrček
54f41086ea Remove unused exactprint dep 2024-06-20 09:03:31 +01:00
Jan Hrček
f95b6175e0 More stylish 2024-06-20 09:03:31 +01:00
Jan Hrček
bd29bc52fb Use newer cabal-fmt, partially lift ghc version restriction 2024-06-20 09:03:31 +01:00
Jan Hrček
e4128a4458 stylish 2024-06-20 09:03:31 +01:00
Jan Hrček
3b24251536 Cleanup CI configs and cabal files 2024-06-20 09:03:31 +01:00
Jan Hrček
cd44ab0ee3 More no-op code cleanup 2024-06-20 09:03:31 +01:00
Jan Hrček
06920497b7 Remove no-longer-needed compat code, remove unused stuff 2024-06-20 09:03:31 +01:00
Zubin Duggal
9d3480a9bc Remove pre-multi component junk for GHC <= 9.2 2024-06-20 09:03:31 +01:00
Michael Peyton Jones
617542dc9c Fix stylish 2024-06-20 09:03:31 +01:00
Michael Peyton Jones
65391062a0 Fix a few things 2024-06-20 09:03:31 +01:00
Michael Peyton Jones
a37a4565e9 Remove from CI 2024-06-20 09:03:31 +01:00
Michael Peyton Jones
e5f3455b95 Update docs 2024-06-20 09:03:31 +01:00
Michael Peyton Jones
e217112604 Fix loss of 9.2 GHC version 2024-06-20 09:03:31 +01:00
Michael Peyton Jones
512fa5c305 More CPP 2024-06-20 09:03:31 +01:00
Michael Peyton Jones
a478a75c29 WIP evaluate CPP 2024-06-20 09:03:31 +01:00
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
VeryMilkyJoe
62892ae546
Add completion for import fields in cabal files (#4305)
At the moment import fields always suggest any common stanza names
occuring in the file, while it should be only the ones defined before
the cursor position.

Also moves all CabalFields utility into a separate module

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2024-06-16 21:15:50 +00:00
Julian Ospald
da3d7f27ea
Refine GHC deprecation policy (#3438)
* Refine GHC deprecation policy

* Update docs/support/ghc-version-support.md

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

* Update docs/support/ghc-version-support.md

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

* Reword to support status, as this is mentioned above

* Include ghcup recommended version in support discussion

* reword

* Reword

---------

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
Co-authored-by: Fendor <fendor@posteo.de>
Co-authored-by: soulomoon <fwy996602672@gmail.com>
2024-06-15 12:11:18 +01:00
Michael Peyton Jones
792fb064a0
Bump nix shells
- Remove shell definitions for old versions
- Add GHC 9.10
- Bump to new nixpkgs-unstable
2024-06-14 14:17:49 +01:00
Jan Hrcek
cde9d78bea
Cleanup allow-newer for ghc 9.10 (#4320) 2024-06-14 10:15:00 +02:00
Brandon Chinn
4b344d3346
Add support for Fourmolu 0.16 (#4314) 2024-06-14 07:26:59 +02:00
Matthew Pickering
426b068f52
Fix quadratic memory usage in GetLocatedImports (#4318)
At startup `GetLocatedImports` is called on all known files. Say you
have 10000 modules in your project then this leads to 10000 calls to
GetLocatedImports running concurrently.

In `GetLocatedImports` the known targets are consulted and the
targetsMap is created by mapping the known targets. This map is used for
introducing sharing amongst filepaths.  This operation copies a local
copy of the `target` map which is local to the rule.

```
let targetsMap = HMap.mapWithKey const targets
```

So now each rule has a hashmap of size 10000 held locally to it and
depending on how the threads are scheduled there will be 10000^2
elements in total allocated in hashmaps. This used a lot of memory.

Solution: Return the normalising map in the result of the
`GetKnownTargets` rule so it is shared across threads.

Fixes #4317
2024-06-13 17:32:03 +00: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
Jan Hrcek
c11f32b62a
Bump stack configs + CI to 9.6.5 and 9.8.2 (#4316) 2024-06-12 19:37:52 +02:00
Leif Battermann
597da9d5c1
Code action to remove redundant record field import (fixes #4220) (#4308) 2024-06-11 07:03:42 +02:00
awjchen
cebd641d06
Use restricted monad for plugins (#4057) (#4304)
* Use restricted monad for plugins (#4057)

* Renaming: PluginM -> HandlerM

* Explain intent for HandlerM

* Fix comment

* Apply stylish-haskell
2024-06-10 10:02:58 +00:00
VeryMilkyJoe
59abb96283
Call useWithStale instead of useWithStaleFast when calling ParseCabalFields (#4294)
Add documentation about this choice

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2024-06-09 16:15:07 +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
VeryMilkyJoe
efe89133b1
Add common stanza to completion data (#4286)
This allows fields and values to be completed correctly inside common
stanzas

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2024-06-09 10:34:35 +00:00
wz1000
c3236eb4d1
ghcide: drop ghc-check and ghc-paths dependency (#4291)
* ghcide: drop ghc-check and ghc-paths dependency

We don't really need these, as we don't use any of the fancy abi-hash
checking features in ghc-check and instead rely on a wrapper script
to do this.

* Fix stylish

---------

Co-authored-by: soulomoon <fwy996602672@gmail.com>
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2024-06-09 09:45:40 +00:00
Akshay Mankar
7b8e2e5045
Limit number of valid hole fits to 10 (#4288)
* ghcide: Pass -fmax-valid-hole-fits=10 to GHC

In cases where GHC doesn't know anything about the type of a hole, it suggests
every available symbol as a hole fit, which can cause editors to crash or at
least be very slow. 10 seems to be a fair number to limit hole fits to.

* hls-refactor-plugin: Ignore "Some hole fits suppressed" message when valid hole fits are limited

* hls-refactor-plugin: More predictable hole fit for test

Now that we limit number of hole fits recommended by GHC, the test that
hopes to find `+` being recommended for `Int -> Int -> Int` becomes
unpredictable because there are too many symbols which match that type
and the sorting has little control over which symbols get recommended.

There are way fewer matches for `(Int -> Maybe Int) -> Maybe Int ->
Maybe Int`, so it makes the test consistently succeed.

---------

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2024-06-09 08:52:44 +00:00
wz1000
026d0cef5a
FindImports: ThisPkg means some home unit, not "this" unit (#4284)
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2024-06-09 08:00:54 +00:00
Andrei Dziahel
52c953c802
test: add test documenting #806 (#4292)
Co-authored-by: soulomoon <fwy996602672@gmail.com>
2024-06-09 14:47:55 +08:00
soulomoon
82da33707f
Unify critical session running in hls (#4256)
* add thread to do shake restart
* run session loader in thread

---------

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2024-06-08 19:18:59 +00:00
dependabot[bot]
75634393d5
Bump cachix/cachix-action from 14 to 15 (#4255)
Bumps [cachix/cachix-action](https://github.com/cachix/cachix-action) from 14 to 15.
- [Release notes](https://github.com/cachix/cachix-action/releases)
- [Commits](https://github.com/cachix/cachix-action/compare/v14...v15)

---
updated-dependencies:
- dependency-name: cachix/cachix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2024-06-06 16:15:03 +00:00
soulomoon
8271db467e
Remove redudant absolutization in session loader (#4280) 2024-06-06 14:51:32 +00:00
Michael Peyton Jones
71aa2d38e0
Bump to new lsp versions (#4279) 2024-06-06 13:19:32 +00:00