Official haskell ide support via language server (LSP). Successor of ghcide & haskell-ide-engine.
Go to file
awjchen 7385915c99
Get files from Shake VFS from within plugin handlers (#4328)
* Change return type of getFileContents from Text to Rope

- This avoids a few conversions between Rope and Text in the next commit
- Note: Syntactic changes to Development.IDE.Plugin.CodeAction around line
  2000 are to work around the following stylish-haskell failure:

plugins/hls-refactor-plugin/src/Development/IDE/Plugin/CodeAction.hs: <string>:2002:5:
error: [GHC-58481]
    parse error (possibly incorrect indentation or mismatched brackets)

* Get virtual files from the Shake VFS in plugins

This commit changes plugins to get virtual files from the Shake VFS
rather than from the language server's VFS.

- Replace `Ide.Types.pluginGetVirtualFile` with
  `Development.IDE.Core.FileStore.getFileContents`
- Replace `Ide.Types.pluginGetVersionedTextDoc` with
  `Development.IDE.Core.FileStore.getVersionedTextDoc`

* Rename `getFileContents` to `getFileModTimeContents`

* Add util functions for common cases of Shake VFS file access

* Cleanup

* Fix warning

* Install notification handlers for cabal files

The cabal formatters read the file contents from the shake VFS. Thus, we
need to make sure there are notification handlers that add the cabal
files to the VFS!

Formatters have to depend on the `hls-cabal-plugin` to have the
necessary notification handlers installed during test time.

---------

Co-authored-by: soulomoon <fwy996602672@gmail.com>
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
Co-authored-by: Fendor <fendor@posteo.de>
Co-authored-by: fendor <fendor@users.noreply.github.com>
2024-09-28 14:23:35 +02:00
.circleci Bump stack configs + CI to 9.6.5 and 9.8.2 (#4316) 2024-06-12 19:37:52 +02:00
.github Bump haskell-actions/setup from 2.7.3 to 2.7.6 (#4384) 2024-08-21 09:52:41 +02:00
.gitlab Migrate release CI to github (#3406) 2023-03-23 11:23:18 +00:00
bench Add performace diff benchmarks (#4203) 2024-05-05 21:24:50 +08:00
bindist Gitlab CI improvements (#3324) 2022-12-21 10:53:36 +00:00
docs Add missing documentation for cabal formatters (#4322) 2024-07-26 09:38:19 +01:00
exe Improve error message for --probe-tools (#4387) 2024-08-21 09:50:28 +02:00
ghcide Get files from Shake VFS from within plugin handlers (#4328) 2024-09-28 14:23:35 +02:00
ghcide-bench Bump to new lsp versions (#4279) 2024-06-06 13:19:32 +00:00
hie-compat Fix loss of 9.2 GHC version 2024-06-20 09:03:31 +01:00
hls-graph Prepare release 2.9.0.1 2024-07-05 14:51:10 +05:30
hls-plugin-api Get files from Shake VFS from within plugin handlers (#4328) 2024-09-28 14:23:35 +02:00
hls-test-utils Using captureKicksDiagnostics to speed up multiple plugin tests (#4339) 2024-08-02 10:09:00 +00:00
plugins Get files from Shake VFS from within plugin handlers (#4328) 2024-09-28 14:23:35 +02:00
release Add version update script 2024-02-27 15:17:05 +01:00
scripts/release Update release docs, and add missing ChangeLog entry 2024-02-27 15:17:05 +01:00
shake-bench Support for 9.10 (#4233) 2024-06-13 14:45:57 +00:00
src cabal-add integration as a CodeAction (#4360) 2024-08-20 22:31:44 +02:00
test Documentation for build-depends on hover (#4385) 2024-09-08 16:16:39 +02:00
test-logs Make sure the test-logs directory exists 2020-03-15 12:38:07 +00:00
.editorconfig removed Makefile section 2020-10-11 20:28:08 +02:00
.gitignore Prepare release 2.2.0.0 2023-08-26 00:24:32 +02:00
.gitmodules Remove the ghcide submodule 2020-12-29 13:17:40 +00:00
.gitpod.Dockerfile Purge GHC 8.8 (#3287) 2022-10-18 22:12:53 +01:00
.gitpod.yml handle trailing comma in import list properly (#3035) 2022-07-16 10:16:55 +00:00
.hlint.yaml Actually enable pedantic flag in ci flags job (#4224) 2024-05-13 10:10:32 +01:00
.pre-commit-config.yaml add more code into pre-commit (#4275) 2024-06-03 10:39:16 +00:00
.readthedocs.yaml Try to fix the docs build (#3576) 2023-05-05 06:21:24 +00:00
.stylish-haskell.yaml Stylish Haskell: CPP parse issues (#3199) 2022-09-19 20:31:37 +00:00
cabal.project Update cabal-add dependency (#4389) 2024-08-23 09:19:25 +02:00
ChangeLog.md Prepare release 2.9.0.1 2024-07-05 14:51:10 +05:30
CITATION.cff Create a citation (#2155) 2021-09-04 04:17:44 +00:00
CODE_OF_CONDUCT.md Add proof of concept hard-coded hover handler 2020-01-25 19:45:32 +00:00
CODEOWNERS Remove Pepe from CODEOWNERS (#4239) 2024-05-17 13:22:46 +00:00
default.nix Use cabal-install if nix is failing in CI (#1859) 2021-05-24 07:42:00 +02:00
docutils.nix nix update (#2892) 2022-05-13 10:09:51 +01:00
flake.lock Bump nix shells 2024-06-14 14:17:49 +01:00
flake.nix Bump nix shells 2024-06-14 14:17:49 +01:00
fmt.sh Hlint: A handful of fixes to hints (#3259) 2022-10-10 11:47:42 +00:00
FUNDING.yml Include sponsorship section (#2063) 2021-08-02 23:38:45 +00:00
GenChangelogs.hs Prepare release 2.1.0.0 (#3748) 2023-08-12 10:40:41 +00:00
GNUmakefile Release 2.3.0.0 (#3818) 2023-10-06 12:11:38 +00:00
haskell-language-server.cabal Get files from Shake VFS from within plugin handlers (#4328) 2024-09-28 14:23:35 +02:00
LICENSE Initial commit 2020-01-25 14:19:40 +00:00
README.md Switch chat room to matrix (#3817) 2023-09-26 21:58:21 +08:00
RELEASING.md Prepare release 2.9.0.0 (#4319) 2024-06-19 10:35:14 +02:00
Setup.hs Initial basic infrastucture 2020-01-25 14:33:53 +00:00
shell.nix Fix flake compat (#1852) 2021-05-21 15:58:26 -04:00
stack-lts22.yaml Update cabal-add dependency (#4389) 2024-08-23 09:19:25 +02:00
stack.yaml Update cabal-add dependency (#4389) 2024-08-23 09:19:25 +02:00

haskell-language-server

haskell-language-server

Release Hackage License Apache 2.0 CircleCI GitHub Testing Workflow GitHub Nix Workflow matrix codetriage

The official Haskell language server (LSP) implementation. Consult the project documentation for more details.