lsp icon indicating copy to clipboard operation
lsp copied to clipboard

Tracking lsp spec compliance (from version 3.3)

Open lukel97 opened this issue 6 years ago • 18 comments

EDITED by @jneira: we are gonna put here the main checklist of features to give it more visibility

3.3

  • [x] CompletionContext
  • [x] MarkupContent (done for Hover, still needed for some others) tracked by #329

3.11

  • [X] Add support for CodeActionOptions to allow a server to provide a list of code action it supports.

3.12

  • [X] Add support for textDocument/prepareRename request.

3.13

  • [x] File and folder operations (create, rename, move) to workspace edits.

3.14

  • [x] Signature label offsets.
  • [x] Location links.
  • [x] textDocument/declaration request.

3.15

  • [x] generic progress reporting.
  • [x] specific work done progress reporting support to requests where applicable.
  • [x] specific partial result progress support to requests where applicable.
  • [x] textDocument/selectionRange.
  • [x] server and client information.
  • [x] signature help context.
  • [x] add version on PublishDiagnosticsParams
  • [x] CodeAction#isPreferred.
  • [x] CompletionItem#tag.
  • [x] Diagnostic#tag.
  • [x] Add DocumentLink#tooltip support.
  • [x] Add trimTrailingWhitespace, insertFinalNewline and trimFinalNewlines to FormattingOptions.
  • [x] Add support for context in SignatureHelpRequest (noted by @bubba in #190)

3.16

  • [X] Call Hierarchy support, needed for https://github.com/haskell/haskell-language-server/issues/738
  • [X] Semantic Token support. Tracked with #240, needed for https://github.com/haskell/haskell-language-server/issues/1654
  • [x] insert and replace ranges on CompletionItem
  • [ ] diagnostic code descriptions
  • [x] tags on SymbolInformation and DocumentSymbol
  • [ ] Monikers
  • [ ] Linked editing
  • [x] Change annotation support for text edits and file operations
  • [ ] Locale
  • [ ] Diagnostic data
  • [ ] MessageActionItem additional properties
  • [ ] create/rename/delete notifications
  • [x] normalizesLineEndings
  • [ ] Support for client default behavior on renames.

lukel97 avatar Aug 28 '18 16:08 lukel97

https://microsoft.github.io/language-server-protocol/specification#change-log

For tracking:

3.3

  • [x] Added support for CompletionContext
  • [x] Added support for MarkupContent (done for Hover, still needed for some others)

3.11

  • [X] Add support for CodeActionOptions to allow a server to provide a list of code action it supports.

3.12

  • [X] Add support for textDocument/prepareRename request.

3.13

  • [ ] Add support for file and folder operations (create, rename, move) to workspace edits.

3.14

  • [ ] Add support for signature label offsets.
  • [ ] Add support for location links.
  • [ ] Add support for textDocument/declaration request.

theobat avatar Jan 28 '19 16:01 theobat

I would love support for this one in particular:

3.13

* [ ]   Add support for file and folder operations (create, rename, move) to workspace edits.

EggBaconAndSpam avatar Jun 12 '19 09:06 EggBaconAndSpam

@EggBaconAndSpam I believe we are yet to add workspace support first. I think we have the types defined, but yes this would be a great feature to have! It might be nice to have a separate issue for this since there’s probably a lot of discussion needed around how the VFS/api will work around it, assuming that we’re adding deeper integration than just handlers.

lukel97 avatar Jun 13 '19 20:06 lukel97

My use-case is the following: I would like to be able to create files via the "workspace/applyEdit" command; as far as I understand it workspaces as a concept are largely orthogonal to this feature. Currently the corresponding haskell-lsp-types definition only covers edits to existing files:

(From WorkspaceEdit.hs)

data WorkspaceEdit =
  WorkspaceEdit
    { _changes         :: Maybe WorkspaceEditMap
    , _documentChanges :: Maybe (List TextDocumentEdit)
    } deriving (Show, Read, Eq)

Which corresponds to documentChanges?: TextDocumentEdit[];, while the new spec extends this to documentChanges?: (TextDocumentEdit[] | (TextDocumentEdit | CreateFile | RenameFile | DeleteFile)[]);. I propose something along these lines:

data DocumentChange = DCEdit TextDocumentEdit
                    | DCCreate CreateFile
                    | DCRename RenameFile
                    | DCDelete DeleteFile


data WorkspaceEdit =
  WorkspaceEdit
    { _changes         :: Maybe WorkspaceEditMap
    , _documentChanges :: Maybe (List DocumentChange)
    } deriving (Show, Read, Eq)

EggBaconAndSpam avatar Jun 14 '19 08:06 EggBaconAndSpam

I just made a pair of PRs for 3.11 and 3.12 support. They're not really adequately tested yet but hopefully this is a step in the right direction.

thomasjm avatar Jul 15 '19 23:07 thomasjm

Updating @theobat tracking:

3.3

  • [x] CompletionContext
  • [x] MarkupContent (done for Hover, still needed for some others)

3.13

  • [ ] File and folder operations (create, rename, move) to workspace edits.

3.14

  • [ ] Signature label offsets.
  • [ ] Location links.
  • [x] textDocument/declaration request.

3.15

  • [ ] generic progress reporting.
  • [ ] specific work done progress reporting support to requests where applicable.
  • [ ] specific partial result progress support to requests where applicable.
  • [ ] textDocument/selectionRange.
  • [ ] server and client information.
  • [ ] signature help context.
  • [ ] add version on PublishDiagnosticsParams
  • [ ] CodeAction#isPreferred.
  • [ ] CompletionItem#tag.
  • [ ] Diagnostic#tag.
  • [ ] Add DocumentLink#tooltip support.
  • [ ] Add trimTrailingWhitespace, insertFinalNewline and trimFinalNewlines to FormattingOptions.
  • [ ] Add support for context in SignatureHelpRequest (noted by @bubba in #190)

3.16

  • [x] Call Hierarchy support, needed for https://github.com/mpickering/ghcide/issues/18
  • [x] Semantic Token support. Tracked with #240
  • [x] insert and replace ranges on CompletionItem
  • [ ] diagnostic links
  • [ ] tags on SymbolInformation and DocumentSymbol

Maybe some of 3.15 additions are already supported.

jneira avatar Feb 20 '20 07:02 jneira

Support for changeAnnotations and AnnotatedTextEdit would be nice.

michaelpj avatar Feb 16 '21 11:02 michaelpj

https://github.com/alanz/lsp/pull/290 should fix the last remaining place that needs MarkupContent, and one other minor 3.16 addition to SignatureInformation.

michaelpj avatar Feb 26 '21 19:02 michaelpj

I was having a look and it looks like lots of things in the list are done, sadly I can't check the checkboxes.

michaelpj avatar Feb 26 '21 21:02 michaelpj

@michaelpj i suspected most of them was done too, what about copy it in a new comment and check what do you know about? I did that in https://github.com/alanz/lsp/issues/134#issuecomment-588689600

jneira avatar Feb 27 '21 09:02 jneira

I think it's almost all done! As far as I can see it's only some 3.16 things that are missing. Note that this is based on going through @jneira 's list not the full LSP changelog.

The remaining items are two substantial ones and one easy one:

  • Call Hierarchy support, needed for mpickering/ghcide#18
  • Semantic Token support. Tracked with #240
  • tags on SymbolInformation and DocumentSymbol (this is easy, I'll just do this one)

michaelpj avatar Feb 28 '21 12:02 michaelpj

Oh, other things we're missing from 3.16:

  • Monikers
  • Linked editing
  • Change annotations
  • Locale
  • Diagnostic data
  • MessageActionItem additional properties
  • create/rename/delete notifications
  • normalizesLineEndings

michaelpj avatar Feb 28 '21 14:02 michaelpj

We have semantic tokens support and call hierarchy!

jneira avatar Jun 22 '21 07:06 jneira

Since 3.16, there are new number types https://microsoft.github.io/language-server-protocol/specifications/specification-current/#number . We may want to provide newtype wrappers for them as using Int may lead to subtle bugs like https://github.com/haskell/haskell-language-server/pull/2169

pranaysashank avatar Sep 07 '21 19:09 pranaysashank

I'm going to try and update the checklist in the original description and remove the others!

michaelpj avatar Nov 02 '21 21:11 michaelpj

I wonder if this list should be also placed in docs for reference, in the README?

jneira avatar Nov 02 '21 21:11 jneira

I think if we were going to do that we'd want to actually list all the things we've implemented, which would be a bit tedious. I think it might be good to say which versions we have completely supported and which ones are partial, though.

michaelpj avatar Nov 02 '21 21:11 michaelpj

Okay, main checklist should be up-to-date. I think we're actually doing pretty well: we're missing a few things from 3.16, but that's it.

michaelpj avatar Nov 02 '21 21:11 michaelpj

We are also missing codeAction/resolve, which is new in 3.16. This is a blocker for implementing https://github.com/haskell/haskell-language-server/issues/3534

joyfulmantis avatar Apr 19 '23 08:04 joyfulmantis

We're generating the code from the metamodel now, so we should have full compliance with 3.17.

michaelpj avatar Jul 13 '23 15:07 michaelpj