Open TrieBr opened 7 months ago
Like https://github.com/dotnet/vscode-csharp/issues/6852, seems like our closed file support might have stopped working.
Hmm. I think I'm seeing this too. I just created a new Blazor server app using the dotnet CLI and the PageTitle
component, along with all the other components referenced in the _Imports.razor
file all highlight as red, unrecognized tags.
I'm also facing this problem and one workaround I Found is to create a code behind class for the Component or Razor page
I'm facing this issue on M1 mac. The issue is that I cant reliably reproduce it. It seems to appear after renaming files and all goes crazy afterwords. I havent figured out a consistent workaround either
it seems to appear after renaming files and all goes crazy afterwords. I havent figured out a consistent workaround either
This seems to be a new repro. The current issue has 100% repro and we believe we have a fix. @ktravelet can you file a separate issue when you get into that state? The best thing to do would be set razor logs to trace in your settings.json
with "razor.server.trace": "Trace"
and when you hit the issue use the Razor: report an issue
command
Issue Description
I think I finally found the main issue preventing me from using VS Code.
I have
dotnet.backgroundAnalysis.compilerDiagnosticsScope
anddotnet.backgroundAnalysis.analyzerDiagnosticsScope
both set tofullSolution
andcsharp.maxProjectFileCountForDiagnosticAnalysis
set to 9999999999. However it appears that the extension ignores this setting for razor files. After a certain number of razor files, you end up with tons of "Found markup element with unexpected name "SomeComponent" errors until you go openSomeComponent.razor
Steps to Reproduce
Clone my test repo here.
Open
BlazorInputBug/InputBug/Pages/Counter.razor
. Notice that "InputTextFour" is underlined and an error showsFound markup element with unexpected name 'InputTextFour'. If this is intended to be a component, add a @using directive for its namespace.
. NOTE: Sometimes (flaky) it does work, but you can rename the component to something else likeInputTextFive
orInputTextSix
and observe the same behavior.Open
BlazorInputBug/InputBug/Shared/Inputs/InputTextFour.razor
. Then go back toBlazorInputBug/InputBug/Pages/Counter.razor
and observe the problem goes away.Delete most of the other files (
BlazorInputBug/InputBug/Shared/Inputs/InputText{11..50.razor}
) and command pallete => reload the window. The problem goes away. You can change betweenInputTextTwo
,InputTextThree
,InputTextFour
, etc and they all work.Re-add more files (
for i in {11..50}; do cp InputText.razor "InputText$i.razor"; done
, reload the window and see the problem comes back. You change betweenInputTextTwo
,InputTextThree
,InputTextFour
, etc and is starts to say "Found markup element with unexpected name"Expected Behavior
When dotnet.backgroundAnalysis.compilerDiagnosticsScope is set to
fullSolution
, all razor files should be indexed, and I shouldn't have to go open the ".razor" file to get rid of reference errors.Actual Behavior
After enough razor files in the solution (my tests seem to break at only 50, but i didn't bisect a smaller number). Intellesense stop working for Blazor components
Logs
Archive.zip
C# log
https://pastebin.com/xwDQQM8k
C# LSP Trace Logs
https://pastebin.com/KrCEXRNw