yegappan / lsp

Language Server Protocol (LSP) plugin for Vim9
MIT License
479 stars 56 forks source link

svelteserver errors for open brackets `(` #391

Open maximyurevich opened 1 year ago

maximyurevich commented 1 year ago

Screenshot from 2023-09-13 11-24-16 Screenshot from 2023-09-13 11-23-43

andlrc commented 1 year ago

The svelte LSP server is for some reason sending a list of numbers instead of a string in the label property:

/**
 * Represents the signature of something callable. A signature
 * can have a label, like a function-name, a doc-comment, and
 * a set of parameters.
 */
export interface [SignatureInformation](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#signatureInformation) {
    /**
     * The label of this signature. Will be shown in
     * the UI.
     */
    label: string;

    /**
     * The human-readable doc-comment of this signature. Will be shown
     * in the UI but can be omitted.
     */
    documentation?: string | [MarkupContent](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#markupContentInnerDefinition);

    /**
     * The parameters of this signature.
     */
    parameters?: [ParameterInformation](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#parameterInformation)[];

    /**
     * The index of the active parameter.
     *
     * If provided, this is used in place of `SignatureHelp.activeParameter`.
     *
     * @since 3.16.0
     */
    activeParameter?: [uinteger](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#uinteger);
}

See: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#signatureInformation

Can you enable debugging for the server and send the log? See :h lsp-debug for how to do this.

I'm curious as to why the svelte server is sending the list of numbers.

maximyurevich commented 1 year ago

The svelte LSP server is for some reason sending a list of numbers instead of a string in the label property:

/**
 * Represents the signature of something callable. A signature
 * can have a label, like a function-name, a doc-comment, and
 * a set of parameters.
 */
export interface [SignatureInformation](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#signatureInformation) {
  /**
   * The label of this signature. Will be shown in
   * the UI.
   */
  label: string;

  /**
   * The human-readable doc-comment of this signature. Will be shown
   * in the UI but can be omitted.
   */
  documentation?: string | [MarkupContent](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#markupContentInnerDefinition);

  /**
   * The parameters of this signature.
   */
  parameters?: [ParameterInformation](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#parameterInformation)[];

  /**
   * The index of the active parameter.
   *
   * If provided, this is used in place of `SignatureHelp.activeParameter`.
   *
   * @since 3.16.0
   */
  activeParameter?: [uinteger](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#uinteger);
}

See: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#signatureInformation

Can you enable debugging for the server and send the log? See :h lsp-debug for how to do this.

I'm curious as to why the svelte server is sending the list of numbers.

I don't know why it's named lsp-tsserver.log, but there's a mention of svelte lsp-tsserver.log

andlrc commented 1 year ago

@maximyurevich can you try out https://github.com/yegappan/lsp/pull/392 I havn't had a change to test it myself, as I don't have a svelte LSP server installed.

maximyurevich commented 1 year ago

@maximyurevich can you try out #392 I havn't had a change to test it myself, as I don't have a svelte LSP server installed.

Tomorrow

maximyurevich commented 1 year ago

@maximyurevich can you try out #392 I havn't had a change to test it myself, as I don't have a svelte LSP server installed.

works fine

https://github.com/yegappan/lsp/assets/21293376/255aa3bf-0cf1-446a-a029-5be92af1a9bd

maximyurevich commented 1 year ago

@maximyurevich can you try out #392 I havn't had a change to test it myself, as I don't have a svelte LSP server installed.

Why this commit in draft?