Skip to content

Clarify usage of {{value}} and cursor position after completion #82

Closed

Description

In #81, I learned that {{}} can be used in a completion item to indicate where cursor should be placed. The protocol documentation doesn't mention that. Can it please be added? Also some related questions:

  • Does this apply to any TextEdit or only completion ones?
  • Is this something that is configured?
  • Would it make sense to avoid this workaround and have the TextEdit also contain an (optional) recommendation of a cursor position?

Activity

  1. kaloyan-raev commented on Oct 11, 2016

    @kaloyan-raev

    This is related to #75.

  2. dbaeumer commented on Oct 14, 2016

    @dbaeumer
    Member

    This was without any intention and we need to carefully think about how we deal with cursor positions in the protocol itself. I tried to stay away from this so far by not exposing any properties to manipulate the cursor position.

  3. changed the title [-]Clarify usage of {{}} and cursor position after completion[/-] [+]Clarify usage of {{value}} and cursor position after completion[/+] on Oct 18, 2016
  4. mickaelistria commented on Oct 19, 2016

    @mickaelistria
    Author

    See this interesting comment eclipselabs/eclipse-language-service#57 (comment) . A solution could be that placeHolderStart and placeHolderEnd should be part of the completionOptions returned with the capabilities.

  5. mickaelistria commented on Oct 31, 2016

    @mickaelistria
    Author

    Close as dup of #82

  6. rictic commented on Nov 7, 2016

    @rictic
    Contributor

    Mickael Istria (@mickaelistria) Did you intend to say that it's closed as a dupe of #75?

  7. dbaeumer commented on Nov 21, 2016

    @dbaeumer
    Member

    It is #75.

    And we made some progress on this for the upcoming 1.8 release and it got already merged into some of the LSP client and server libraries for node.

  8. mickaelistria commented on Nov 22, 2016

    @mickaelistria
    Author

    What kind of progress were done? Anything that applies to the protocol already?

  9. dbaeumer commented on Nov 22, 2016

    @dbaeumer
    Member

    Yes, but not speced yet. The 2.6.x version of the node libraries available do have preliminary support for it in the protocol.d.ts. Look at SnippetString.

  10. gorkem commented on Dec 13, 2016

    @gorkem
    Contributor

    Dirk Bäumer (@dbaeumer) I am looking at the CompletionItem changes on the 2.6.x node libraries for this one. CompletionItem.insertText is now defined as insertText?: string | SnippetString; Unfortunately these union types are hard to map on languages such as Java, Sven Efftinge (@svenefftinge) has been working on a solution but the options are ranging from bad to worse. Can we spec this differently than the current node library implementation so that it is easier for strongly typed folks?

  11. dbaeumer commented on Dec 30, 2016

    @dbaeumer
    Member

    Gorkem Ercan (@gorkem) for the upcoming 3.0 library I speced a TypedString which can either be a normal string or a snippet string. So for people that can't deal with OR types they can always sent a TypedString.

  12. dbaeumer commented on Feb 6, 2017

    @dbaeumer
    Member

    Just for clarification. The final design uses a insertTextFormat kind but provides the same functionality as the TypeString (no or types)

  13. gorkem commented on Feb 8, 2017

    @gorkem
    Contributor

    Anton Kosyakov (@akosyakov), Sven Efftinge (@svenefftinge) does the insertTextFormat solution work for you?

  14. locked and limited conversation to collaborators on Nov 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions