Skip to content

Incorrect Red and Yellow Squigglies in VSCode editor for Razor #11871

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
danroot opened this issue May 17, 2025 · 0 comments
Open

Incorrect Red and Yellow Squigglies in VSCode editor for Razor #11871

danroot opened this issue May 17, 2025 · 0 comments

Comments

@danroot
Copy link

danroot commented May 17, 2025

Is this a Bug or Feature request?:

Bug

Steps to reproduce:

Unsure exact repro steps. Open .razor file and begin editing.

Description of the problem:

I routinely get invalid red and yellow squigglies when editing .razor files in VSCode. The application builds and runs fine, but the VSCode editor shows red and yellow underlines that are incorrect. If I hover over them they will say things like " Type or namespace could not be found", "Found markup with unexpected name", etc. Again, the app will build and run, so I know the problem is not the code.
Sometimes it gets really confused and the errors will be on old lines of code (ie if I add lines, the highlighting will not be on the correct line completely). Sometimes it ends up highlighting the entire document red. This makes it very frustrating to edit Blazor in VSCode.

I suspect it is the Language Service Provider. It's as though it's cached an old version of the code and not updating. Some other nuance/details that may or may not be relevant:

  • I am referencing a "Shared" blazor ui library project from multiple other blazor projects. Some of the issue seems to be it not recognizing shared components etc from the shared library.
  • I'm on a M1 MacBook
  • I use CoPilot. Sometimes the problem starts as CoPilot is applying it's diff.

Expected behavior:
If the app builds and is valid, no red squigglies show, and only valid yellow ones. If there are errors, they are highlighted in the correct place. In the event things to get out of wack, some way to completely reset the LSP (if that will fix it)

Actual behavior:
Red squigglies when the code is valid, yellow ones that are wrong.
Image

Logs

OmniSharp

Not present

Razor

Expand

-- Starting Issue Data Collection-- 
Notifying document '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor' changed 'opened' with '0' changes.
64 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs':
    Currently at 12, synchronizing to version '13'.'
64 - Projected document not in sync with host document, waiting for update...
    Current host document sync version: 12
65 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.html':
    Currently at 12, synchronizing to version '13'.'
65 - Projected document not in sync with host document, waiting for update...
    Current host document sync version: 12
Updating the HTML document for Razor file '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor' (13)
Notifying document '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor' changed 'htmlChanged' with '0' changes.
65 - Projected document in sync with host document
65 - Projected text document not in sync with data type, waiting for update...
    Current projected text document sync version: 12
Updating the C# document for Razor file '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor' (13)
Notifying document '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor' changed 'csharpChanged' with '0' changes.
64 - Projected document in sync with host document
64 - Projected text document not in sync with data type, waiting for update...
    Current projected text document sync version: 12
66 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs':
    Currently at 13, synchronizing to version '13'.'
66 - Projected document in sync with host document
66 - Projected text document not in sync with data type, waiting for update...
    Current projected text document sync version: 12
67 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs':
    Currently at 13, synchronizing to version '13'.'
67 - Projected document in sync with host document
67 - Projected text document not in sync with data type, waiting for update...
    Current projected text document sync version: 12
65 - Projected text document synchronized to 13.
65 - Projected text document in sync with data type
65 - Synchronization successful!
64 - Projected text document synchronized to 13.
66 - Projected text document synchronized to 13.
67 - Projected text document synchronized to 13.
64 - Projected text document in sync with data type
64 - Synchronization successful!
66 - Projected text document in sync with data type
66 - Synchronization successful!
67 - Projected text document in sync with data type
67 - Synchronization successful!
68 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs':
    Currently at 13, synchronizing to version '13'.'
68 - Projected document in sync with host document
68 - Projected text document in sync with data type
68 - Synchronization successful!
69 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs':
    Currently at 13, synchronizing to version '13'.'
69 - Projected document in sync with host document
69 - Projected text document in sync with data type
69 - Synchronization successful!
70 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs':
    Currently at 13, synchronizing to version '13'.'
70 - Projected document in sync with host document
70 - Projected text document in sync with data type
70 - Synchronization successful!
71 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs':
    Currently at 13, synchronizing to version '13'.'
71 - Projected document in sync with host document
71 - Projected text document in sync with data type
71 - Synchronization successful!
72 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.html':
    Currently at 13, synchronizing to version '13'.'
72 - Projected document in sync with host document
72 - Projected text document in sync with data type
72 - Synchronization successful!
73 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs':
    Currently at 13, synchronizing to version '13'.'
73 - Projected document in sync with host document
73 - Projected text document in sync with data type
73 - Synchronization successful!
74 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs':
    Currently at 13, synchronizing to version '13'.'
74 - Projected document in sync with host document
74 - Projected text document in sync with data type
74 - Synchronization successful!
75 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs':
    Currently at 13, synchronizing to version '13'.'
75 - Projected document in sync with host document
75 - Projected text document in sync with data type
75 - Synchronization successful!
76 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs':
    Currently at 13, synchronizing to version '13'.'
76 - Projected document in sync with host document
76 - Projected text document in sync with data type
76 - Synchronization successful!
77 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs':
    Currently at 13, synchronizing to version '13'.'
77 - Projected document in sync with host document
77 - Projected text document in sync with data type
77 - Synchronization successful!
78 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs':
    Currently at 13, synchronizing to version '13'.'
78 - Projected document in sync with host document
78 - Projected text document in sync with data type
78 - Synchronization successful!
79 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs':
    Currently at 13, synchronizing to version '13'.'
79 - Projected document in sync with host document
79 - Projected text document in sync with data type
79 - Synchronization successful!
80 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs':
    Currently at 13, synchronizing to version '13'.'
80 - Projected document in sync with host document
80 - Projected text document in sync with data type
80 - Synchronization successful!
81 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs':
    Currently at 13, synchronizing to version '13'.'
81 - Projected document in sync with host document
81 - Projected text document in sync with data type
81 - Synchronization successful!
82 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs':
    Currently at 13, synchronizing to version '13'.'
82 - Projected document in sync with host document
82 - Projected text document in sync with data type
82 - Synchronization successful!
83 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs':
    Currently at 13, synchronizing to version '13'.'
83 - Projected document in sync with host document
83 - Projected text document in sync with data type
83 - Synchronization successful!
84 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs':
    Currently at 13, synchronizing to version '13'.'
84 - Projected document in sync with host document
84 - Projected text document in sync with data type
84 - Synchronization successful!
85 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs':
    Currently at 13, synchronizing to version '13'.'
85 - Projected document in sync with host document
85 - Projected text document in sync with data type
85 - Synchronization successful!
86 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs':
    Currently at 13, synchronizing to version '13'.'
86 - Projected document in sync with host document
86 - Projected text document in sync with data type
86 - Synchronization successful!
87 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs':
    Currently at 13, synchronizing to version '13'.'
87 - Projected document in sync with host document
87 - Projected text document in sync with data type
87 - Synchronization successful!
88 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs':
    Currently at 13, synchronizing to version '13'.'
88 - Projected document in sync with host document
88 - Projected text document in sync with data type
88 - Synchronization successful!
89 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs':
    Currently at 13, synchronizing to version '13'.'
89 - Projected document in sync with host document
89 - Projected text document in sync with data type
89 - Synchronization successful!
90 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs':
    Currently at 13, synchronizing to version '13'.'
90 - Projected document in sync with host document
90 - Projected text document in sync with data type
90 - Synchronization successful!
91 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs':
    Currently at 13, synchronizing to version '13'.'
91 - Projected document in sync with host document
91 - Projected text document in sync with data type
91 - Synchronization successful!
92 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs':
    Currently at 13, synchronizing to version '13'.'
92 - Projected document in sync with host document
92 - Projected text document in sync with data type
92 - Synchronization successful!
93 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs':
    Currently at 13, synchronizing to version '13'.'
93 - Projected document in sync with host document
93 - Projected text document in sync with data type
93 - Synchronization successful!
94 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs':
    Currently at 13, synchronizing to version '13'.'
94 - Projected document in sync with host document
94 - Projected text document in sync with data type
94 - Synchronization successful!
95 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs':
    Currently at 13, synchronizing to version '13'.'
95 - Projected document in sync with host document
95 - Projected text document in sync with data type
95 - Synchronization successful!
96 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs':
    Currently at 13, synchronizing to version '13'.'
96 - Projected document in sync with host document
96 - Projected text document in sync with data type
96 - Synchronization successful!
97 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs':
    Currently at 13, synchronizing to version '13'.'
97 - Projected document in sync with host document
97 - Projected text document in sync with data type
97 - Synchronization successful!
98 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs':
    Currently at 13, synchronizing to version '13'.'
98 - Projected document in sync with host document
98 - Projected text document in sync with data type
98 - Synchronization successful!
99 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs':
    Currently at 13, synchronizing to version '13'.'
99 - Projected document in sync with host document
99 - Projected text document in sync with data type
99 - Synchronization successful!
100 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs':
    Currently at 13, synchronizing to version '13'.'
100 - Projected document in sync with host document
100 - Projected text document in sync with data type
100 - Synchronization successful!
101 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs':
    Currently at 13, synchronizing to version '13'.'
101 - Projected document in sync with host document
101 - Projected text document in sync with data type
101 - Synchronization successful!
102 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs':
    Currently at 13, synchronizing to version '13'.'
102 - Projected document in sync with host document
102 - Projected text document in sync with data type
102 - Synchronization successful!
103 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs':
    Currently at 13, synchronizing to version '13'.'
103 - Projected document in sync with host document
103 - Projected text document in sync with data type
103 - Synchronization successful!
Unable to remap file /Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.ProfessionalPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs at [983:19, 983:39].
104 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs':
    Currently at 13, synchronizing to version '13'.'
104 - Projected document in sync with host document
104 - Projected text document in sync with data type
104 - Synchronization successful!
105 - Synchronizing '/Users/anonymous/Code/MAPPNetwork/mappnetwork/MAPP.AdminPortal.WebUI/Components/Leads/LeadsGrid.razor__virtual.cs':
    Currently at 13, synchronizing to version '13'.'
105 - Projected document in sync with host document
105 - Projected text document in sync with data type
105 - Synchronization successful!
-- Stopping Issue Data Collection-- 

Workspace information

Razor document:

(Omitted - too long for github)

Machine information

VSCode version: 1.100.0
Razor.VSCode version: 2.76.27

dotnet --info

Expand

.NET SDK:
 Version:           9.0.202
 Commit:            3a53853c30
 Workload version:  9.0.200-manifests.21502d11
 MSBuild version:   17.13.13+1c2026462

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  15.3
 OS Platform: Darwin
 RID:         osx-arm64
 Base Path:   /usr/local/share/dotnet/sdk/9.0.202/

.NET workloads installed:
There are no installed workloads to display.
Configured to use loose manifests when installing new manifests.

Host:
  Version:      9.0.3
  Architecture: arm64
  Commit:       831d23e561

.NET SDKs installed:
  6.0.301 [/usr/local/share/dotnet/sdk]
  7.0.100 [/usr/local/share/dotnet/sdk]
  7.0.401 [/usr/local/share/dotnet/sdk]
  8.0.100 [/usr/local/share/dotnet/sdk]
  8.0.203 [/usr/local/share/dotnet/sdk]
  8.0.407 [/usr/local/share/dotnet/sdk]
  9.0.100 [/usr/local/share/dotnet/sdk]
  9.0.202 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.11 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.14 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.11 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.14 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  x64   [/usr/local/share/dotnet/x64]

Environment variables:
  Not set

global.json file:
  Not found

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

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

Extensions

Expand

Extension Author Version
better-comments aaron-bond 3.0.2
compare-folders moshfeu 0.25.1
copilot GitHub 1.322.0
copilot-chat GitHub 0.27.1
csdevkit ms-dotnettools 1.19.63
csharp ms-dotnettools 2.76.27
data-workspace-vscode ms-mssql 0.6.1
debugpy ms-python 2025.8.0
docker docker 0.6.0
gc-excelviewer GrapeCity 4.2.63
gitlens eamodio 17.1.0
hexeditor ms-vscode 1.11.1
insert-unicode brunnerh 0.15.1
ionic Ionic 1.104.0
isort ms-python 2025.0.0
jupyter ms-toolsai 2025.4.0
jupyter-keymap ms-toolsai 1.1.2
jupyter-renderers ms-toolsai 1.1.0
luna-paint Tyriar 0.16.0
mssql ms-mssql 1.31.1
npm idered 1.7.4
nugetpackagemanagergui aliasadidev 2.1.1
powershell ms-vscode 2025.0.0
python ms-python 2025.6.1
remote-containers ms-vscode-remote 0.413.0
remote-explorer ms-vscode 0.5.0
remote-ssh ms-vscode-remote 0.120.0
remote-ssh-edit ms-vscode-remote 0.87.0
rest-client humao 0.25.1
shell-format foxundermoon 7.2.5
sql-bindings-vscode ms-mssql 0.4.1
sql-database-projects-vscode ms-mssql 1.5.1
user-secrets adrianwilczynski 2.0.1
vscode-bicep ms-azuretools 0.35.1
vscode-containers ms-azuretools 2.0.1
vscode-dotnet-runtime ms-dotnettools 2.3.3
vscode-format-context-menu lacroixdavid1 1.0.4
vscode-jupyter-cell-tags ms-toolsai 0.1.9
vscode-jupyter-slideshow ms-toolsai 0.1.6
vscode-nuget-gallery patcx 1.2.4
vscode-pylance ms-python 2025.5.1
vscode-speech ms-vscode 0.14.0
vscode-svgviewer cssho 2.0.0
vscode-taskexplorer spmeesseman 2.13.2
vscode-xml redhat 0.29.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants