Skip to content

gopls completions re-ordered #576

Open
@muirdm

Description

Hello again.

With gopls/company-mode I'm seeing eglot re-order the top completion candidate:

package main

func fooBar() {}

func _() {
	var sbp string
	var s struct { blah int }
	var _ int = sb<>
}

Completing at <> I expect to see "s.blah" as the top candidate (because the type matches) but I see "sbp".

[server-reply] (id:277) Tue Dec 22 09:32:34 2020:
(:jsonrpc "2.0" :result
          (:isIncomplete t :items
                         [(:label "s.blah" :kind 5 :detail "int" :preselect t :sortText "00000" :filterText "s.blah" :insertTextFormat 2 :textEdit
                                  (:range
                                   (:start
                                    (:line 6 :character 13)
                                    :end
                                    (:line 6 :character 15))
                                   :newText "s.blah"))
                          (:label "sbp" :kind 9 :detail "\"github.com/go-playground/locales/sbp\"" :sortText "00001" :filterText "sbp" :insertTextFormat 2 :textEdit
                                  (:range
                                   (:start
                                    (:line 6 :character 13)
                                    :end
                                    (:line 6 :character 15))
                                   :newText "sbp")
                                  :additionalTextEdits
                                  [(:range
                                    (:start
                                     (:line 1 :character 0)
                                     :end
                                     (:line 1 :character 0))
                                    :newText "\nimport \"github.com/go-playground/locales/sbp\"\n")])
                          (:label "sbp_TZ" :kind 9 :detail "\"github.com/go-playground/locales/sbp_TZ\"" :sortText "00002" :filterText "sbp_TZ" :insertTextFormat 2 :textEdit
                                  (:range
                                   (:start
                                    (:line 6 :character 13)
                                    :end
                                    (:line 6 :character 15))
                                   :newText "sbp_TZ")
                                  :additionalTextEdits
                                  [(:range
                                    (:start
                                     (:line 1 :character 0)
                                     :end
                                     (:line 1 :character 0))
                                    :newText "\nimport \"github.com/go-playground/locales/sbp_TZ\"\n")])])
          :id 277)

Screen Shot 2020-12-22 at 9 34 42 AM

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions