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

Omnisharp doesn't work with shared code project (.shproj) #4633

Closed
YVEF opened this issue Jun 29, 2021 · 9 comments · Fixed by #4644
Closed

Omnisharp doesn't work with shared code project (.shproj) #4633

YVEF opened this issue Jun 29, 2021 · 9 comments · Fixed by #4644

Comments

@YVEF
Copy link

YVEF commented Jun 29, 2021

Environment data

Version: 6.0.100-preview.4.21255.9

Runtime Environment:
OS Name: arch
OS Platform: Linux
RID: arch-x64

.NET SDKs installed:
6.0.100-preview.4.21255.9 [/usr/share/dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.0-preview.4.21253.5 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.0-preview.4.21253.7 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Btw. on windows 10 the same behavior.

Expected behavior

Work in vscode with Intellisense support.

Actual behavior

It doesn't work. Press F12 - "No definition found for ...";

Omnisharp log:

OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No document found. File: path/to/thefile

@JoeRobich
Copy link
Member

@YVEF can you please share the entire OmniSharp log from the Output pane?

@YVEF
Copy link
Author

YVEF commented Jun 30, 2021

@JoeRobich sure. thanks.

Starting OmniSharp server at 6/30/2021, 8:31:08 PM
Target: /home/iaroslav/repos/runtime/src/libraries/System.Private.CoreLib

OmniSharp server started.
Path: /home/iaroslav/.vscode/extensions/ms-dotnettools.csharp-1.23.12/.omnisharp/1.37.10/run
PID: 157769

Starting OmniSharp on arch 0.0 (x64)
info: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: StandAlone 16.11.0 - "/home/iaroslav/.vscode/extensions/ms-dotnettools.csharp-1.23.12/.omnisharp/1.37.10/omnisharp/.msbuild/Current/Bin"
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
MSBUILD_EXE_PATH environment variable set to '/home/iaroslav/.vscode/extensions/ms-dotnettools.csharp-1.23.12/.omnisharp/1.37.10/omnisharp/.msbuild/Current/Bin/MSBuild.exe'
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: StandAlone 16.11.0 - "/home/iaroslav/.vscode/extensions/ms-dotnettools.csharp-1.23.12/.omnisharp/1.37.10/omnisharp/.msbuild/Current/Bin"
CscToolExe = csc.exe
MSBuildToolsPath = /home/iaroslav/.vscode/extensions/ms-dotnettools.csharp-1.23.12/.omnisharp/1.37.10/omnisharp/.msbuild/Current/Bin
CscToolPath = /home/iaroslav/.vscode/extensions/ms-dotnettools.csharp-1.23.12/.omnisharp/1.37.10/omnisharp/.msbuild/Current/Bin/Roslyn
BypassFrameworkInstallChecks = true
MSBuildExtensionsPath = /home/iaroslav/.vscode/extensions/ms-dotnettools.csharp-1.23.12/.omnisharp/1.37.10/omnisharp/.msbuild
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.Completion.CompletionOptionsProvider, Order: 0
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.ImplementTypeWorkspaceOptionsProvider, Order: 110
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.BlockStructureWorkspaceOptionsProvider, Order: 140
info: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in '/home/iaroslav/repos/runtime/src/libraries/System.Private.CoreLib'.
info: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
info: OmniSharp.MSBuild.ProjectSystem
No solution files found in '/home/iaroslav/repos/runtime/src/libraries/System.Private.CoreLib'
info: OmniSharp.MSBuild.ProjectManager
Queue project update for '/home/iaroslav/repos/runtime/src/libraries/System.Private.CoreLib/generators/System.Private.CoreLib.Generators.csproj'
info: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in '/home/iaroslav/repos/runtime/src/libraries/System.Private.CoreLib'.
info: OmniSharp.Script.ScriptProjectSystem
Could not find any CSX files
info: OmniSharp.WorkspaceInitializer
Configuration finished.
info: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location '/home/iaroslav/repos/runtime/src/libraries/System.Private.CoreLib' on host 147139.
info: OmniSharp.MSBuild.ProjectManager
Loading project: /home/iaroslav/repos/runtime/src/libraries/System.Private.CoreLib/generators/System.Private.CoreLib.Generators.csproj
info: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/home/iaroslav/repos/runtime/src/libraries/System.Private.CoreLib/generators/System.Private.CoreLib.Generators.csproj'.
info: OmniSharp.MSBuild.ProjectManager
Adding project '/home/iaroslav/repos/runtime/src/libraries/System.Private.CoreLib/generators/System.Private.CoreLib.Generators.csproj'
info: OmniSharp.MSBuild.ProjectManager
Update project: System.Private.CoreLib.Generators
info: OmniSharp.Roslyn.CSharp.Services.Diagnostics.CSharpDiagnosticWorkerWithAnalyzers
Solution initialized -> queue all documents for code analysis. Initial document count: 8.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No document found. File: /home/iaroslav/repos/runtime/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Aes.cs.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No document found. File: /home/iaroslav/repos/runtime/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Aes.cs.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No document found. File: /home/iaroslav/repos/runtime/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Aes.cs.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No document found. File: /home/iaroslav/repos/runtime/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Aes.cs.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No document found. File: /home/iaroslav/repos/runtime/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Aes.cs.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No document found. File: /home/iaroslav/repos/runtime/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Aes.cs.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No document found. File: /home/iaroslav/repos/runtime/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Aes.cs.

@JoeRobich
Copy link
Member

@YVEF I pulled down the runtime repo and opened the runtime/src/libraries/System.Private.CoreLib/generators/ folder in Code. I do not see a project reference for a .shproj in the System.Private.CoreLib.Generators.csproj. Are you working off a particular branch or have you made local changes?

@JoeRobich
Copy link
Member

Never mind my earlier question. I see now that you were opening the runtime/src/libraries/System.Private.CoreLib folder instead.

So shared projects are supported when you open a folder containing a .csproj that has a project reference to the .shproj. The reason for this is that shared projects are treated as a set of files to be added to C# project. The shared project itself doesn't contain a target framework or package dependencies necessary to generate a compilation. It only makes sense when included in a C# project which has framework and other dependencies.

@YVEF
Copy link
Author

YVEF commented Jun 30, 2021

@JoeRobich no, I have not local changes. It's main branch. I tried open System.Private.CoreLib and whole Libraries folders. and nothing. If I open Libraries I can choose only few project using "Omnisharp Select Project" command. A most of remaining is ignored and, of course, it didn't parsed.

@YVEF
Copy link
Author

YVEF commented Jun 30, 2021

@JoeRobich but what if I open whole Library folder. I have to choose a certain project but I cannot to do it. Most of them are missing, as I mentioned before.

@JoeRobich
Copy link
Member

Ah, so the issue is that the C# extension does not show project files in the selector when solution files are discoved?

@YVEF
Copy link
Author

YVEF commented Jun 30, 2021

I think yes. Should I create a new issue?

@JoeRobich
Copy link
Member

@YVEF Opened #4644 to add .csproj files to project selector.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants