【问题标题】:How to get autocomplete working in visual studio code?如何在 Visual Studio 代码中自动完成工作?
【发布时间】:2021-01-20 21:21:07
【问题描述】:

我在编写代码时没有看到任何代码提示。我想看看我什么时候输入输入。在我可以使用的函数等点列表之后,但我什么也看不到。我只看到我在那个文件中写的东西,但我没有看到任何统一类或我用...写的任何东西在顶部。 如何在 Visual Studio 代码中实现自动完成功能? 我尝试了其他代码编辑器,但没有一个工作。请帮助我,如果没有自动完成,我什么都做不了,我的生活就毁了。 为什么没有这个质量标准?

【问题讨论】:

    标签: autocomplete


    【解决方案1】:

    来自文档:

    如果您发现 IntelliSense 已停止工作,语言服务可能会 不运行。尝试重新启动 VS Code,这应该可以解决 问题。如果您在安装后仍然缺少 IntelliSense 功能 语言扩展,在该语言的存储库中打开一个问题 扩展名。

    docs.中查看更多信息

    【讨论】:

      【解决方案2】:

      在 Unity 中,我单击打开 c# 项目,然后我收到消息项目无法加载

      Starting OmniSharp server at 20.01.2021, 14:18:44
          Target: c:\Users\Mateusz\Desktop\New Unity Project\New Unity Project.sln
      
      OmniSharp server started.
          Path: c:\Users\Mateusz\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.6-beta.30\OmniSharp.exe
          PID: 2760
      
      [info]: OmniSharp.Stdio.Host
              Starting OmniSharp on Windows 6.2.9200.0 (x64)
      [info]: OmniSharp.Services.DotNetCliService
              DotNetPath set to dotnet
      [info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
              Located 1 MSBuild instance(s)
                  1: StandAlone 16.8.0 - "c:\Users\Mateusz\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.6-beta.30\.msbuild\Current\Bin"
      [info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
              MSBUILD_EXE_PATH environment variable set to 'c:\Users\Mateusz\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.6-beta.30\.msbuild\Current\Bin\MSBuild.exe'
      [info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
              Registered MSBuild instance: StandAlone 16.8.0 - "c:\Users\Mateusz\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.6-beta.30\.msbuild\Current\Bin"
                  CscToolExe = csc.exe
                  CscToolPath = c:\Users\Mateusz\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.6-beta.30\.msbuild\Current\Bin\Roslyn
                  MSBuildExtensionsPath = c:\Users\Mateusz\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.6-beta.30\.msbuild
                  MSBuildToolsPath = c:\Users\Mateusz\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.6-beta.30\.msbuild\Current\Bin
      [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 'c:\Users\Mateusz\Desktop\New Unity Project'.
      [info]: OmniSharp.Cake.CakeProjectSystem
              Could not find any Cake files
      [info]: OmniSharp.MSBuild.ProjectSystem
              Detecting projects in 'c:\Users\Mateusz\Desktop\New Unity Project\New Unity Project.sln'.
      [info]: OmniSharp.MSBuild.ProjectManager
              Queue project update for 'c:\Users\Mateusz\Desktop\New Unity Project\Assembly-CSharp.csproj'
      [info]: OmniSharp.Script.ScriptProjectSystem
              Detecting CSX files in 'c:\Users\Mateusz\Desktop\New Unity Project'.
      [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 'c:\Users\Mateusz\Desktop\New Unity Project' on host 10176.
      [info]: OmniSharp.MSBuild.ProjectManager
              Loading project: c:\Users\Mateusz\Desktop\New Unity Project\Assembly-CSharp.csproj
      [warn]: OmniSharp.MSBuild.ProjectLoader
              The referenced project 'Unity.Timeline.Editor.csproj' does not exist.
      [warn]: OmniSharp.MSBuild.ProjectLoader
              The referenced project 'Unity.VSCode.Editor.csproj' does not exist.
      [warn]: OmniSharp.MSBuild.ProjectLoader
              The referenced project 'Unity.TextMeshPro.Editor.csproj' does not exist.
      [warn]: OmniSharp.MSBuild.ProjectLoader
              The referenced project 'UnityEngine.UI.csproj' does not exist.
      [warn]: OmniSharp.MSBuild.ProjectLoader
              The referenced project 'Unity.Timeline.csproj' does not exist.
      [warn]: OmniSharp.MSBuild.ProjectLoader
              The referenced project 'Unity.CollabProxy.Editor.csproj' does not exist.
      [warn]: OmniSharp.MSBuild.ProjectLoader
              The referenced project 'Unity.Rider.Editor.csproj' does not exist.
      [warn]: OmniSharp.MSBuild.ProjectLoader
              The referenced project 'Unity.2D.Sprite.Editor.csproj' does not exist.
      [warn]: OmniSharp.MSBuild.ProjectLoader
              The referenced project 'Unity.2D.Tilemap.Editor.csproj' does not exist.
      [warn]: OmniSharp.MSBuild.ProjectLoader
              The referenced project 'Unity.TextMeshPro.csproj' does not exist.
      [warn]: OmniSharp.MSBuild.ProjectLoader
              The referenced project 'UnityEditor.UI.csproj' does not exist.
      [fail]: OmniSharp.MSBuild.ProjectLoader
              The reference assemblies for .NETFramework,Version=v4.7.1 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks
      [warn]: OmniSharp.MSBuild.ProjectManager
              Failed to load project file 'c:\Users\Mateusz\Desktop\New Unity Project\Assembly-CSharp.csproj'.
      c:\Users\Mateusz\Desktop\New Unity Project\Assembly-CSharp.csproj
      c:\Users\Mateusz\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.6-beta.30\.msbuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1889,5): Error: The referenced project 'Unity.Timeline.Editor.csproj' does not exist.
      c:\Users\Mateusz\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.6-beta.30\.msbuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1889,5): Error: The referenced project 'Unity.VSCode.Editor.csproj' does not exist.
      c:\Users\Mateusz\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.6-beta.30\.msbuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1889,5): Error: The referenced project 'Unity.TextMeshPro.Editor.csproj' does not exist.
      c:\Users\Mateusz\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.6-beta.30\.msbuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1889,5): Error: The referenced project 'UnityEngine.UI.csproj' does not exist.
      c:\Users\Mateusz\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.6-beta.30\.msbuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1889,5): Error: The referenced project 'Unity.Timeline.csproj' does not exist.
      c:\Users\Mateusz\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.6-beta.30\.msbuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1889,5): Error: The referenced project 'Unity.CollabProxy.Editor.csproj' does not exist.
      c:\Users\Mateusz\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.6-beta.30\.msbuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1889,5): Error: The referenced project 'Unity.Rider.Editor.csproj' does not exist.
      c:\Users\Mateusz\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.6-beta.30\.msbuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1889,5): Error: The referenced project 'Unity.2D.Sprite.Editor.csproj' does not exist.
      c:\Users\Mateusz\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.6-beta.30\.msbuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1889,5): Error: The referenced project 'Unity.2D.Tilemap.Editor.csproj' does not exist.
      c:\Users\Mateusz\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.6-beta.30\.msbuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1889,5): Error: The referenced project 'Unity.TextMeshPro.csproj' does not exist.
      c:\Users\Mateusz\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.6-beta.30\.msbuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1889,5): Error: The referenced project 'UnityEditor.UI.csproj' does not exist.
      c:\Users\Mateusz\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.6-beta.30\.msbuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1180,5): Error: The reference assemblies for .NETFramework,Version=v4.7.1 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks
      
      [fail]: OmniSharp.MSBuild.ProjectManager
              Attempted to update project that is not loaded: c:\Users\Mateusz\Desktop\New Unity Project\Assembly-CSharp.csproj
      [info]: OmniSharp.Roslyn.CSharp.Services.Completion.CompletionService
              Could not find document for file c:\Users\Mateusz\Desktop\New Unity Project\Assets\sc.cs
      

      【讨论】:

        猜你喜欢
        • 2018-12-20
        • 2017-04-20
        • 1970-01-01
        • 2013-09-25
        • 2017-10-07
        • 1970-01-01
        • 2016-09-23
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多