dotnet / vscode-csharp

Official C# support for Visual Studio Code
MIT License
2.86k stars 670 forks source link

Redundant Class_Name Error #5438

Open DimasVeliz opened 1 year ago

DimasVeliz commented 1 year ago

Please paste the output from your clipboard## Issue Description ##

Steps to Reproduce

  1. Create a project with namespace e.g: BLA_BLA.Lib
  2. Create a file named X.cs either the terminal or vscode built-in Add new file button
  3. Write your using statements, and namespace
  4. type de word class and press "TAB" for auto completion
  5. The result, is a class, also named X

Expected Behavior

Actual Behavior

Logs

The namespace 'BLA_BLA.Lib,' already contains a definition for 'X' [ BLA_BLA.Lib, BLA_BLA.Lib] csharp(CS0101)

OmniSharp log

Post the output from Output-->OmniSharp log here

C# log

Post the output from Output-->C# here

The namespace 'BLA_BLA.Lib,' already contains a definition for 'X' [ BLA_BLA.Lib, BLA_BLA.Lib] csharp(CS0101)

Environment information

VSCode version: 1.72.2 C# Extension: 1.25.0

Mono Information There is a problem with running OmniSharp on mono: Error: Unable to find Mono. Ensure that Mono's '/bin' folder is added to your environment's PATH variable.
Dotnet Information .NET SDK (reflecting any global.json): Version: 6.0.110 Commit: ce0a42998a Runtime Environment: OS Name: ubuntu OS Version: 22.04 OS Platform: Linux RID: ubuntu.22.04-x64 Base Path: /usr/lib/dotnet/dotnet6-6.0.110/sdk/6.0.110/ global.json file: Not found Host: Version: 6.0.10 Architecture: x64 Commit: 5a400c212a .NET SDKs installed: 6.0.110 [/usr/lib/dotnet/dotnet6-6.0.110/sdk] .NET runtimes installed: Microsoft.AspNetCore.App 6.0.10 [/usr/lib/dotnet/dotnet6-6.0.110/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 6.0.10 [/usr/lib/dotnet/dotnet6-6.0.110/shared/Microsoft.NETCore.App] Download .NET: https://aka.ms/dotnet-download Learn about .NET Runtimes and SDKs: https://aka.ms/dotnet/runtimes-sdk-info
Visual Studio Code Extensions |Extension|Author|Version| |---|---|---| |cmake|twxs|0.0.17| |cmake-tools|ms-vscode|1.12.27| |cpptools|ms-vscode|1.12.4| |cpptools-extension-pack|ms-vscode|1.3.0| |cpptools-themes|ms-vscode|2.0.0| |csharp|ms-dotnettools|1.25.0| |dotnet-test-explorer|formulahendry|0.7.8| |jupyter|ms-toolsai|2022.9.1202862440| |jupyter-keymap|ms-toolsai|1.0.0| |jupyter-renderers|ms-toolsai|1.0.10| |makefile-tools|ms-vscode|0.6.0| |python|ms-python|2022.16.1| |sqlite-viewer|qwtel|0.1.5| |vscode-docker|ms-azuretools|1.22.2| |vscode-jupyter-cell-tags|ms-toolsai|0.1.6| |vscode-jupyter-slideshow|ms-toolsai|0.1.5| |vscode-pylance|ms-python|2022.11.10| |vscode-thunder-client|rangav|1.20.1|;
changetol8 commented 1 year ago

I had same issue, its highlight error "already contains a definition" but project builds wia CLI