Skip to content

LSP enhancement #40026

@itome

Description

@itome

@DanTup

Hello, I'm using dart lsp for emacs, and writing flutter code.
Dart analysis server returns so large json response for textDocument/completion that emacs freezes while parsing json file for 10~ seconds
Do you have some idea to reduce it?

I checked the json response and noticed that

  1. documentation is included to response.
  {
    "textEdit": {
      "newText": "widget${1:}",
      "range": {
        "end": {
          "character": 15,
          "line": 45
        },
        "start": {
          "character": 12,
          "line": 45
        }
      }
    },
    "insertTextFormat": 2,
    "insertText": "widget${1:}",
    "sortText": "999000",
    "documentation": {
      "value": "The current configuration.\n\nA [State] object's configuration is the corresponding [StatefulWidget]\ninstance. This property is initialized by the framework before calling\n[initState]. If the parent updates this location in the tree to a new\nwidget with the same [runtimeType] and [Widget.key] as the current\nconfiguration, the framework will update this property to refer to the new\nwidget and then call [didUpdateWidget], passing the old configuration as\nan argument.",
      "kind": "markdown"
    },
    "detail": "HomePage",
    "kind": 10,
    "label": "widget"
  },

Maybe it must be excluded from response according to this issue -> #37060

  1. Set suggestFromUnimportedLibraries = false has no effects for flutter user, beacause import 'package:flutter/material.dart imports almost all source of flutter sdk.

  2. Irrelevant completion item seems to be returned. When we request in position below, All classes in flutter sdk is returned. I don't know it is due to lsp server or client.

Align(
  
  ↑ send completion request here.
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    devexp-lspIssues with analysis server's support of Language Server Protocollegacy-area-analyzerUse area-devexp instead.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions