-
Notifications
You must be signed in to change notification settings - Fork 685
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
Multiple Errors Appear When Creating a C# Text File #6973
Comments
Interesting. Setting the language to C# makes the extension aware of the file but since it hasn't been saved it doesn't have an extension. Note that since it hasn't been saved it won't be associated with a particular project, meaning it may not have all the references you may want. As a workaround you can use the file explorer to save a new empty file in your open folder. |
First of all, how do I go about doing the workaround you mentioned? I am actually just starting to use Visual Studio Code, so I am not knowledgeable of how to do it. Secondly, do you think it is possible for the developers to fix the cause of the errors? I know it has something to do with the extension because it doesn't happen when I create a new text file using the C or the C++ extensions? |
After you have opened a folder in VS Code, you will see buttons in the title bar of the file explorer when your mouse is hovering over it. Also, if your folder contains subfolders, then you can right click on a subfolder and there will be a "New File..." option.
Yes, I think this issue is fixable but it may not be a high priority. There is still the caveat that until the file is saved it won't be associated with a particular project. This means, that if you had added references to NuGet packages to your project, they will not be available within the file until it has been saved. |
I see the "New File..." after opening a folder. Do I just click it, and if I do that, what is the next thing to do? |
I mostly use VSCode to prepare some code within new and not saved tabs and no projects. Just now VSCode started showing annoying error popup on every program start with unnamed tabs. For now only permanent option is disable all notifications from C# extension/module. |
This is not limited to unsaved text files. E.g. opening a staged file in source control bar gives the following:
(Note that I masked the path of the opened file, including the url encoded part.) I've been getting these for roughly "few weeks" now. Annoying popups, but otherwise harmless. I'm not familiar with inner workings of Visual Studio Code or language servers, so the following is conjecture, but this smells like a more general problem of this extension erroring out when it's touching bunch of things that it's not supposed to be touching and then turning it into a user problem. E.g. seems to me new text files and staged C# files in some git temporary folder don't need much more language specific processing from extenstions than some basic syntax highlighting. |
This happens every time I stage
|
Same here
Edit: Was able to fix that updating SDK version (8.0.302) and removing the older version (8.0.100) |
Currently using 8.0.302 but the issue still persists. |
Have you checked the installed SDKs list? Make sure you don't have more versions for 8.X available (or maybe not any other version at all, if big Visual Studio is not a thing for you). To that end, I suggest using https://learn.microsoft.com/en-us/dotnet/core/additional-tools/uninstall-tool
1000% agreed. And you can't even turn these off. I was also loosing IntelliSense, which is even worse |
The fix for this should make it into next week's prerelease |
This should be fixed (at least for new C# files / diff window files) in the 2.39.28 prerelease version of the C# extension |
Type: Bug
Issue Description
When creating a C# text file with the extension installed on Visual Studio Code, three errors pop up:
Request textDocument/inlayHint failed.
Request textDocument/codeAction failed.
Request textDocument/diagnostic failed.
C# Log
[Error - 8:01:11 PM] Request textDocument/diagnostic failed.
Message: Unsupported extension '' and LSP language id ''
Code: -32000
[object Object]
[Error - 8:01:11 PM] Document pull failed for text document untitled:Untitled-1
Message: Unsupported extension '' and LSP language id ''
Code: -32000
[object Object]
[Error - 8:01:11 PM] Request textDocument/codeAction failed.
Message: Unsupported extension '' and LSP language id ''
Code: -32000
[object Object]
[Error - 8:01:11 PM] Request textDocument/inlayHint failed.
Message: Unsupported extension '' and LSP language id ''
Code: -32000
[object Object]
Steps
Expected Results
Nothing.
Actual Results
Three errors pop up.
Extension version: 2.22.3
VS Code version: Code 1.87.2 (863d2581ecda6849923a2118d93a088b0745d9d6, 2024-03-08T15:20:17.278Z)
OS version: Windows_NT x64 10.0.22631
Modes:
System Info
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
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
A/B Experiments
The text was updated successfully, but these errors were encountered: