dotnet / vscode-csharp

Official C# support for Visual Studio Code
MIT License
2.87k stars 675 forks source link

Blazor codebehind randomly fails to identify methods of base classes. #4440

Open sharpninja opened 3 years ago

sharpninja commented 3 years ago

Issue Description

The Blazor Codebehind methods are randomly not found by intellisense:

image

Steps to Reproduce

It's random, and the method not detected is not consistent.

Expected Behavior

Detect base class methods and not warn when using the override keyword.

Actual Behavior

Randomly doesn't detect base class methods and shows an error in the Problems that never goes away.

Logs

OmniSharp log

The VS Code instance became non-responsive and reloading the window came back with a whole host of different errors. Did I metion this random?

C# log

The VS Code instance became non-responsive and reloading the window came back with a whole host of different errors. Did I metion this random?

Post the output from Output-->C# here

Environment information

VSCode version: 1.54.2 C# Extension: 1.23.9

Dotnet Information .NET SDK (reflecting any global.json): Version: 5.0.200 Commit: 70b3e65d53 Runtime Environment: OS Name: Windows OS Version: 10.0.19042 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\5.0.200\ Host (useful for support): Version: 5.0.3 Commit: c636bbdc8a .NET SDKs installed: 5.0.200-preview.21077.7 [C:\Program Files\dotnet\sdk] 5.0.200 [C:\Program Files\dotnet\sdk] .NET runtimes installed: Microsoft.AspNetCore.All 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.25 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.25 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.0.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.25 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.0.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.12 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-download
Visual Studio Code Extensions |Extension|Author|Version| |---|---|---| |aspnet-helper|schneiderpat|0.6.4| |aspnetcore-docs|serpent5|0.0.3| |auto-close-tag|formulahendry|0.5.10| |auto-using|Fudge|0.7.15| |azure-account|ms-vscode|0.9.7| |azure-pipelines|ms-azure-devops|1.183.0| |better-comments|aaron-bond|2.1.0| |binary-viewer|momoto|0.0.1| |blazor-snippet-pack|adrianwilczynski|2.6.1| |blazorcomponents|ThomasHop|0.0.1| |blazorsnippets|ScottSauber|1.5.1| |blazorwasm-companion|ms-dotnettools|1.0.0| |blazory|BartVanHoey|0.0.164| |brackets-keybindings|ms-vscode|0.1.1| |brackets-pack|ms-vscode|0.1.1| |cake-vscode|cake-build|1.0.0| |code-runner|formulahendry|0.11.3| |code-web-search|alexjercan|1.0.0| |csharp|ms-dotnettools|1.23.9| |Csharp-ASPNETCore|rahulsahay|1.11.0| |csharp-code-snippets|Somejack|0.0.1| |csharp-colors|logerfo|0.1.8| |csharp-format-usings|gaoshan0621|0.0.4| |csharp-grammar-extended|dannymcgee|1.1.1| |csharp-helper|roadsidejesus|0.0.14| |csharp-interpolated-string-converter|corylulu|0.1.6| |csharp-workspace|qp|0.1.3| |csharpsortusings|jongrant|0.0.3| |cshtml|fireside21|0.1.3| |debugger-for-edge|msjsdiag|1.0.15| |dotenv|mikestead|1.0.1| |dotnet-core-commands|matijarmk|1.0.6| |dotnet-interactive-vscode|ms-dotnettools|1.0.216102| |EditorConfig|EditorConfig|0.16.4| |ef-core-snippets|LewisYLiu|1.0.0| |fold-to-definitions|argiolasriccardo90|1.7.8| |hexeditor|ms-vscode|1.4.0| |highlight-trailing-white-spaces|ybaumes|0.0.2| |html-to-css-autocompletion|solnurkarim|1.1.2| |ilspy-vscode|icsharpcode|0.9.0| |integrated-stackoverflow|saurabh|1.0.1| |msbuild-project-tools|tintoy|0.3.15| |namespace|adrianwilczynski|1.1.2| |net-core-starters-pack|blairleduc|1.1.0| |netcore-editorconfiggenerator|doggy8088|0.1.1| |network-edge-devtools|ms-edgedevtools|1.0.0| |open-nuget-site|itn3000|0.0.1| |powershell-preview|ms-vscode|2021.2.1| |prettier-vscode|SimonSiefke|2.0.7| |project-stone|wonsong|0.1.1| |qbasic-dark|GatewayProgrammingSchoolInc|0.0.1| |quicktype|quicktype|12.0.46| |razor-snippets-for-asp-net-core|aledev29|0.0.3| |reg|ionutvmi|1.0.2| |scaffold|firefox|1.0.0| |scratchpadmd|saahilclaypool|0.2.0| |search|dbatools|1.1.3| |sidebar-markdown-notes|assisrMatheus|1.0.4| |specflow-tools|amillard98|1.1.3| |stack-overflow-view|4tron|0.1.1| |stack-trace-formatter|RadwanFaci|1.0.6| |supersharp|craigthomas|0.1.4| |support|nuke|0.2.2| |surround-with-csharp|nikiforovall|1.3.0| |svn-scm|johnstoncode|2.13.5| |sysmon|DarkOperator|1.3.0| |user-secrets|adrianwilczynski|2.0.1| |vs-keybindings|ms-vscode|0.2.0| |vscode-azureresourcegroups|ms-azuretools|0.3.0| |vscode-csharp-snippets|jorgeserrano|1.1.0| |vscode-dotnet-runtime|ms-dotnettools|1.0.0| |vscode-nuget-package-manager|jmrog|1.1.6| |vscode-nupkg|eridem|1.0.1| |vscode-nxunit-test-adapter|wghats|0.1.3| |vscode-openapi|42Crunch|4.2.0| |vscode-quick-select|dbankier|0.2.9| |vscode-solution-explorer|fernandoescolar|0.3.11| |vscode-test-explorer|hbenl|2.19.5| |vscode-versionlens|Hoffs|0.25.6| |vscode-vslauncher|spmeesseman|1.0.7| |vscode-wasm|dtsvet|1.3.1| |vscode-yaml|redhat|0.16.0| |vscodeilviewer|josephwoodward|0.0.1| |vscodeintellicode|VisualStudioExptTeam|1.2.11| |webpack|jeremyrajan|2.2.0| |xml|DotJoshJohnson|2.5.1|;
nohwnd commented 3 years ago

Could you please confirm that this reproduces on the latest version of the extension for you? There were changes in the most recent version that should make this behave better.

VahidN commented 3 years ago

This issue gets worse with @inherits directives: Suppose we have these lines in our .razor file

@typeparam T
@inherits InputBase<T>

Now in the related partial .cs file, none of the protected methods or properties of the inherited InputBase are accessible.