Skip to content

Autocomplete : Unhandled tab stop types from LSP specification #1647

@tiesselune

Description

@tiesselune

Describe the issue

Hi! First, thanks for the great tech! CodeMirror is exactly what I needed for my project.

But I stumbled upon an issue while combining autocompletion with lsp-client : it seems that the regexp for tab stops here :

      while (m = /[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(line)) {

does not handle "simple" tab stops like $1, $0, etc, as defined in the LSP specification. These are heavily used in rust-analyzer, for instance. My workaround is to intercept the messages and convert all $n formatted tab stops into ${}, but it feels a bit hacky and it would probably be best handled in the regexp I linked.

The other issue is that the spec defines $0 as the last tab stop, and it looks like the code would handle it as the first (${0} does that)

I'd like to help, though, but was not sure if this support was not included for a specific reason. If there isn't, I'd gladly submit a PR and give back to the community. Just let me know :)

Browser and platform

No response

Reproduction link

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions