microsoft / vscode-dotnettools

This is a feedback repository to capture issues logged for the C# Dev Kit and related extensions from Visual Studio Code
Other
225 stars 10 forks source link

Issue with using namespace where name is X.Y.Z.Windows #599

Open zeekbrown opened 11 months ago

zeekbrown commented 11 months ago

Type: Bug

In a partial class CustomComponent : ComponentBase, a namespace is being reported as unessary (IDE0005: using directive is unnecessary). The namespace is "App1.Features.Home.Windows" and using a class from the namespace works when compiling/running the app; but VSCode reports it as an issue. Nesting the namespace one level deeper, resolves the issue so App1.Features.Home.Windows => App1.Features.Home.Windows.Test. Visual Studio does not have the same issue if the project is opened there instead of VSCode.

Extension version: 0.5.150 VS Code version: Code 1.83.0 (e7e037083ff4455cf320e344325dacb480062c3c, 2023-10-03T16:12:16.321Z) OS version: Windows_NT x64 10.0.19044 Modes:

System Info |Item|Value| |---|---| |CPUs|11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz (8 x 2803)| |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)|15.73GB (0.69GB free)| |Process Argv|--crash-reporter-id 2ce54aa8-113b-4a7f-b4a8-a77577f065c6| |Screen Reader|no| |VM|0%|
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vstes627:30244334 vslsvsres303:30308271 vserr242cf:30382550 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263:30335439 vscorecescf:30445987 vscod805:30301674 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593:30376534 pythonvs932:30410667 py29gd2263cf:30856253 vscaat:30438848 vsclangdc:30486549 c4g48928:30535728 dsvsc012cf:30540253 pynewext54:30695312 azure-dev_surveyonecf:30548226 2e4cg342:30602488 f6dab269:30613381 showlangstatbar:30737416 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 ```
tmeschter commented 11 months ago

Moving to "area-roslyn" as this involves live diagnostics.

jasonmalinowski commented 11 months ago

@zeekbrown Can you share a screenshot? It might make sure we're on the same page of the repro here, but also I'm curious if you're seeing other types or members in the file as having the correct colors and things like that.

zeekbrown commented 11 months ago

These are the only lines with incorrect colors / warnings in the file. The screen shot is three separate images stitched together so you can see all warnings / color issues easier. When this was a single .razor file everything worked fine. I've moved the code block into a code behind razor.cs file and now have this issue.

image

jasonmalinowski commented 11 months ago

@zeekbrown Is that all stitched together from a single file? Or different files?

zeekbrown commented 11 months ago

All screen shots were from the same file. It was too many lines to show easily so I took screen shots of the problem lines from within the file and stitched them together into a single screen shot.

github-actions[bot] commented 5 months ago

This issue has been marked as stale after 14 days of inactivity. @[ @jasonmalinowski @], could you please take a look?