Skip to content

Unnecessarily slow parsing of edits #88

@friedev

Description

@friedev

Steps to reproduce

  1. Create a new Godot project.
  2. Create a new GDScript file in that project.
  3. Open the script in Zed.
  4. Insert a large amount of code.
    • In the attached video below, I used Zed's vim mode to do this by typing 200ovar my_long_variable_name: Dictionary<esc>
zed-gdscript-slow.mp4

Expected behavior

The extension processes the most recent contents of the file in one full pass.

In this example, I would expect all the duplicate variables to be marked as errors at the same time, and for there to be no interruption in other language features like autocomplete.

For comparison, you can do the equivalent steps in another language. For instance, make an empty Python script and type something like 200oprint(foo)<esc> (without defining foo) -- all 200 lines are marked as errors simultaneously, and autocomplete continues to work as expected.

godotengine/godot-vscode-plugin behaves this way too.

Actual behavior

The extension appears to process the incoming changes character-by-character (or at least edit-by-edit), which takes a very long time in this case.

The above example is a bit convoluted to make the problem easy to see, but in practice, this occurs in any script of sufficient size, and the implication is that you have to wait for each character you type to be processed individually before completion options are presented. This forces you to wait potentially one second or more each time you want to try to autocomplete something (especially if you're a fast typist), which can be quite a hindrance to productivity.

I'm not a Rust developer or Zed extension developer, so I can't tell exactly what the extension code is doing, but I wonder if it's maybe sending the whole file as a query to language server after each edit, and the language server then has to process each query one by one?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions