【发布时间】:2022-10-19 14:56:59
【问题描述】:
我是 C# 新手,我似乎无法弄清楚我做错了什么。我在 vs 代码上用 C# 编码。起初,我只获得针对我已经在代码中输入的关键字的代码建议。当试图修复它以建议我可以使用的任何关键字时,我想我打破了它。它现在建议更多关键字,但是当我输入我想要的(这不是建议之一)并按“。”时,我现在写的内容会自动更改为最重要的建议。我不确定我是否没有正确下载东西,但我多次尝试卸载并重新安装 .NET SDK,但没有成功,与 vs 代码中的 C# 扩展相同。如果我打开一个终端,单击输出并选择 OmniSharp Log,我得到:
Starting OmniSharp server at 6/16/2022, 8:19:22 PM
Target: c:\Users\joe4a\FlightSim\Scripts
OmniSharp server started with .NET 6.0.301
.
Path: c:\Users\joe4a\.vscode\extensions\ms-dotnettools.csharp-1.25.0-win32-x64\.omnisharp\1.39.0-net6.0\OmniSharp.dll
PID: 13892
[info]: OmniSharp.Stdio.Host
Starting OmniSharp on Windows 10.0.19044.0 (x64)
[info]: OmniSharp.Services.DotNetCliService
Checking the 'DOTNET_ROOT' environment variable to find a .NET SDK
[info]: OmniSharp.Services.DotNetCliService
Using the 'dotnet' on the PATH.
[info]: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: .NET Core SDK 6.0.301 17.2.0 - "C:\Program Files\dotnet\sdk\6.0.301\"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: .NET Core SDK 6.0.301 17.2.0 - "C:\Program Files\dotnet\sdk\6.0.301\"
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
[info]: OmniSharp.MSBuild.ProjectSystem
No solution files found in 'c:\Users\joe4a\FlightSim\Scripts'
[info]: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in 'c:\Users\joe4a\FlightSim\Scripts'.
[info]: OmniSharp.Script.ScriptProjectSystem
Did not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
Configuration finished.
[info]: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location 'c:\Users\joe4a\FlightSim\Scripts' on host 2812.
[warn]: OmniSharp.Roslyn.CSharp.Services.InlayHints.InlayHintService
Inlay hints requested for document not in workspace Location { FileName = c:\Users\joe4a\FlightSim\Scripts\AircraftRotaion.cs, Range = Range { Start = Point { Line = 0, Column = 0 }, End = Point { Line = 24, Column = 1 } } }
[warn]: OmniSharp.Roslyn.CSharp.Services.InlayHints.InlayHintService
Inlay hints requested for document not in workspace Location { FileName = c:\Users\joe4a\FlightSim\Scripts\AircraftRotaion.cs, Range = Range { Start = Point { Line = 0, Column = 0 }, End = Point { Line = 24, Column = 1 } } }
[warn]: OmniSharp.Roslyn.CSharp.Services.InlayHints.InlayHintService
Inlay hints requested for document not in workspace Location { FileName = c:\Users\joe4a\FlightSim\Scripts\AircraftRotaion.cs, Range = Range { Start = Point { Line = 0, Column = 0 }, End = Point { Line = 24, Column = 1 } } }
[info]: OmniSharp.OmniSharpWorkspace
Miscellaneous file: c:\Users\joe4a\FlightSim\Scripts\AircraftRotaion.cs added to workspace
Received response for /v2/getcodeactions but could not find request.
这与代码建议有关吗?我对 OmniSharp、.NET 或 C# 不太熟悉,并且不确定这些警告的含义(或者它们是否与我最初的问题有关)
【问题讨论】:
标签: c# visual-studio-code .net-core omnisharp