joe-re / sql-language-server

SQL Language Server
MIT License
695 stars 64 forks source link

Why are Keyword completion items being returned with a Text CompletionItemKind? #219

Open ravilock opened 1 year ago

ravilock commented 1 year ago

After updating to 1.7.0, I was trying to test the new DROP TABLE keyword support.

But I noticed that on LunarVim (in particular), the suggestions where not being displayed. After some debugging, I noticed that sqlls was properly configured, and also returning suggestions as usual. But still, suggestions where not being displayed

After some more debugging I found out that LunarVim skips LSP suggestions that have the Text kind. WIth this information in hand, I found out this code

export const ICONS = {
  KEYWORD: CompletionItemKind.Text,
  COLUMN: CompletionItemKind.Interface,
  TABLE: CompletionItemKind.Field,
  FUNCTION: CompletionItemKind.Property,
  ALIAS: CompletionItemKind.Variable,
  UTILITY: CompletionItemKind.Event,
}

My questions is Why is that? Shouldn't keyword candidates be returned as CompletionItemKind.Keyword?

BTW, this ICONS object is being repeated here

ravilock commented 1 year ago

Just for added context, the problem is solved here. But I believe that it was just a coincidence. And is not necessarily related to this issue in particular.