zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
46.97k stars 2.7k forks source link

OmniSharp "Go To Definition" finds files but with no content #17298

Open SpirTBBX opened 1 week ago

SpirTBBX commented 1 week ago

Check for existing issues

Describe the bug / provide steps to reproduce it

In all my projects, when clicking "Go to definition", the .cs file is opened but it has no content.

I've tried having OmniSharp running on my system (with the -lsp flag), but I guess that doesn't make much sense since zed should be the one starting the lsp.

Thanks in advance.

Best Regards!

Environment

I'm using EndeavourOS, with the latest version for all packages. The system runs on 16GB of ram with a Ryzen 7 5700u

List of installed sdks:

dotnet --list-sdks
7.0.120 [/usr/share/dotnet/sdk]
8.0.107 [/usr/share/dotnet/sdk]

I'm currently using dotnet 8 for all my projects.

OmniSharp is installed to /home/eduardo/language-servers/omnisharp-linux-x64-net6.0 and the execute permission was given to the binary file.

All my projects use dotnet 8.0 and depend on the library CounterStrikeSharp.API

Loading OmniSharp with -lsp flag doesn't provide any output, but running with no flags shows that it detects my dotnet instance:

{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Services.DotNetCliService","Message":"Checking the 'DOTNET_ROOT' environment variable to find a .NET SDK"},"Seq":2,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Services.DotNetCliService","Message":"DotNetPath set to /usr/share/dotnet/dotnet"},"Seq":3,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.Discovery.MSBuildLocator","Message":"Located 2 MSBuild instance(s)\n            1: .NET Core SDK 8.0.107 17.8.5 - \"/usr/share/dotnet/sdk/8.0.107\"\n            2: .NET Core SDK 7.0.120 17.4.8 - \"/usr/share/dotnet/sdk/7.0.120\""},"Seq":4,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.Discovery.MSBuildLocator","Message":"Registered MSBuild instance: .NET Core SDK 8.0.107 17.8.5 - \"/usr/share/dotnet/sdk/8.0.107\""},"Seq":5,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.WorkspaceInitializer","Message":"Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0"},"Seq":6,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Cake.CakeProjectSystem","Message":"Detecting Cake files in '/home/eduardo/language-servers/omnisharp-linux-x64-net6.0/'."},"Seq":7,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Cake.CakeProjectSystem","Message":"Did not find any Cake files"},"Seq":8,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.ProjectSystem","Message":"No solution files found in '/home/eduardo/language-servers/omnisharp-linux-x64-net6.0/'"},"Seq":9,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Script.ScriptProjectSystem","Message":"Detecting CSX files in '/home/eduardo/language-servers/omnisharp-linux-x64-net6.0/'."},"Seq":10,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Script.ScriptProjectSystem","Message":"Did not find any CSX files"},"Seq":11,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.WorkspaceInitializer","Message":"Configuration finished."},"Seq":12,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Stdio.Host","Message":"Omnisharp server running using Stdio at location '/home/eduardo/language-servers/omnisharp-linux-x64-net6.0/' on host -1."},"Seq":13,"Type":"event"}
{"Event":"started","Body":null,"Seq":14,"Type":"event"}

My zed settings:

  "ui_font_size": 16,
  "buffer_font_size": 16,
  "theme": {
    "mode": "system",
    "light": "One Light",
    "dark": "JetBrains New Dark"
  },
  "autosave": {
    "after_delay": {
      "milliseconds": 1000
    }
  },
  "lsp": {
    "omnisharp": {
      "binary": {
        "path": "/home/eduardo/language-servers/omnisharp-linux-x64-net6.0/OmniSharp",
        "args": ["-lsp"]
      }
    }
  }
}

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

Example video of what's happening, in case I wasn't clear enough: https://youtu.be/oZBkQ2aXbJQ

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

Zed.log

[Zed.log](https://github.com/user-attachments/files/16847976/Zed.log)
SpirTBBX commented 1 week ago

Little update:

On that video, the class was correct, it was suposed to search for the BasePlugin.cs class within the CounterStrikeSharp.API.Core library.

However, if I try EventPlayerSpawn, which is part of the CounterStrikeSharp.API.Core namespace and in the GameEvents.g.cs file

Is there any extra configuration that needs to be done in order to fix this? I'm can't do the full change from Rider to Zed because I can't see the definitions on Zed, while I can on the jetbrains software