1
1
mirror of https://github.com/haskell/lsp.git synced 2024-10-03 18:37:27 +03:00
Commit Graph

1644 Commits

Author SHA1 Message Date
fwcd
9dc8a07ca8
Fix badges in README (#594) 2024-07-29 17:19:58 +00:00
Patrick Aldis
dfdff1380b
Update example code in README.md (#590) 2024-06-09 08:02:20 +00:00
Michael Peyton Jones
f1c17c3b9c
Prepare release (#588) 2024-06-06 07:34:46 +00:00
Michael Peyton Jones
82055870ca
Use typed response errors (#587)
I have a branch adapting to this in HLS, it wasn't so bad.

Fixes #586
2024-06-06 08:06:06 +01:00
Michael Peyton Jones
8fc240d46d
Remove allow-newers (#585)
I think these are now all unnecessary.
2024-05-26 18:51:51 +01:00
Michael Peyton Jones
fb8363a657
Mappings for capabilities (#581)
* Add golden tests for client cap generation

* Add mappings for capabilities

* Fix commment
2024-05-25 21:12:42 +01:00
Michael Peyton Jones
89799f7970
Add some changelogs (#579) 2024-05-19 15:01:11 +00:00
jinser
e6d5c5d5b6
add inlay hints lsp-test support (#575)
* add inlay hints lsp-test support

* format with fourmolu

---------

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2024-05-19 15:45:47 +01:00
Michael Peyton Jones
6327e0ff78
Use our normal auto-incrementing ids instead of UUIDs (#578)
* Use our normal auto-incrementing ids instead of UUIDs

The spec just says they have to be unique IDs, not UUIDs, and we already
have a tool for generating such things.

* Remove random too
2024-05-18 11:12:53 +00:00
Michael Peyton Jones
c15fa8269d
Add 9.10 to CI, relax bounds (#574)
* Add 9.10 to CI, relax bounds

* Some allow-newers

* Bump index-state

* Another

* More

* more

* More bounds relax

* more
2024-05-16 15:55:53 +00:00
soulomoon
85a956536a
fix _rootPath in initializeParams (#573)
* fix initializeParams
* use record syntax for initializeParams
2024-05-16 14:53:11 +00:00
Michael Peyton Jones
31a9856067
Prepare lsp-test (#572) 2024-05-09 14:43:45 +00:00
Michael Peyton Jones
de08abe586
Rewrite progress handling to allow for debouncing messages (#571)
* Rewrite progress handling to allow for debouncing messages

This had to be redone in order to allow us to "wake up" and notice that
there are pending messages. I also wrote it so there can be a stateful
interface (the `ProgressTracker`) which I think might make it easier to
use in that weird case in `ghcide`. I haven't exposed that yet, though.

* Remove stateful interface

* Delay sending the create request also

* Changelog

* Move progress code to its own module
2024-05-09 14:06:19 +00:00
Michael Peyton Jones
6fd1db3f81
Prepare release (#570)
* Prepare release

* Bump index state
2024-04-30 10:14:57 +00:00
Jan Hrcek
b3c18fe441
Fix ghc and hlint warnings (#568)
* Fix ghc and hlint warnings

* exceptions needed with ghc 9.6+

* Small improvements

* Add -Wunused-packages, consolidate warning configs, fix few more warnings

* fourmolu
2024-04-16 09:16:08 +01:00
soulomoon
eab156c66c
Stop doing action for handles and ignore responses after shutdown (#567)
* stop doing action before handler after shutdown

* allowed method can run the before-action

* fix

* add log

* swap log location

* block the response call back

* stop tryChangeConfig

* Update lsp/src/Language/LSP/Server/Processing.hs

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

* revert barrior in tryChangeConfig

* fix typo

* revert tryChangeConfig

* add documentation

* Update lsp/src/Language/LSP/Server/Processing.hs

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

* refine shutdown blocking

* refine shutdown blocking

* fix format

* fix format

* fix doc

* fix doc

* Update Processing.hs

---------

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
2024-04-10 15:43:36 +01:00
Michael Peyton Jones
1e5940b4c8
Remove deprecated prettyprinter usage (#565)
* Remove deprecated prettyprinter usage

We've been requiring the latest major version for a while anyway.

* Fix formatting
2024-04-06 20:55:26 +00:00
Michael Peyton Jones
e25304fad3
Reject messages that come in after 'shutdown' (#564)
* Reject messages that come in after 'shutdown'

This is mandated by the spec so we can do it. We also expose the
shutdown barrier, which I think can be convenient. For more
sophisticated usecases people should just install a proper shutdown
handler.

I tried to write some tests for this, but I gave up because it requires
some singificant surgery on `lsp-test`, which stops recording messages
when it receives `shutdown` :(

* Fix formatting
2024-04-06 21:38:22 +01:00
Michael Peyton Jones
7a8784153d
Relax ansi-terminal bound (#560)
Fixes 559
2024-02-26 11:20:57 +00:00
Michael Peyton Jones
3ad32c6c10
Update the metamodel (#556)
* Update the metamodel

There are various changes:
- Quite a lot of new "proposed" stuff. I adjusted the codegen to filter
  this stuff out, which is what we want I think. I had to make some PRs
  upstream, I hacked up our metamodel copy to mirror what I think will
  come out of that eventually.
- They created named structs for a lot of the previously anonymous ones.
  This is generally pretty good, using `row-types` for that was always a
  bit awkward. However, I haven't been able to get them to commit to
  actually getting rid of anonymous structs entirely, so we have to keep
  the support :(
    - This change does generate most of the churn, though
- Some random renamings 🤷

* Try to fix on 9.8
2024-02-09 09:54:12 +00:00
Michael Peyton Jones
2bba4716c0
Remove getCompletionPrefix (#552)
* Remove getCompletionPrefix

* Format
2024-02-05 11:30:55 +00:00
Michael Peyton Jones
99002c0e8d
Prepare release (#551) 2024-02-05 09:04:28 +00:00
Michael Peyton Jones
13cba17ede
Always try to register for didChangeConfiguration (#548)
* Register for workspace/didChangeConfiguration always

The new direction of the spec seems to be that you should always do
this. In any case, it doesn't hurt.

`lsp-test` has some changes to adapt to the increased registration
message spam, and also changes to be a more picky client, refusing to
send notifications unless you _do_ register. This is good, since it
forces us to handle the most annoying version of client behaviour.

* Add bound on extra

* fix
2024-02-04 22:30:45 +00:00
Michael Peyton Jones
52607f17e7
Switch to GHC2021 (#550)
* Switch to GHC2021

We don't support GHC < 9.2, so this is safe.

* Format
2024-02-04 17:42:11 +00:00
Michael Peyton Jones
794d689579
Generate Arbitrary instance for all types (#544)
* Generate Arbitrary instances for all types

* More format
2024-01-17 12:28:48 +00:00
Michael Peyton Jones
44fd76b35b
Handle clients sending "null" instead of a missing field (#543)
* Accept null in place of a missing value

We sometimes see reports where HLS is not working because the client
sends us slightly wrong JSON. We should follow the principle of
robustness and try to accept this where we can - following the spec
precisely is hard!

The specific case we hadle here is accepting null to mean "missing"
when null is not a valid value for the type. Currently we will treat
it as a _present_ value and then fail to interpret null as a value of
the type.

* Mark lsp-types generated code as generated for github

* typo

* Fix a few more

* Refactor tests a little

* Changelog

* Improve comment
2024-01-14 20:15:33 +00:00
Michael Peyton Jones
242644dff6
Various fixes to progress handling (#539)
* Various fixes to progress handling

1. Server-initiated progress should wait for the client to acknowledge

This is an old bug. Per the spec, we're not allowed to send any reports
using the token if the client doesn't respond with a non-error response
to our creation of the token.

This is a bit subtle, because it means we may need to delay the sending
of the "begin" notification until we have received the token from the
client.

2. No easy way to use client-initiated progress

This is simpler and faster than server-initiated progress since you
don't need the extra message round-trip. You just need to pull out
the progress token (if there is one) from the request and use that.

I did two things to make this better:
- The progress functions now take the client token if there is one.
  If there isn't one they still fall back to server-initiated progress.
- The server capabilities can now advertise that client-initiated
  progress is supported.

* Make the default for client-initiated progress to be off

* Don't lose progress updates if it takes a while to start

* Refactor tests

* Add test for cancellation

* Fix minor bug in lsp-test config handling

* More tests

* Try this

* Fix formatting

* Add comment and purge traces
2024-01-07 20:13:24 +00:00
Patrick Wales
847c2390d0
Update Data.Text.Utf16.Rope to Data.Text.Utf16.Rope.Mixed (#542)
* fix typo

* update Data.Text.Utf16.Rope  to Data.Text.Utf16.Rope.Mixed

* fix omitting newline

* revert extractLine

* update Note [Converting between code points and code units]

* format

* add back note

* simplified

* update comment

* fix typo
2024-01-03 17:23:53 +00:00
Patrick Wales
6faa9b5ebe
fix typo (#541) 2023-12-31 16:58:20 +00:00
Michael Peyton Jones
618886cdb9
More cabal file tidying (#535)
* More cabal file tidying

Remove most constraints from non-library components. I'm unsure if this
is quite right: possibly we should have bounds for any public component,
but this is significantly more work to maintain (witness the odd bound
on `sorted-list` from a test suite). I think this strikes a reasonable
balance for now.

* Delete repeated base bounds

* Drop generic-lens workaround

* Allow filepath-1.5
2023-12-24 14:49:16 +00:00
Andreas Abel
c92e6fe54d
Add release dates to changelog of lsp-types; CI bumps (#537)
* lsp-types/changelog: add 1.6.0.1 and missing dates of previous releases

* lsp-types/changelog: add dates of version 2.* releases

* Haskell CI: bump actions to latest versions
2023-12-04 11:53:29 +00:00
Michael Peyton Jones
9bab6d1109
Add bounds to all dependencies (#533)
* Add bounds to all dependencies

* Fix some warnings

* Uncomment those deps

* Ospath issues

* Fix mtl bound

* Fix Diff bound

* Fix ansi-terminal
2023-11-27 09:15:38 +00:00
Michael Peyton Jones
483e641eaf
Simplify nix setup (#531)
* Simplify nix setup

This doesn't try to build the dependencies, just provides GHC/cabal/HLS.

* Add cabal-fmt and fourmolu

* Updated fourmolu

* Use the default GHC
2023-11-26 17:47:53 +00:00
Michael Peyton Jones
418c878b87
Merge pull request #532 from haskell/mpj/drop-9.0
Drop 9.0 from CI
2023-11-26 17:10:32 +00:00
Michael Peyton Jones
fbfa2c5235
Drop 9.0 from CI
HLS no longer supports it.
2023-11-26 16:51:23 +00:00
Michael Peyton Jones
9619f2855a
Merge pull request #529 from haskell/mpj/require-aeson-2
Requre aeson 2
2023-11-13 17:18:56 +00:00
Michael Peyton Jones
4b765c1d68
Merge branch 'master' into mpj/require-aeson-2 2023-11-13 17:04:28 +00:00
Michael Peyton Jones
13143267b0
Requre aeson 2
HLS used to need to build with aeson 1 for old versions of GHC, but
that's no longer the case so we can finally stop maintaining
compatibility with both.
2023-11-13 17:02:47 +00:00
Michael Peyton Jones
93cae88475
Merge pull request #528 from felixonmars/patch-1
Allow sorted-list 0.2.2
2023-11-13 15:42:45 +00:00
Felix Yan
0033306ac0
Allow sorted-list 0.2.2
Builds fine and all tests pass.
2023-11-13 14:49:24 +02:00
Michael Peyton Jones
7d9de120a4
Merge pull request #527 from haskell/mpj/9.8-release
Prepare release
2023-11-13 11:48:07 +00:00
Michael Peyton Jones
661cf4cc17
Prepare release 2023-11-13 11:21:05 +00:00
Michael Peyton Jones
78e3fd1c1d
Merge pull request #526 from haskell/mpj/9.82
9.8
2023-11-13 11:14:19 +00:00
Michael Peyton Jones
560e05f113
Add back allow-newers with a comment 2023-11-13 10:49:07 +00:00
Michael Peyton Jones
4f1c3908a2
Delete allow-newers until I know what they're for 2023-11-13 10:44:04 +00:00
Zubin Duggal
5933a70b60
Support aeson 2.2.0 2023-11-13 10:43:46 +00:00
Michael Peyton Jones
e68e48fefd
Bump index-state 2023-11-13 10:41:24 +00:00
Michael Peyton Jones
a82d12fbea
Add 9.8 to CI, remove 8.10 2023-11-13 10:41:01 +00:00
fendor
fce5a9cafb
Merge pull request #522 from haskell/mpj/log-initial-config
Log the initial config we get from the initialize request
2023-10-09 18:25:13 +02:00
Michael Peyton Jones
b7632ea6a9
Merge branch 'master' into mpj/log-initial-config 2023-10-09 17:07:56 +01:00