Open FileOfName opened 1 year ago
This issue seems to be that O# doesn't have file watchers for "AdditionalFiles" such as the NativeMethods.txt used by the CsWin32 source generator. Since the file is added after the workspace is loaded, the additional file is never added to the workspace which the generator runs against.
I face the same issue. Source Generator generates new sources based on AdditionalFiles. When I add new AdditiopnalFile into project, then in Visual Studio it generates new source, but not in Visual Studio Code. If I restart Visual Studio Code, then new classes become available for usage (I mean intellisense).
@JoeRobich if you can expand more details on how to fix it, it will be great for potential contributors.
What I see:
fileCreated/fileSaved/fileDeleted
for AdditionalFile (not C#)omnisharp.stdio
handles it does nothingIf you can describe what stdio
should do, then may probably I can help translate it to C#.
Issue Description
CsWin32 is
And in vscode it only updates after reloading. CsWin32 link
Steps to Reproduce
dotnet new console -o <project_name>
)dotnet add package Microsoft.Windows.CsWin32 --version 0.2.63-beta
)NativeMethods.txt
and in it writeMessageBox
Expected Behavior
MessageBox
should be now a method in the classWindows.Win32.PInvoke
Actual Behavior
MessageBox
is not a method in classWindows.Win32.PInvoke
and only becomes one after reloading vscodeOnly vscode does not update, running
dotnet run
proves thatWindows.Win32.PInvoke.MessageBox()
does exist.Logs
OmniSharp log
C# log
Environment information
VSCode version: 1.72.0 C# Extension: 1.25.0
Dotnet Information
.NET SDK (reflecting any global.json): Version: 6.0.401 Commit: 0906eae6f8 Runtime Environment: OS Name: Windows OS Version: 10.0.22621 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\6.0.401\ global.json file: Not Found Host: Version: 6.0.9 Architecture: x64 Commit: 163a63591c .NET SDKs installed: 6.0.304 [C:\Program Files\dotnet\sdk] 6.0.401 [C:\Program Files\dotnet\sdk] .NET runtimes installed: Microsoft.AspNetCore.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Download .NET: https://aka.ms/dotnet-download Learn about .NET Runtimes and SDKs: https://aka.ms/dotnet/runtimes-sdk-infoVisual Studio Code Extensions
|Extension|Author|Version| |---|---|---| |code-spell-checker|streetsidesoftware|2.10.1| |csharp|ms-dotnettools|1.25.0| |dotnet-interactive-vscode|ms-dotnettools|1.0.3504060| |gitlens|eamodio|12.2.2| |Ionide-fsharp|Ionide|7.2.3| |jupyter|ms-toolsai|2022.9.1002791758| |jupyter-keymap|ms-toolsai|1.0.0| |jupyter-renderers|ms-toolsai|1.0.10| |material-theme|zhuangtongfa|3.15.5| |todo-tree|Gruntfuggly|0.0.215| |vscode-dotnet-pack|ms-dotnettools|1.0.9| |vscode-dotnet-sdk|ms-dotnettools|0.8.0| |vscode-icons|vscode-icons-team|11.19.0| |vscode-jupyter-cell-tags|ms-toolsai|0.1.6| |vscode-jupyter-slideshow|ms-toolsai|0.1.5|;