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

Search for symbols Cmd+T not finding function names #15691

Closed
1 task done
insane-dreamer opened this issue Aug 2, 2024 · 4 comments
Closed
1 task done

Search for symbols Cmd+T not finding function names #15691

insane-dreamer opened this issue Aug 2, 2024 · 4 comments
Labels
bug [core label] language An umbrella label for all programming languages syntax behaviors python Python programming language support unactionable

Comments

@insane-dreamer
Copy link

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

Pressing Cmd+T in a project .py file brings up Search Project Symbol box, but typing there yields no results (even though the left-side panel shows all the functions and I can filter there using the filter box at the bottom of that panel). As I type, box continues to show "no matches". No error messages in log when pressing Cmd+T.

I do not have Zig extension installed (as in the recent issue reporting a similar problem).

Environment

OSX, M3

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

Zed.log
No error messages being generated in logs at the time of issuing the command. The most recent log messages (likely unrelated), are below. 

2024-08-02T15:45:33.450287Z [ERROR] no worktree found for diagnostics path "/Users/---/.config/zed/settings.json"
2024-08-02T15:49:59.882951Z [INFO] starting language servers for Python: pyright, ruff
2024-08-02T15:49:59.883096Z [INFO] starting language server "ruff", path: "/Users/---/Library/Application Support/Zed/languages/pyright/node_modules/pyright/dist/typeshed-fallback/stdlib/builtins.pyi", id: 9
2024-08-02T15:50:00.632013Z [INFO] starting language server. binary path: "/Users/---/Library/Application Support/Zed/extensions/work/ruff/ruff-0.5.5/ruff-aarch64-apple-darwin/ruff", working directory: "/Users/---/Library/Application Support/Zed/languages/pyright/node_modules/pyright/dist/typeshed-fallback/stdlib", args: ["server"]
2024-08-02T15:50:02.530443Z [ERROR] no worktree found for diagnostics path "/Users/---/Library/Application Support/Zed/languages/pyright/node_modules/pyright/dist/typeshed-fallback/stdlib/builtins.pyi"
2024-08-02T15:50:02.530801Z [ERROR] no worktree found for diagnostics path "/Users/---/Library/Application Support/Zed/languages/pyright/node_modules/pyright/dist/typeshed-fallback/stdlib/builtins.pyi"
@insane-dreamer insane-dreamer added admin read Pending admin review bug [core label] triage Maintainer needs to classify the issue labels Aug 2, 2024
@maxdeviant
Copy link
Member

maxdeviant commented Aug 2, 2024

Searching project symbols requires the language server to support it.

AFAIK our default Python language server, pyright, does not support this.

@JosephTLyons JosephTLyons added python Python programming language support language An umbrella label for all programming languages syntax behaviors and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Aug 6, 2024
@JosephTLyons
Copy link
Collaborator

It think @maxdeviant is correct, this is a deficiency of the pyright language server. I would normally encourage users to go report missing features at the source, but I wouldn't count on the maintainers of pyright to add something like this, as they are mostly only concerned with type checking. Hopefully, we get an open source language server for Python that competes with Pylance in the near future.

I'm going to close this out, as it is currently out of our hands, unless we build our own language server.

@burlakov-nick
Copy link

burlakov-nick commented Aug 8, 2024

I am pretty sure it worked for me before on Python project 🤔
I tried to reproduce with older versions of Zed, got no luck

@SirSilver
Copy link
Contributor

Pyright actually has workspace symbols feature. But for some reason it's not working if I use pyright alongside with ruff.

For example:
I have a.py module

def a():
    return

And I'm trying to search a from __init__.py
When only pyright in language_servers

{
  "languages": {
    "Python": {
      "language_servers": ["pyright"]
    }
  }
}

Zed can successfully find a project symbol
image
But as soon as I add ruff in language_servers:

{
  "languages": {
    "Python": {
      "language_servers": ["pyright", "ruff"]
    }
  }
}

There are no matches
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [core label] language An umbrella label for all programming languages syntax behaviors python Python programming language support unactionable
Projects
None yet
Development

No branches or pull requests

5 participants