Add code action for incorrect field names in cabal files
The codeactions will suggest possible corrections for unknown field names in a cabal file.
---------
Co-authored-by: Fendor <fendor@posteo.de>
Co-authored-by: Jana Chadt <jana.chadt@nets.at>
* Provide explicit import in inlay hints
* Filter explict imports inlay hints by visible range
* Update lsp dep by source-repository-package
to writing test before new release of haskell/lsp.
* Add test for hls-explicit-imports-plugin inlay hints
* Comment inlay hints start position
* Use `isSubrangeOf` to test if the range is visible
* Remove inlayHintsResolveProvider placeholder for now
* Use explicit InlayHintKind_Type
* Revert "Update lsp dep by source-repository-package"
This reverts commit 245049a580.
* Combine InlayHints by sconcat them
and remove `instance PluginRequestMethod Method_InlayHintResolve`
since have not decide how to combine.
* compress multiple spaces in abbr import tilte
* update test to match inlay hints kind
* rename squashedAbbreviateImportTitle to abbreviateImportTitleWithoutModule
* Request inlay hints with testEdits
* ExplicitImports fallback to codelens when inlay hints not support
* fix explicitImports inlayHints test
* simplify isInlayHintsSupported
* comment fallback
* empty list instead of null codeLens
* clearify name `paddingLeft`
* fix clientCapabilities
* add test for inlay hints without its client caps
* use codeActionNoInlayHintsCaps to avoid error
* simplify isInlayHintSupported
* comment about paddingLeft
* use null as inlay hints kind
* add tooltip for explicit imports inlay hints to improve UX
* chore comments
* refactor
* comment InL [] to indicate no info
* ignore refine inlay hints
* add plcInlayHintsOn config
* update func-test
* keep order to make Parser works
* always provide refine in code lens
---------
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
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.
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
* 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>
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>
* 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>
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
* 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>
* 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>
* 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>