-
Notifications
You must be signed in to change notification settings - Fork 679
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
Error when creating new files #4181
Comments
|
I am having this issue as well. |
Are you sure @filipw ? |
I think you are right, this still has a problem. @JoeRobich should this be fixed now?
|
interesting is that I was partly correct 🙂 |
hum, it might be a distinct issue but here is an easy reproduction path on Windows:
now Model.cs is created but Program doesn't see the class, and you can't see the 'x references' hints in the new file. |
Thanks, we had a look at that yesterday with @333fred and indeed it is a bug that crept in due to improvements in handling file changes and due to certain indeterminism in how VS Code sends file events to the server. It is addressed in OmniSharp/omnisharp-roslyn#2019 |
Nice, thanks! |
When is this going to get released the the VS Code Marketplace? |
@TCROC if you set |
@333fred Awesome thanks! I just created a new test script from Unity and it appears to be working :) |
This minimal example works for me having set I'm using VSCodium 1.52.0, C# extension 1.23.7. I'm not massively familiar with C# development so please let me know what other debug info you need if you do |
I had the same problem. It is broken in 1.23.7. Do this to use the beta where it is fixed: #4181 (comment) |
That's what I am doing - sorry if I wasn't clear. I set The minimal example works though |
@alpha-tango-kilo Sorry you are running into issues. Are you adding the script file outside of Unity? I ask because Unity generates old style project files where each source file to be included is individually listed. This is different from SDK style projects created with I am not sure that OmniSharp would add new files to the workspace without Unity rebuilding the project file to specifically include the source file. |
I'm not surprised somehow So I tested this and now I can't even replicate my own issue now 3 days later... I tried (with Unity open in all cases):
Everything worked!🤯 Shall report back if I have any further issues down the line. Also given Unity itself seems also to be a factor here, I'll note that the version I'm using is |
I did notice having this issue once when using the "latest" release. It was right after I created a new .asmdef file. I will see if I can recreate it later today. |
Sorry it took me a minute to get around to testing this. I got caught up in some other projects. Anyway, I can confirm that adding an asmdef file breaks things. Steps to reproduce:
|
@TCROC I would check that Unity is updating the project file after adding the second asmdef and script. You should see a new |
@JoeRobich I can confirm that behavior is working as expected. When a new asmdef file is created, a new csproj is correctly created and that |
@TCROC Does VS Code stay open with your unity project folder from step 4 thru step 8? or is it closed while adding the new asmdef and script? |
@JoeRobich I misspoke, Unity is open the entire time and VS Code is open in steps 4 - 8 |
To further clarify, VS Code is open in steps 4 - 8. |
Just checking in to see what the status is on this bug |
I'm also seeing this issue in VSCode using extension version 1.23.8 and OmniSharp 1.37.6-beta.16. I'm not seeing any exceptions, just the |
Me too, it's not working for me either and just giving that message. |
I noticed that in the changelog of the C# extension it said:
I tried setting it to always, but it still won't work |
For those of you who are still seeing this and aren't adding non csharp files (like tcroc is) please file a new issue with specific repro steps. I use the extension every day and have yet to reproduce the issue with csharp files, so more info is needed. |
Edit: False alarm. See below comment. |
Never mind. False alarm. I just had to increase the file watcher limit on my system. |
However, I would like to confirm that even with the file watchers limit increased, it still doesn't work when creating a new asmdef file in Unity (which is the equivalent of adding a new .csproj). |
There have been lots of improvements since this issue was opened. Please open a new issue with logs if you are still running into this. |
Issue Description
Hello!
I'm having some trouble using VSCode and the C# extension.
Everytime I create a new file, the Intellisense doens't work, not showing any errors (red underline) on the file.
The OmniSharp Log output shows the following message:
Could not find document for file /Users/rafaelmaia/source/personal/dotnet/Commander/Data/Mock.cs
I reinstalled VSCode and deleted all my extensions folder rm -rf ~/.vscode*, just installed the C# extension and the error persists.
I'm using VSCode version 1.50.1 on a macOS Cataline 10.15.7, dotnet sdk 3.1.403
Steps to Reproduce
Clean Install of VSCode
Install C# extension
Create a dotnet webapi project
dotnet new webapi -n Test
Create a new file
Write something
ex: aaaaaa
Expected Behavior
The expect behavior would be the line written with a red underscore, indicating an error.
Actual Behavior
Nothing happens, and you can check errors popping on the OmniSharp Log
Logs
OmniSharp log
Starting OmniSharp server at 11/5/2020, 4:28:59 AM
Target: /Users/rafaelmaia/source/personal/dotnet/Commander
OmniSharp server started.
Path: /Users/rafaelmaia/.vscode/extensions/ms-dotnettools.csharp-1.23.5/.omnisharp/1.37.3/run
PID: 94751
Starting OmniSharp on MacOS 10.15.7 (x64)
info: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: StandAlone 16.8.0 - "/Users/rafaelmaia/.vscode/extensions/ms-dotnettools.csharp-1.23.5/.omnisharp/1.37.3/omnisharp/.msbuild/Current/Bin"
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
MSBUILD_EXE_PATH environment variable set to '/Users/rafaelmaia/.vscode/extensions/ms-dotnettools.csharp-1.23.5/.omnisharp/1.37.3/omnisharp/.msbuild/Current/Bin/MSBuild.exe'
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: StandAlone 16.8.0 - "/Users/rafaelmaia/.vscode/extensions/ms-dotnettools.csharp-1.23.5/.omnisharp/1.37.3/omnisharp/.msbuild/Current/Bin"
CscToolExe = csc.exe
MSBuildToolsPath = /Users/rafaelmaia/.vscode/extensions/ms-dotnettools.csharp-1.23.5/.omnisharp/1.37.3/omnisharp/.msbuild/Current/Bin
CscToolPath = /Users/rafaelmaia/.vscode/extensions/ms-dotnettools.csharp-1.23.5/.omnisharp/1.37.3/omnisharp/.msbuild/Current/Bin/Roslyn
BypassFrameworkInstallChecks = true
MSBuildExtensionsPath = /Users/rafaelmaia/.vscode/extensions/ms-dotnettools.csharp-1.23.5/.omnisharp/1.37.3/omnisharp/.msbuild
info: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in '/Users/rafaelmaia/source/personal/dotnet/Commander'.
info: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
info: OmniSharp.MSBuild.ProjectSystem
No solution files found in '/Users/rafaelmaia/source/personal/dotnet/Commander'
info: OmniSharp.MSBuild.ProjectManager
Queue project update for '/Users/rafaelmaia/source/personal/dotnet/Commander/Commander.csproj'
info: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in '/Users/rafaelmaia/source/personal/dotnet/Commander'.
info: OmniSharp.Script.ScriptProjectSystem
Could not find any CSX files
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
info: OmniSharp.MSBuild.ProjectManager
Loading project: /Users/rafaelmaia/source/personal/dotnet/Commander/Commander.csproj
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.WorkspaceInitializer
Configuration finished.
info: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location '/Users/rafaelmaia/source/personal/dotnet/Commander' on host 94627.
info: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/Users/rafaelmaia/source/personal/dotnet/Commander/Commander.csproj'.
info: OmniSharp.MSBuild.ProjectManager
Adding project '/Users/rafaelmaia/source/personal/dotnet/Commander/Commander.csproj'
info: OmniSharp.MSBuild.ProjectManager
Update project: Commander
info: OmniSharp.Roslyn.CSharp.Services.Completion.CompletionService
Could not find document for file /Users/rafaelmaia/source/personal/dotnet/Commander/Data/teste1.cs
info: OmniSharp.Roslyn.CSharp.Services.Completion.CompletionService
Could not find document for file /Users/rafaelmaia/source/personal/dotnet/Commander/Data/teste1.cs
info: OmniSharp.Roslyn.CSharp.Services.Completion.CompletionService
Could not find document for file /Users/rafaelmaia/source/personal/dotnet/Commander/Data/teste1.cs
info: OmniSharp.Roslyn.CSharp.Services.Completion.CompletionService
Could not find document for file /Users/rafaelmaia/source/personal/dotnet/Commander/Data/teste1.cs
info: OmniSharp.Roslyn.CSharp.Services.Completion.CompletionService
Could not find document for file /Users/rafaelmaia/source/personal/dotnet/Commander/Data/teste1.cs
info: OmniSharp.Roslyn.CSharp.Services.Completion.CompletionService
Could not find document for file /Users/rafaelmaia/source/personal/dotnet/Commander/Data/teste1.cs
info: OmniSharp.Roslyn.CSharp.Services.Completion.CompletionService
Could not find document for file /Users/rafaelmaia/source/personal/dotnet/Commander/Data/teste1.cs
C# log
Nothing on C# Log.
Environment information
VSCode version: 1.50.1
C# Extension: 1.23.5
Mono Information
OmniSharp using built-in monoDotnet Information
.NET Core SDK (reflecting any global.json): Version: 3.1.403 Commit: 9e895200cdRuntime Environment:
OS Name: Mac OS X
OS Version: 10.15
OS Platform: Darwin
RID: osx.10.15-x64
Base Path: /usr/local/share/dotnet/sdk/3.1.403/
Host (useful for support):
Version: 3.1.9
Commit: 774fc3d6a9
.NET Core SDKs installed:
2.0.3 [/usr/local/share/dotnet/sdk]
2.1.3 [/usr/local/share/dotnet/sdk]
3.1.403 [/usr/local/share/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.1.9 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.0.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.23 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.9 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
Visual Studio Code Extensions
The text was updated successfully, but these errors were encountered: