sublimelsp / LSP

Client implementation of the Language Server Protocol for Sublime Text
https://lsp.sublimetext.io/
MIT License
1.65k stars 182 forks source link

LSP completion does not seem to be invoked correctly when manually typing a package prefix. #1680

Closed alecthomas closed 3 years ago

alecthomas commented 3 years ago

Describe the bug

Using the Go LSP and SublimeLSP, LSP completion does not seem to be invoked correctly when manually typing a package prefix.

In the example below this prefix is manifest.. When typing that manually the only completions that show are those from the original dialog that match the prefix. As can be seen from the video, if completion is invoked prior to the . (eg. manif<tab>) then LSP completion is correctly invoked.

This is reliably reproducible, so maybe it's some weird setting I have enabled?

I've also tried the exact same steps using VSCode and the same version of gopls, and it works correctly.

To Reproduce Steps to reproduce the behavior:

  1. Use gopls.
  2. Type a full package including period, eg. fmt. - a truncated list of completions is displayed.
  3. Type a package prefix, eg. fm<tab> - a full list of completions is displayed.

Expected behavior

LSP completions should populate the completion list after a period.

Screenshots

https://user-images.githubusercontent.com/41767/119416515-2108ae00-bd37-11eb-88ee-ee4c3c091a44.mov

Environment (please complete the following information):

Additional context

My LSP settings:

// Settings in here override those in "LSP/LSP.sublime-settings"
{
  "log_debug": true,
  "log_server": [
    "panel",
  ],
  "lsp_format_on_save": true,
  "show_symbol_action_links": true,
  "lsp_code_actions_on_save": {
    "source.fixAll": true,
    "source.organizeImports": true
  },
  "show_code_actions": "bulb",
  "show_diagnostics_panel_on_save": 0,
  "inhibit_snippet_completions": true,
  "show_references_in_quick_panel": true,
  "clients": {
    "gopls": {
      "enabled": true,
      "command": ["gopls"],
      "languageId": "go",
      "scopes": ["source.go"],
      "syntaxes": [
          "Packages/Go/Go.sublime-syntax",
          "Packages/GoSublime/syntax/GoSublime-Go-Recommended.sublime-syntax"
      ],
      "initializationOptions": {
          "experimentalWorkspaceModule": false,
          "usePlaceholders": true,
      },
    },
  }
}
rwols commented 3 years ago

Is this the same as https://github.com/sublimelsp/LSP/issues/1228?

alecthomas commented 3 years ago

It looks like it is yes. Apologies, I did a search but failed to find it.