https://bugs.kde.org/show_bug.cgi?id=492061

            Bug ID: 492061
           Summary: rust-analyzer language server hits error condition
                    while starting, "failed to find any projects" (LSP
                    plugin)
    Classification: Applications
           Product: kate
           Version: 24.08.0
          Platform: Arch Linux
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: kwrite-bugs-n...@kde.org
          Reporter: adam.m.fontenot+...@gmail.com
  Target Milestone: ---

SUMMARY

When I open a project in Kate (e.g. a project with a Git history that Kate
shows in the "open recent" box when you start it), and click on a Rust code
file, rust-analyzer is automatically started. Every time it does this, it shows
an error, forcing open the "Output" tab.

The error suggests that rust-analyzer is looking for my projects in my home
directory. That's obviously inappropriate, as I specifically loaded the project
I wanted to look at in Kate, so Kate should set the project directory (as seen
by rust-analyzer) to that directory.

The help text gives some additional information about hardcoding your projects
with `linkedProjects`, but that's obviously not appropriate here.

Kate version is 24.08.0 (built myself, same issue with 24.05.2 distribution
package). rust-analyzer 20240819

STEPS TO REPRODUCE
1. Open a Rust source file in a project.

OBSERVED RESULT

The following text gets printed to Output:

[22:49:14 LSP Client Log] Started server rust@/home/adam:
/usr/bin/rust-analyzer
[22:49:14 LSP Server Log] rust@/home/adam
2024-08-23T02:49:14.728559Z ERROR failed to find any projects in
[AbsPathBuf("/home/adam")]
[22:49:14 LSP Server Warning] rust@/home/adam
Failed to discover workspace.
Consider adding the `Cargo.toml` of the workspace to the
[`linkedProjects`](https://rust-analyzer.github.io/manual.html#rust-analyzer.linkedProjects)
setting.
[22:49:15 LSP Server Info] Fetching
[22:49:14 LSP Server Error] rust@/home/adam
Failed to load workspaces.

EXPECTED RESULT

No error, loads correctly.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.1.4
KDE Frameworks Version: 6.5.0
Qt Version: 6.7.2
Kernel Version: 6.10.5-arch1-1 (64-bit)
Graphics Platform: Wayland

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to