Commit Graph

3633 Commits

Author SHA1 Message Date
Jan Hrcek
7b6986ba8c
Fix -Wall in retrie plugin (#4071)
* Fix -Wall in retrie plugin

* Fix ImportDecl initialization across ghc versions
2024-02-14 18:46:26 +01:00
Jan Hrcek
409bf3ba83
Fix -Wall in qualified imported names plugin (#4070) 2024-02-12 18:47:58 +01:00
Jan Hrcek
0ccb1784a8
Upgrade from deprecated haskell/actions/setup to haskell-actions/setup in benchmarks (#4068) 2024-02-12 12:20:08 +00:00
Jan Hrcek
f844a29a9e
Fix -Wall in refactor plugin (#4065)
* Fix -Wall in refactor plugin

* Fix hlint warnings

* stylish-haskell
2024-02-12 09:23:32 +01:00
Jan Hrcek
1bbe7806ac
Fix weird behavior of OPTIONS_GHC completions (fixes #3908) (#4031) 2024-02-10 10:20:48 +01:00
Jan Hrcek
e37ec7dbb3
Enable pedantic for more components (#4061) 2024-02-09 15:17:34 +01:00
Jan Hrcek
b115dc34f4
stack CI: switch to offic. haskell images, bump to lts-22.9 (ghc 9.6.4) (#4060)
* Bump to ghc 9.6.4 based lts-22.9

* Try more recent haskell image

* Fool around

* Cleanup and rename back to nightly

---------

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2024-02-09 09:38:13 +00:00
Jan Hrcek
d8445f4eae
Bump haskell-actions/setup to get 9.6.4 in CI (#4062) 2024-02-09 09:37:29 +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
9021c39925
Add -Wunused-packages to common warnings (#4053)
* Add -Wunused-packages to common warnings

* Get rid of common deps

* Wrapper needs process on windows

* Refine

* Does it work like this?

* More cleanups in ghcide

* Fix build with stack

* Also fix stack --test

* Less noisy workaround

* Fix new warnings
2024-02-08 15:26:21 +00:00
soulomoon
03efae66ab
improve test (#4059) 2024-02-08 12:06:35 +00:00
soulomoon
3c511b0b03
Optimize semantic token extraction logic (#4050)
A follow up of #3958 , we have added a tokenizor to walk the hieAst along with the file rope, it means we no longer need to do the detour of storing temperal result as Map Range (Set identifier), instead we can optimize by fusing most of the logic into tokenizer and return [(Range, HsSemanticTokenType)] directly.
2024-02-07 18:07:13 +00:00
wz1000
2f33f8fe46
Bump ghcide-test-utils to 2.0.0.0 (#4058)
* Bump ghcide-test-utils to 2.0.0.0

We need this so we can release a version compatible with 2.6.0.0

I will need to make hackage revisions to all the plugin packages that depend on it

* update ghcide-test-utils tested with
2024-02-07 15:51:39 +00:00
soulomoon
cd959ae8b2
fix isClassNodeIdentifier in hls-class-plugin (#4020)
Partially fix #3942, by handling isClassNodeIdentifier correctly.

---------

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2024-02-07 12:27:41 +00:00
Jan Hrcek
c2a795292b
Promote more warnings to errors in ghcide (#4054)
* Promote more warnings to errors in ghcide

* Small simplifications
2024-02-07 10:05:29 +00: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
c3abd82269
Disable caching job with ghc 9.2 on windows (#4043) 2024-02-04 17:28:12 +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
da337bc723
Set test options via cabal.project (#4039)
* Set test options via cabal.project

This means we can set the default properly for people using the project,
and also set things more simply in the test workflow.

* Set options after testing hls-graph

* Revert "Set options after testing hls-graph"

This reverts commit 73fa801315.

* Quote filters

* Use cabal configure instead

* Try better
2024-02-03 20:43:38 +00:00
soulomoon
71bd04b2d5
fix subtraction (#4041) 2024-02-03 16:38:09 +00:00
Lei Zhu
a3da824b0a
Fix it (#4038) 2024-02-03 13:48:49 +00:00
soulomoon
d99d919c9e
semantic tokens: add infix operator (#4030)
* add infix operator

* add test

* mark all infix operator to have operator semantic type

* update scheme

* fix test

* fix more test
2024-02-03 11:01:50 +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
Jan Hrcek
a0baa4d09e
Fix -Wall and -Wunused-packages in stan plugin (#4014)
* Fix -Wall and -Wunused-packages in stan plugin

* Rename binding

---------

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2024-02-02 07:48:58 +00:00
ktf
5c1163655a
Use relative file paths for HIE files and Stan's config maps (#4023)
* Use relative file paths for HIE files and Stan's config maps

Stan expects relative paths. Without this change, file names won't map
correctly to their associated language extension data, which means no
enabled extensions will be detected. This causes annoying false
positives with, e.g., the `StrictData` extension. (See issue #3174.)

* Un-exclude Stan diagnostics related to `StrictData`

We specifically want to test this diagnostic, so we need it to fire.

* Add tests to ensure the Stan plugin detects a module's language extensions

Includes test cases for both `LANGUAGE` pragmas and extensions enabled
in a project's `.cabal` file.

* Tighten up Stan plugin language extension test cases

These changes ensure that the tests will fail given bad mappings in
either the `cabalExtensionsMap` OR the `checksMap`. Either of these
could cause bad behavior as seen in issue #3174.

* Use correct extension/file mappings even in the case of a config fiasco

The Stan plugin will still operate as expected even if we can't load a
config -- it will simply default to showing all inspections.

* Remove a slew of unused imports

* Use OS-agnostic path separators in tests

* Run `stylish-haskell`

* Ensure `hs-source-dirs` in test cabal files don't contain path separators

 Related to (what I assume is) a bug in Stan, or its `extensions`
 library. Regardless of OS, the `hs-source-dirs` field is prepended
 as-is to the module name to create the file paths used in the cabal
 extensions map. This means the maps won't work in Windows if your cabal
 file contains `/` path separators. Working around the limitation here
 to ensure tests work on all platforms.

---------

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-02-02 06:16:42 +00:00
Jan Hrcek
4b95e55511
Fix -Wall and -Wunused-packages in hlint plugin (#4019) 2024-02-02 04:42:31 +01:00
Jan Hrcek
70dd21ef36
Reduce the number of ad-hoc helper test functions in refactor plugin tests (#4027)
* Reuse pickActionWithTitle

* More reuse and homogeneity

* Use tasty's TestName, remove pre ghc 9.0 workaround

* Fix test on windows

---------

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2024-02-01 18:54:50 +00:00
Michael Peyton Jones
5af02dcf70
Fix various issues (#4024)
* Fix various issues

- Make sure that we are always referring to the local libraries and not
  the published Hackage packages!
    - This needs a `cabal-version` bump
- Make sure every component imports the default stanzas
- Add a `defaults` stanza for `default-language`
- Add a `tests-default` stanza for making sure test suites are built
  threaded
- Remove unnecessary warning-related `ghc-options`
- Use the `pedantic` stanza instead of manual checks for `pedantic`

* Comments
2024-02-01 15:13:53 +00:00
Michael Peyton Jones
90eed1aa25
Turn off tasty-rerun (#4028)
* Turn off tasty-rerun

* Eval plugin test fixups

* Revert "Turn off tasty-rerun"

This reverts commit 2736950515.

* Instead just turn off the test log caching

* Try this

* More eval plugin

* Add a comment
2024-02-01 10:38:09 +00:00
Mo Kweon
17aadba757
fix: a typo in docs/configuration.md (#4029) 2024-01-31 12:17:07 +01:00
Jan Hrcek
4b69dfbdd5
Fix documentation/image links (#4025)
* Fix documentation/image links

* Fix sphinx warnings
2024-01-30 11:38:14 +01:00
soulomoon
8dfcaf80b3
Semantic tokens: add module name support and improve performance and accuracy by traversing the hieAst along with source code (#3958)
fix https://github.com/haskell/haskell-language-server/issues/3957

Things have been done:
1. Switch `Name` to `Identifier` in the implementation and add `ModuleName` to the `HsSemanticTokenType`
2. Strip ``` ` ` ``` and `()`, and split out qualified names. e.g.``` `Preclude.length` ``` to ```Preclude.```  `length`
3. add tokenizer to walk ast with the souce rope to get more accurate result and faster. Should fix https://github.com/haskell/haskell-language-server/issues/3983.
4. add type sig to semanticConfig's TH result
2024-01-29 17:34:50 +00:00
Michael Peyton Jones
06ec06ce58
Merge plugins into the HLS package (#3976)
* Reorganize flags

* hls-alternate-number-format-plugin

* hls-cabal-fmt-plugin

* cabal plugin

* Class plugin

* Call hierarchy plugin

* Eval plugin

* Explicit imports plugin

* Rename plugin

* Retrie plugin

* Hlint plugin

* stan plugin

* Module name plugin

* pragmas plugin

* Splice plugin

* Qualify imported names plugin

* code range plugin

* change type signature plugin

* gadt plugin

* explicit fixity plugin

* explicit record fields plugin

* Overloaded record dot plugin

* Floskell plugin

* fourmolu plugin

* ormolu plugin

* Stylish-haskell plugin

* refactor plugin

* semantic tokesn

* fixup worklows

* Rogue cabal fmt plugin cabal file

* Fix pedantic build

* fix extra-source-files globs

* Fix test name

* Remove pointless version constraints

* Try to just exclude windows+9.2

* More

* More

* More

* more
2024-01-29 09:15:34 +00:00
Patrick Wales
4788bfca11
update hlint to 3.8 and prevent linting on testdata dir (#4018) 2024-01-26 15:17:11 +00:00
Jan Hrcek
4f473a9544
refactor plugin: add reproducer and fix for #3795 (#4016)
* refactor plugin: add reproducer for #3795, fix few warnings in test

* Simplify reproducer, first attempt at fix
2024-01-26 11:36:36 +01:00
Jan Hrcek
a29d8e8bd8
Fix -Wall and -Wunused-packages in stylish-haskell plugin (#4015)
* Fix -Wall and -Wunused-packages in stylish-haskell plugin

* Format

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-01-24 12:47:44 +00:00
Patrick Wales
a3e1f8a800
fix doc for semantic token (#4011) 2024-01-24 11:15:43 +00:00
Jan Hrcek
cd47f3ba13
Fix -Wall and -Wunused-packages in module name and overloaded record dot plugins (#4009)
* Fix -Wall and -Wunused-packages in module name and overloaded record dot
plugins

* undo import change to make stylish-haskell succeed
2024-01-24 10:03:22 +00:00
Jan Hrcek
d6553e001f
Fix -Wall and -Wunused-packages in fourmolu and ormolu plugins (#4007)
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2024-01-23 11:36:05 +00:00
Jan Hrcek
3fa2f7c69b
Fix -Wall and -Wunused-package in gadt plugin (#4008)
* Fix -Wall and -Wunused-package in gadt plugin

* stylish-haskell
2024-01-23 10:07:52 +01:00
Jan Hrcek
dc9326c4ed
Fix -Wall and -Wunused-packages in plugins api and floskell (#4005)
* Fix -Wall and -Wunused-packages in plugins api and floskell

* stylish-haskell

---------

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2024-01-22 15:50:16 +00:00
Jan Hrcek
f4f5ccea5f
Fix -Wunused-packages in test utils (#4004)
* Fix -Wunused-packages in test utils

* stylish-haskell

---------

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2024-01-22 14:25:44 +00:00
IAmParadox
af5cd2de6c
Fix issue: HLS HLint plugin doesn't preserve HLint's severities #3881 (#3902)
* Fix issue:  HLS HLint plugin doesn't preserve HLint's severities #3881

preserve severity from HLint

* Fix tests

* Only preserve error serverity from hlint

* Add comment explaining the propogation of error level serverity

---------

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2024-01-22 11:18:02 +00:00
fendor
be31326cbb
Update base lower bounds for HLS (#4000)
* Update base lower bounds for HLS

* Bump lower bound
2024-01-22 09:11:20 +00:00
Michael Peyton Jones
a253f1f9e7
Various 9.8 compat (#3998)
* Stylish-haskell now supports 9.8

* Ormolu and fourmolu already support 9.8

* New version of floskell in fact builds with 9.8

* New hlint builds with 9.8
2024-01-21 11:51:50 +00:00
Jan Hrcek
0a02832ed3
Fix most -Wall in ghcide (#3984)
* Fix most -Wall in ghcide

* Fix ghc 9.2.8

* No spaces after CPP #

---------

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-01-21 00:00:40 +00:00
Jan Hrcek
a57a0b34dc
Fix -Wall and -Wunused-packages in explicit-record-fields plugin (#3996)
* Fix -Wall and -Wunused-packages in explicit-record-fields plugin

* Don't remove  -Wwarn=incomplete-record-updates

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2024-01-20 22:43:34 +00:00
Michael Peyton Jones
456a0ebd4f
Remove an allow-newer (#3989)
* Remove an allow-newer

* Cut down the nix workflow more
2024-01-20 20:37:05 +00:00
Michael Peyton Jones
98efc37d26
Update support tables (#3987)
Now @wz1000 has fixed the exactprint plugins I think we can declare full
support for 9.8.
2024-01-20 20:35:39 +00:00