Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClientCapabilities seem to be missing lenses #593

Closed
fwcd opened this issue Jul 27, 2024 · 6 comments
Closed

ClientCapabilities seem to be missing lenses #593

fwcd opened this issue Jul 27, 2024 · 6 comments

Comments

@fwcd
Copy link
Contributor

fwcd commented Jul 27, 2024

I am currently migrating the Curry language server from lsp 1.6 to 2.3 and currently wonder how to migrate this code snippet:

import qualified Language.LSP.Protocol.Types as J
import qualified Language.LSP.Protocol.Lens as J
import qualified Language.LSP.Protocol.Message as J

...

fromMaybe False (do
  docCapabilities <- capabilities ^. J.textDocument
  cmCapabilities <- docCapabilities ^. J.completion
  ciCapabilities <- cmCapabilities ^. J.completionItem
  ciCapabilities ^. J.snippetSupport)

where capabilities :: ClientCapabilities. The snippetSupport lens seems to be missing, at least I could not find it. Any ideas?

@michaelpj
Copy link
Collaborator

That seems like it should be okay. That code compiles for me. What version of the library are you using?

@michaelpj
Copy link
Collaborator

Oh, you said, 2.3. Then I'm confused :/

@fwcd
Copy link
Contributor Author

fwcd commented Jul 29, 2024

Ah wait, I thought 2.3 was the newest version since that was what the recently released LTS 22.31 Stackage gave me. Might have to add 2.7 as an extra dependency and see if that fixes it.

@michaelpj
Copy link
Collaborator

Ah, I thought you meant lsp-types-2.3, which is the newest version of that. I don't think I messed with anything too much recently but do try with the newest version.

@fwcd
Copy link
Contributor Author

fwcd commented Jul 29, 2024

Ah I think part of what caused my confusion was that the badges in the README all displayed 2.7 😄

Submitted #594 to fix it

@fwcd
Copy link
Contributor Author

fwcd commented Jul 29, 2024

Seems to already have been implemented in lsp 2.7/lsp-types 2.3, therefore I'll close this.

@fwcd fwcd closed this as completed Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants