vscode-csharp icon indicating copy to clipboard operation
vscode-csharp copied to clipboard

IntelliSense breaks when hidding sln and csproj files

Open kieranhoney opened this issue 2 years ago • 3 comments

Type: Bug

Issue Description

When excluding sln and csproj files from Explorer in VSCode the C# intellisense breaks entirely.

This may be by design but wanted to confirm. I'm not aware of the inner workings of VSCode and how files are presented to the C# extension, if they are listed but marked as hidden or are just not exposed at all. The reason I do this is just for clarity, it's obviously not a major issue This issue/feature maybe useful for reference as I spent the best part of a day trying to understand why this was happening. I cant remember having the issue wi

Based on the wording in VSCode:

Configure glob patterns for excluding files and folders. For example, the File Explorer decides which files and folders to show or hide based on this setting.

I've always taken this to mean hidden and not excluded, though based on this issue I'm guessing the latter is the case.

Steps to Reproduce

  • Create a new dotnet console application
  • Open in VSCode, all fine, intellisense is working
  • Add the following to VSCode use configuration:
"files.exclude": {
    "**/*.csproj": true,
    "**/*.sln": true
}
  • Close VSCode
  • Open console application again
  • IntelliSense stopped working

Expected Behavior

IntelliSense functions normally

Actual Behavior

IntelliSense no-longer working

Logs

When not hidding files:

Using dotnet configured on PATH
Dotnet path: C:\Program Files\dotnet\dotnet.exe
Activating C# standalone...
waiting for named pipe information from server...
[stdout] {"pipeName":"\\\\.\\pipe\\36def1ce-2e39-408b-a9d3-ca4766c7a3d6"}
received named pipe information from server
attempting to connect client to server...
client has connected to server
[Info  - 8:50:37 AM] [Program] Language server initialized
[Info  - 8:50:38 AM] [LanguageServerProjectSystem] Successfully completed load of c:\Users\me\Source\Personal\IntellisenseBug\IntellisenseBug.csproj
[Info  - 8:50:38 AM] [LanguageServerProjectSystem] Completed (re)load of all projects in 00:00:00.8152196
[Info  - 8:50:39 AM] [LanguageServerProjectSystem] Successfully completed load of c:\Users\me\Source\Personal\IntellisenseBug\IntellisenseBug.csproj
[Info  - 8:50:39 AM] [LanguageServerProjectSystem] Completed (re)load of all projects in 00:00:00.6529274
[Info  - 8:50:56 AM] [LanguageServerProjectSystem] Successfully completed load of c:\Users\me\Source\Personal\IntellisenseBug\IntellisenseBug.csproj
[Info  - 8:50:56 AM] [LanguageServerProjectSystem] Completed (re)load of all projects in 00:00:00.6591692

When hiding files:

Using dotnet configured on PATH
Dotnet path: C:\Program Files\dotnet\dotnet.exe
Activating C# standalone...
waiting for named pipe information from server...
[stdout] {"pipeName":"\\\\.\\pipe\\ab618a39-230c-4f16-a5a5-390ec27445e7"}
received named pipe information from server
attempting to connect client to server...
client has connected to server
[Info  - 8:52:43 AM] [Program] Language server initialized
Using dotnet configured on PATH

C# log

Post the output from Output-->C# here

C# LSP Trace Logs

Post the output from Output-->C# LSP Trace Logs here. Requires `dotnet.server.trace` to be set to `Trace`

Environment information

VSCode version: 1.82.2 C# Extension: 2.3.27 Using OmniSharp: false

Dotnet Information .NET SDK: Version: 7.0.401 Commit: eb26aacfec

Runtime Environment: OS Name: Windows OS Version: 10.0.22621 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\7.0.401\

Host: Version: 7.0.11 Architecture: x64 Commit: ecb34f85ec

.NET SDKs installed: 7.0.401 [C:\Program Files\dotnet\sdk]

.NET runtimes installed: Microsoft.AspNetCore.App 6.0.22 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 7.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.22 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.22 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 7.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found: x86 [C:\Program Files (x86)\dotnet] registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables: Not set

global.json file: Not found

Learn more: https://aka.ms/dotnet/info

Download .NET: https://aka.ms/dotnet/download

Visual Studio Code Extensions
Extension Author Version Folder Name
csharp ms-dotnettools 2.3.27 ms-dotnettools.csharp-2.3.27-win32-x64
symbols miguelsolorio 0.0.14 miguelsolorio.symbols-0.0.14
user-secrets adrianwilczynski 2.0.1 adrianwilczynski.user-secrets-2.0.1
vscode-dotnet-runtime ms-dotnettools 1.8.0 ms-dotnettools.vscode-dotnet-runtime-1.8.0

Extension version: 2.3.27 VS Code version: Code 1.82.2 (abd2f3db4bdb28f9e95536dfa84d8479f1eb312d, 2023-09-14T05:55:25.390Z) OS version: Windows_NT x64 10.0.22621 Modes:

System Info
Item Value
CPUs AMD Ryzen 9 7950X3D 16-Core Processor (32 x 4200)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) undefined
Memory (System) 63.14GB (49.03GB free)
Process Argv . --crash-reporter-id d19224b2-86f4-4f4a-90ba-eec055290798
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscorecescf:30445987
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
pythonvs932:30410667
py29gd2263cf:30792227
3ch9d444:30846783
vsclangdc:30486549
c4g48928:30535728
dsvsc012cf:30540253
pynewext54:30695312
azure-dev_surveyone:30548225
3biah626:30602489
89544117:30613380
2i9eh265:30646982
showlangstatbar:30737416
962ge761:30841074
03d35959:30757346
pythonfmttext:30731395
fixshowwlkth:30771522
showindicator:30805244
pythongtdpath:30769146
i26e3531:30792625
pythonnosmt12:30797651
pythonidxptcf:30805731
pythonnoceb:30805159
copilotsettingc:30839828
dsvsc013:30795093
dsvsc014:30804076
diffeditorv2:30821572
dsvsc015:30845448

kieranhoney avatar Sep 28 '23 08:09 kieranhoney

Unity projects make this particularly annoying, since they generate a ton of .csproj files in the root due to all the plugins/packages/etc commonly used. The explore panel of VS Code basically becomes a giant csproj list, which you can't get rid of if you want IntelliSense.

shadiradio avatar Jan 16 '24 19:01 shadiradio