* Another attempt at using the lsp API for some progress reporting
* Fixing tests
* Remove trace
* Make splice plugin tests not depend on progress
* More test fixing
* Switch to hackage
* stack
* warnings
* more
* Put tests back
---------
Co-authored-by: Patrick <fwy996602672@gmail.com>
We add an option to `Config` that allows clients to specify how HLS
should load components.
We support two loading strategies:
* SessionLoadSingleComponent: Always load only a single component
when a new component is discovered.
* SessionLoadMultipleComponents: Always allow the cradle to load
multiple components at once. This might not be always possible,
e.g., if the tool doesn't support multiple components loading.
The cradle decides how to handle these situations.
By default, we use the conservative `SessionLoadSingleComponent` mode.
Additionally, changing the config at run-time leads to a reload of the
GHC session, allowing users to switch between the modes without
restarting the full server.
* 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>
* 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
* Bump stan
Needed in order to get the functions for getting the config, etc.
* Use stan config files for stan plugin (#3904)
* Add test case for .stan.toml configuration
* Fix windows tests
See https://github.com/kowainik/stan/issues/531
---------
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
* Implement semantic tokens lsp plugin draft
* SemanticTokens: combine information extracted from HieAst
* clean up
* map to default token types in lsp
* use lsp makeSemanticTokens to convert to lsp SemanticTokens type
* add test and cleanup
* refine semantic type to default one in lsp
* Use tokens from hieAst instead of renamedSource and add test
* use customize RefMap to get semantic type
* use refMap from useAsts
* Also compute imported names
* Also compute semantic type from TyThing
* Fix dependencies version
* fix version
* Retrieve nameSet from renamedSource to prevent names not visible(Such as by instance deriving) being handled
* add hlint config to ignore test data
* cean up test data
* revert flake.nix
* Rename query.hs to Query.hs
* Build: add semantic tokens to lts21
* Refactor and add README
* Semantic token, filter names in Ast
* CI: add consistancy check for wether semantic tokens computations is stable across different ghc versions
* Update documentation, cleanup test, remove default modifiers
* Fix: IO now classfied to TTypcon, add test for GADT and data family, Update documentation
* Restore stack.yaml
* fix stack build
* Refactor, move out ActualToken to Mappings and use ide logger
* Refactor: toLspTokenType should return Maybe type
* Stop use stale hieAst
* add getImportedNameSemanticRule rule to semantic tokens plugin
* do not retrieve hie in getImportedNameSemanticRule
* fix: add description for semantic tokens
* remove TValBind and TPaternBind and Use TFunction and TVariable instead
* cleanup
* Refactor useWithStaleMT and took care of the token range using position map
* fix build for 9.4
* refactor, use golden test
* refactor, use ExceptT for computeSemanticTokens
* Fix 9.2
* add persistentSemanticMapRule to prevent semantic tokens block on startup
* Fix, use hieKind instead of cast the type directly
* add options to turn semantic tokens on and off
* Disable stan plugin by default (#3917)
* Fix positionMapping in stale data (#3920)
* Fix positionMapping in stale data
* add test for updatePositionMapping
* add comment to demonstrate addOldDelta
* cleanup
* fix: for local variable, extract type from contextInfo instead of bind site, thus function in pattern binds can also be indentified
* clean up
* Update plugins/hls-semantic-tokens-plugin/src/Ide/Plugin/SemanticTokens/Query.hs
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
* refactor: remove TNothing and compact the test output
* refactor: rename SemanticTokenType to HsSemanticTokenType to avoid confusion with lsp' SemanticTokenTypes
* refactor: push the computation of semantic token type to getSemanticTokensRule
* update documentation
* cleanup hieAstSpanNames
* remove renamed source from getSemanticTokensRule and optimize query function for semantic token type
* try to exclude names that is not visible in hie and cleanup
* add HieFunMaskKind, it is to differ wether a type at type index is a function or non-function
* expose function flag to expose (=>, ->, -=>, ==>)
* 1. Relax GetDocMap kindMap to get TyThing for more than type variables.
2. Backport isVisibleFunArg
* use customize logger, add test for unicode
* fix: handle unicode in semantic tokens
* update KindMap to TyThingMap
* cleanup
* add realSrcSpanToCodePointRange, realSrcLocToCodePointPosition to Development.IDE.GHC.Error
* add Note [Semantic information from Multiple Sources]
* move recoverFunMaskArray to Mappings.hs
* fix test, data.Set might not appear
* fix: handle semantic tokens with more than one ast
* fix: instance PluginMethod Request Method_TextDocumentSemanticTokensFull
* clean up
* turn semantic tokens off by default
* fix doc
* clean up doc
---------
Co-authored-by: fendor <fendor@users.noreply.github.com>
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
* Add support for the multi unit argument syntax introduced in GHC 9.4: https://downloads.haskell.org/ghc/9.4.4/docs/users_guide/using.html#multiple-home-units
We now support arguments of the form
```
-unit @unitA -unit @unitB
```
where the response files `unitA` and `unitB` contain the actual list of arguments for that unit:
```
-this-unit-id a-0.1.0.0
-i
-isrc
A1
A2
```
Also refactor the session loader and simplify it.
Also adds error messages on GHC 9.4 if the units are not closed (#3422).
fixes
Fix closure check
session-loader: override old units with new in multi-unit support
Remove implicit-hie
session-loader: remember which files caused old components to be loaded, and
also pass them on to hie-bios so it can in turn pass them to `cabal repl` when
loading newer components.
This allows us to create valid set of build flags encompassing both the old and
new components, and the closure of all components in between.
The observation is that if you want to load some components X, Y, Z and so on,
cabal repl X Y Z ... will be more likely to give you a valid multi component
build plan/flags than cabal repl all, or any way of combining the results of
cabal repl X, cabal repl Y ...
Use new hie-bios
Move implicit cradles to HLS
Fix build on 9.0
Werror
Improve handling of specialTarget
* hie-bios doesn't mention the component name in the message anymore
* stack fixes
* wrapper: remove unused argument
* werror
* werror
* Implicit cradle: match implicit-hie-cradle logic
* Fix eval plugin
* ignore multi unit tests on 9.2
* Some fixes for 9.2
* Add hie.yaml for call-hierarchy-plugin tests
* Add hie.yaml for explicit-record-fields-plugin
* Add hie.yaml for hls-overloaded-record-dot-plugin
- entropy has had bounds revised in
- basement/hw-prim bounds empirically unnecessariy
- hyphenation was for wingman
- bound hlint to a version that uses ghc-lib by default
- stylish-haskell has never had a ghc-lib flag
- none of the versions of fourmolu that we use have a fixity-th flag
- remove some other things that lack justification speculatively
* Remove fourmolu pin in stack.yaml
* Require fourmolu >= 0.9
* Use specific versions of fourmolu for each version of GHC
---------
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
* 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
Includes:
* completions for keywords, sensitive to stanzas
* value completions for constant values, files, directories and exposed modules
* completion of snippets for different stanzas and the required basic fields
* overloaded record dot plugin initial version (closes#3350)
* Added support to GHC 9.2, and updated documentation
Also, update the CI to test overloaded-record-dot-plugin
and added overloaded-record-dot-plugin to stack.yml
* Apply suggestions from Lei Zhu (July541)
Co-authored-by: Lei Zhu <julytreee@gmail.com>
* Use GHC2021 and updated gif
* Fix test.yml formatting problem
* use coerce instead of unExt (from michaelpj)
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
* Implements michaelpj code review suggestions
* Collect records on lists instead of maybe
This way we don't need to switch back and forward between the two,
and we can also return more than one match from inside a HsExpanded
* Added documentation
* Reworded comments for spelling and clarity
* use useWithStale for the TypeCheck rule
* Update version to conform with changes on master
* No longer depend on specific hls package versions
* Fixed comments and line length issues
* Added test for HsExpanded expressions
---------
Co-authored-by: Lei Zhu <julytreee@gmail.com>
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
* 9.6 support
Fixes
hls-refactor-plugin 9.6 support
hls-gadt-plugin
Fix 9.4 build
Fixes
hls-gadt-plugin fixes
WIP 9.6 patches
fixes
fixes
fixes
fixes
fixes
Fixes and add CI
CI
CI fixes
patch haskell/actions for https://github.com/haskell/ghcup-hs/issues/783
CI fixes
CI fixes
CI fixes
CI
CI
CI
CI
CI
Fix build on 9.0
Fix build on 9.0
hls-splice-plugin 9.6 compat
fixes
fixes
fixes
fixes
Fix benchmark build errors
9.2.5 and 8.10.7 had build errors when running benchmarks due to `mfsolve`
test suite having duplicate instances, so stop building tests for
mfsolve (see: https://github.com/kuribas/mfsolve/issues/8). Also,
`http2-4.0.0` has a parse error due to a misplaced haddock comment that
causes build failure with `-haddock`. It is fixed in the latest commit
of the source repo, so use that in the `cabal.project` for now.
Checkout correct commit on `pull_request` in CI
By default, the `pull_request` event has a `GITHUB_SHA` env variable set to the
"last merge commit on the GITHUB_REF branch"
(see https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request).
But we want to check out the latest commit on the branch whether or not it is a
merge commit. This commit changes the CI actions to do just that.
fixes
Use head.hackage for 9.4
Only use head.hackage for 9.5 and up
Reverts the change that caused head.hackage to be used for 9.4 as
well
Reintroduce source-repo-package for ekg-json
Fix refactor plugin tests
Fix missing constraint detection in refactor plugin
ghc 9.6+ allow newer unordered-containers:template-haskell
Some refactor tests no longer broken for 9.2
Fix simple-multi-test on 9.6
Mark simple-plugin as broken on 9.6
func-test fixes
Disable unsupported plugins on 9.6
Eval plugin fixes
Eval plugin test fixes, debug output in CI script
Restore 'working' setup/actions
WIP Fix GHC prerelease windows install
Fix eval plugin T11
fixes
Eval plugin fixes
Fix splice plugin test
Mark `simple plugin` ghcide test broken on 9.6
fixes
fixes
Use GHC 9.6-rc1 in CI
Try using 9.6.1 for CI
* 9.6 nix
* Remove head.hackage
* fixes
* fixes
* fixes
* fixes
* fixes
* fixes
* Extract cabal plugin in its own package
* hls-cabal-plugin: Add plugin
Add golden parse test for test/testdata/simple.cabal
Add module Ide.Plugin.Cabal.Diag
Also: add -Wall
Add parseCabalFileContents
Use VFS for cabal file contents
Diagnostics
* Parse and display Errors
* Parse and display Warnings
Code Actions
* Code Action for License Field
* Add CI workflow
* Add test-suite for hls-cabal-plugin
* Fix various cabal issues
* Update Codeowners file for hls-cabal-plugin
* Document Bytestring is UTF-8 encoded
Co-authored-by: Julian Ospald <hasufell@posteo.de>
* Remove code duplication
* Add cabal files of interest and kick function
Configure a "kick" function for cabal files that is run when the shake
queue needs to be restarted.
Copy pastes from ghcide and 'files of interest'. Maybe more abstraction
needed.
* Add more documentation
* Mark flaky test-case as flaky with issue ref
* Make fendor the only CODEOWNER for hls-cabal-plugin
* Add missing extra-source-files for hls-cabal-plugin
* Add proper CHANGELOG entry for the first version of hls-cabal-plugin
* Add support for Cabal 3.8
* Set diagnostics source to cabal
* Remove unused function
* Add unit tests for code action utilities
* Remove overly specific logging of diagnostics from hls-cabal-plugin
* Improve logging for Cabal FOIs
* Add Range manipulation functions
* Use Range manipulation functions from hls-plugin-api
* Add more documentation for crucial shake restart function
* Add hls-cabal-plugin features to features.md
* Re-use existing GetFileContents rule
Co-authored-by: Fendor <power.walross@gmail.com>
Co-authored-by: fendor <fendor@users.noreply.github.com>
Co-authored-by: Julian Ospald <hasufell@posteo.de>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Add plugin for formatting cabal files using cabal-fmt
* Add 'isolateTests' cabal flag to make plugin install cabal-fmt
For CI, we want to run the tests with a specific cabal-fmt version,
installed automatically by cabal.
However, locally, we might want to test with a locally installed
cabal-fmt version.
This flag allows developers to either let cabal install the
build-tool-depends or install a fitting version locally.
* Ignore failing cabal-fmt test on windows
* Add log message for missing cabal-fmt executable
Co-authored-by: Jana Chadt <jana.chadt@tuwien.ac.at>
Co-authored-by: Fendor <power.walross@gmail.com>
* Initial working version
* Auto-add puns pragma, fix behavior with Hs98 fields
* Patch pragma so it adds NamedFieldPuns instead of RecordPuns
* Refactor big do block
* Make it work with record construction
* Convert to a rule based approach
* Cleanup, remove dead code
* Make it compile with all supported GHC versions
* Add tests
* Minor code reorganization
* Move common pragma logic to same file
* Remove strictness annotations
* Improve documentation
* Use interval map for efficient range filtering
* Add external documentation
* Add tests to GitHub CI
* Add debug log for collected records
* Add `getExtensions` to ghcide
* Indicate that it doesn't work with GHC 9.4
https://github.com/haskell/haskell-language-server/pull/3304#discussion_r1008034647
* Relax version bounds on base
* Add plugin to stack packages
* Add GHC 8.10 support
* Fix GHC 9.4 build failure
* Make `conPatDetails` total
* Revert "Indicate that it doesn't work with GHC 9.4"
This reverts commit 57646d35ad.
* Fix unused import caused by new compat exports
* Fix ConPat construction in GHC 8.10
* Rename test-suite to make it shorter
* Fix nix build by collecting latest hw-prim from Hackage
Co-authored-by: Pepe Iborra <pepeiborra@gmail.com>
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
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
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
* upgrade lsp to 1.5
* fix stack.yaml
* try fix tests
* disable verbose logging in ghcide
* fix more tests in ghcide
* fix floskell test
* disable debug log in func-test
* disable debug log in lsp itself
* Revert "disable debug log in func-test"
This reverts commit 1fd6658c77.
* remove unused import
* fix hls test utils
* upgrade lsp in nix
* fix func-tests
* Revert "fix func-tests"
This reverts commit 2ecd76d0ba.
* fix waitForDiagnosticsFromSourceWithTimeout
* use Null as dummy message in waitForDiagnosticsFromSourceWithTimeout
* simplify a test case
* add comment about lsp bad logs
* init hls-explicit-fixity-plugin
* Update dependencies
* Refactor: Prevent block on startup
* Run pre-commit
* Compatibility: Add emptyMessages
* Remove unused ModIface
* Comment why to make this plugin a lower priority
* Provide hover content while testing fail
* Avoid lambda
* 4 space indent
* Pass Text instead of Name
Co-authored-by: Pepe Iborra <pepeiborra@gmail.com>
* update Gitpod config
* update nix shellHook & docs
* install pre-commit hook
* add kokobd as code owner to .gitpod.*
* add gen-hie to Gitpod
* add tools for doc
* remove .pre-commit-config.yaml from .gitignore
* set vscode formatter to stylish-haskell in Gitpod
* refactor selection range plugin
* refine selection range
* add CodeKind to CodeRange
* rename hls-selection-range-plugin to hls-code-range-plugin
* update docs about selection range
* cleanup RuleTypes.hs
* add the missing bang pattern
* fix subRange
* add some unit tests to CodeRange.Rules
* add tests for removeInterleaving
* add even more tests
* fix extra sources
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>