Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Left side of workspace symbol picker in gdscript is empty #5920

Closed
rcorre opened this issue Feb 11, 2023 · 3 comments · Fixed by #6004
Closed

Left side of workspace symbol picker in gdscript is empty #5920

rcorre opened this issue Feb 11, 2023 · 3 comments · Fixed by #6004
Labels
C-bug Category: This is a bug
Milestone

Comments

@rcorre
Copy link
Contributor

rcorre commented Feb 11, 2023

Summary

workspace_symbol_picker on a gdscript file shows empty rows in the left column. The right column still shows context for each symbol, and I can scroll through the list on the left, but every line is empty. The search appears to work correctly, as the contexts I see on the right all match my search term, it's just that the left side is invisible.

The LSP responses look pretty similar between cpp (which works as expected) and gdscript:

gdscript:

{
      "containerName": "_get_property_list",
      "deprecated": false,
      "kind": 13,
      "location": {
        "range": {
          "end": {
            "character": 15,
            "line": 35
          },
          "start": {
            "character": 11,
            "line": 35
          }
        },
        "uri": "file:///home/rcorre/src/agos/bindings/BindingButton.gd"
      },
      "name": "hint"
    }

cpp:

{
      "containerName": "std::basic_string",
      "kind": 5,
      "location": {
        "range": {
          "end": {
            "character": 48,
            "line": 124
          },
          "start": {
            "character": 34,
            "line": 124
          }
        },
        "uri": "file:///usr/include/c%2B%2B/12.2.1/bits/basic_string.h"
      },
      "name": "allocator_type",
      "score": 0.550000011920929
    }

The only difference appears to be that cpp contains as score, while gdscript does not, and gdscript contains "deprecated", while cpp does not.

1676138253

Reproduction Steps

I tried this:

  1. hx Player.gd
  2. <space>S

I expected this to happen:

Symbols visible in left column of picker.

Instead, this happened:

Symbols invisible in left column of picker, but list is still scrollable and correct context appears on the right.

I tried a few different color schemes, all had the same behavior.

Helix log

~/.cache/helix/helix.log
please provide a copy of `~/.cache/helix/helix.log` here if possible, you may need to redact some of the lines
[hx.log](https://github.com/helix-editor/helix/files/10714356/hx.log) [cpp-syms.txt](https://github.com/helix-editor/helix/files/10714357/cpp-syms.txt) [gd-syms.txt](https://github.com/helix-editor/helix/files/10714358/gd-syms.txt)

Platform

Linux

Terminal Emulator

st 0.8.5

Helix Version

22.12-256-g3b301a9d

@rcorre rcorre added the C-bug Category: This is a bug label Feb 11, 2023
@the-mikedavis
Copy link
Member

I think this was a regression for DynamicPicker introduced by #3053. When there are no initial options, the table's column widths are all calculated here as 0 so even though the text for the options is still computed correctly, nothing is rendered.

I was thinking we could re-run the widths calculations whenever the options field is set on the picker. It's currently set manually by the DynamicPicker but we could introduce a set_options method for Picker that could recalculate the widths, reset the cursor position, etc.. What do you think, @sudormrfbin?

@archseer archseer added this to the next milestone Feb 13, 2023
@MGlolenstine
Copy link

The same issue is present with dart.

@the-mikedavis
Copy link
Member

This will be a problem for any language servers that send an empty list of symbols for the workspace symbols request with an empty query. rust-analyzer doesn't do this but it's pretty common behavior: the spec says you should return all symbols but that is typically prohibitively expensive. I posted #6004 to fix this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants