Skip to content
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

Self closing tag for components in .razor triggers intellisense usage #7871

Open
skyslide22 opened this issue Dec 11, 2024 · 1 comment
Open
Assignees
Labels

Comments

@skyslide22
Copy link

skyslide22 commented Dec 11, 2024

Bildschirmaufnahme.2024-12-11.um.17.17.45.mov

Type: Bug

Writing the self closing tag myself will trigger autocomplete and insert first suggestion(like #, % or --cssvar).

I have disabled every extension except C#, restarted vscode as well.

I have tested it in a brand new dotnet new blazor -int webassembly -n test app, created this component:

Components/Hello.razor
<p>hellp @SecondWord</p>
@code
{
    [Parameter] public string SecondWord { get; set; }
}
Home.razor

<Hello SecondWord="world"
<Hello SecondWord="world" /
<Hello SecondWord="world" @/_blank></Hello>

Seems like / is not canceling the auto complete

Bildschirmaufnahme.2024-12-11.um.17.17.45.mov

Steps to Reproduce

  1. Open a FIle.razor file with ASP.NET Razor as language (blazor component)
  2. Open a component tag using <MyComponent Prop1="2" |
  3. Self close the tag by typing SHIFT + 7 and SHIFT + < (german keyboard, should result in />)
  4. When / is inserted, intellisense will jump in and suggests random stuff; when i add the last char > to it it results in this:
    • <IcomGap Gap="4" /%></IcomGap> instead of .."4" />
  5. Can be avoided by pressing ESC for every single button press, thats not what i want to do lol

Expected behavior

  1. <IcomGap Gap="4"
  2. <IcomGap Gap="4" // pressed
  3. <IcomGap Gap="4" />> pressed

Actual behavior

  1. <IcomGap Gap="4"
  2. <IcomGap Gap="4" // pressed
  3. <IcomGap Gap="4" /%></IcomGap> > pressed

Additional context

Add any other context about the problem here.

Logs

C# log

Post the output from Output-->C# here

C# LSP Trace Logs

Post the output from Output-->C# LSP Trace Logs here. Requires the `C#` output window log level to be set to `Trace`

Environment information

VSCode version: 1.95.3
C# Extension: 2.55.29
Using OmniSharp: false

Dotnet Information

Host:
Version: 8.0.11
Architecture: arm64
Commit: 9cb3b725e3
RID: osx-arm64

.NET SDKs installed:
No SDKs were found.

.NET runtimes installed:
Microsoft.NETCore.App 8.0.11 [/Users/skyslide/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/8.0.11~arm64/shared/Microsoft.NETCore.App]

Other architectures found:
x64 [/usr/local/share/dotnet]
registered at [/etc/dotnet/install_location_x64]

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.55.29 ms-dotnettools.csharp-2.55.29-darwin-arm64
vscode-dotnet-runtime ms-dotnettools 2.2.3 ms-dotnettools.vscode-dotnet-runtime-2.2.3

Extension version: 2.55.29
VS Code version: Code 1.95.3 (Universal) (f1a4fb101478ce6ec82fe9627c43efbf9e98c813, 2024-11-13T14:50:04.152Z)
OS version: Darwin arm64 24.1.0
Modes:

System Info
Item Value
CPUs Apple M3 Pro (12 x 2400)
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
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) 5, 4, 4
Memory (System) 18.00GB (1.18GB free)
Process Argv --crash-reporter-id a35965bc-18c1-4b4d-b302-657cedf840cf
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyt551:31179978
vscod805:30301674
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
pythonnoceb:30805159
pythonmypyd1:30879173
2e7ec940:31000449
pythontbext0:30879054
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
dvdeprecation:31068756
dwnewjupyter:31046869
nativerepl1:31139838
pythonrstrctxt:31112756
nativeloc2:31192216
cf971741:31144450
iacca1:31171482
notype1:31157159
5fd0e150:31155592
dwcopilot:31170013
stablechunks:31184530

@skyslide22
Copy link
Author

I have to add it happens also in strings, when i type / in <img style="aspect-ratio: 16 /, after i type / the suggestions pop up and are filled in when pressing any key (space f.e.) except ESC

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

No branches or pull requests

4 participants