Skip to content

Discussion: LSP-server readiness indicator #511

Open
@ljw1004

Description

@ljw1004

How do you fellow LSP-server-authors report the readiness of your LSP-servers? I propose we add a standard for this to LSP. The Java extension displays in the status-bar one of three states: in-progress, ready or failed:

IN-PROGRESS:
image image

READY:
image

FAILED:
image

Omnisharp also displays its own readiness icon. (I think it displays progress and failure, but I haven't been able to get it right now).
image

In general (1) users want to know about LSP-server-readiness. They want to know e.g. that find-all-refs or autocomplete won't work yet but will soon. (2) For complex LSP servers and for large projects, there will be delays that take 30+ seconds where we should display progress, and there will be myriad failure modes that should be displayed to the user.

What do you reckon? Is it okay that each language extension builds its own ad-hoc display in the status-bar?

Here's what we did. I'll show the video first, and then explain why...
language-status-proposal

At first we did it just like Java and Omnisharp, each LSP server displaying its own ad-hoc status indicator in the status bar. But we've found ourselves using several LSP servers for a single document, each serving different aspects of functionality. And so the user ended up with four identical thumbs-up icons in the status bar, which was pretty unfriendly -- takes too much room, and the user has to hover to see which one is which.

  • Flow LSP server provides diagnostics, autocomplete, definition, find-refs, ...
  • ES-Lint LSP server provides linting diagnostics, and quick-fixes for them
  • JS-Imports LSP server provides autocomplete for imports statements, and quick-fixes for when you use symbols that need to be imported
  • GraphQL LSP server provides diagnostics and autocomplete specifically for GraphQL APIs.

Next we tried combining them into just a single icon, which displays the "worst" status of all current LSP servers (e.g. if two are thumbs-up, and one is failed, then display only the failed one). But this was a poor UX because you too often didn't get to see what was important to you.

And even despite displaying status, we continued to get 2-3 bug reports a week from people saying "autocomplete isn't working" or "hover isn't working", at times when the language server was in-progress loading or had failed, but the status bar was too subtle for them to notice.

That's why we implemented the more standardized uniform approach in the video above. Our goal was that users should feel more knowledgeable about their LSP server status (which they need and want to know), and should be more empowered to diagnose+fix issues themselves. We implemented it with a new LSP request, window/showStatus, sent from server to client:

// window/showStatus
// params: ShowStatusParams
// return: either a MessageActionItem if the user clicked a button, or null.

export type ShowStatusParams = {
  type: number,  // same as in ShowMessageRequest, "Info/Warning/Error"
  actions?: Array<MessageActionItem>, // buttons to show
  message?: string, // displayed in the tooltip when user hovers
  shortMessage?: string, // an optional short message to display in the status tab
};

What do you folks reckon? Who else has wanted to display LSP-server readiness status? How are you displaying it? Do you wish for a standardized way to display it? How is your ad-hoc status display holding up in cases of several LSP servers being used on the same document?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions