dotnet / dotnet/roslyn

LSP exception on inlayHint

Open
#83,051 1 comment 0 reactions 0 assignees View on GitHub
Area-IDE
Dominant language
C#
Stars
20.7k
Forks
4.3k
PR merge metrics
PR metrics pending

Description

**Version Used**:
latest main
**Steps to Reproduce**:

1. Open sln in VSCode with Rolsyn LSP enabled
2. Do some typing
3. See exception in log
```
2026-04-03 20:08:00.913 [warning] [textDocument/inlayHint] [Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.ProjectTelemetry.ProjectLoadTelemetryReporter] Failed to get project telemetry data: System.IO.DirectoryNotFoundException: Could not find a part of the path '/home/shestakovap/devel/ide/roslyn/git:/home/shestakovap/devel/ide/roslyn/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/ProjectDependencyHelper.cs?%7B%22path%22:%22/home/shestakovap/devel/ide/roslyn/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/ProjectDependencyHelper.cs%22,%22ref%22:%22~%22%7D'.
at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirError)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException)
at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, Int64 preallocationSize)
at System.IO.File.AsyncStreamReader(String path, Encoding encoding)
at System.IO.File.InternalReadAllTextAsync(String path, Encoding encoding, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.ProjectTelemetry.ProjectLoadTelemetryReporter.GetProjectIdAsync(ProjectToLoad projectToLoad) in /home/shestakovap/devel/ide/roslyn/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/ProjectTelemetry/ProjectLoadTelemetryReporter.cs:line 150
at Microsoft.CodeAnalysis.LanguageServer.HostWorkspace.ProjectTelemetry.ProjectLoadTelemetryReporter.ReportProjectLoadTelemetryAsync(Dictionary`2 projectFileInfos, ProjectToLoad projectToLoad, CancellationToken cancellationToken) in /home/shestakovap/devel/ide/roslyn/src/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/ProjectTelemetry/ProjectLoadTelemetryReporter.cs:line 64
```

Contributor guide

Open the contributing guide

Research direction

Start in Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/ProjectTelemetry/ProjectLoadTelemetryReporter.cs, especially GetProjectIdAsync at line 150 and ReportProjectLoadTelemetryAsync at line 64. Reproduce the failure with the listed VSCode, Roslyn LSP, and inlayHint steps, then trace why the path includes the encoded source URL; done should prevent this exception from occurring during inlayHint requests.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.