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

Request textDocument/documentSymbol fails when expanding a user-defined snippet #5915

Closed
rledyard opened this issue Jul 12, 2023 · 2 comments
Assignees
Milestone

Comments

@rledyard
Copy link

rledyard commented Jul 12, 2023

Environment data

dotnet --info output:
.NET SDK:
Version: 8.0.100-preview.5.23303.2
Commit: 3fe444af72

Runtime Environment:
OS Name: Windows
OS Version: 10.0.19045
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\8.0.100-preview.5.23303.2\

.NET workloads installed:
There are no installed workloads to display.

Host:
Version: 8.0.0-preview.5.23280.8
Architecture: x64
Commit: bc78804f5d

.NET SDKs installed:
6.0.411 [C:\Program Files\dotnet\sdk]
7.0.202 [C:\Program Files\dotnet\sdk]
7.0.203 [C:\Program Files\dotnet\sdk]
7.0.305 [C:\Program Files\dotnet\sdk]
8.0.100-preview.5.23303.2 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.19 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.0-preview.5.23302.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.19 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.0-preview.5.23280.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.15 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.19 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.0-preview.5.23302.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

VS Code version: 1.80.0

C# Extension version: 2.0.248
C# Dev Kit version: 0.1.103
C# Intellicode for DevKit: 0.1.26

OmniSharp log (C# Output)

[Error - 11:16:55 AM] Request textDocument/documentSymbol failed.
Error: name must not be falsy
at Function.validate (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:95:17678)
at new r (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:95:17973)
at V (c:\Users\randy.ledyard.vscode\extensions\ms-dotnettools.csharp-2.0.248-win32-x64\dist\extension.js:2:1969276)
at c (c:\Users\randy.ledyard.vscode\extensions\ms-dotnettools.csharp-2.0.248-win32-x64\dist\extension.js:2:2007332)
at Object.t.map (c:\Users\randy.ledyard.vscode\extensions\ms-dotnettools.csharp-2.0.248-win32-x64\dist\extension.js:2:2007418)
at Object.asDocumentSymbols (c:\Users\randy.ledyard.vscode\extensions\ms-dotnettools.csharp-2.0.248-win32-x64\dist\extension.js:2:1977094)
at r (c:\Users\randy.ledyard.vscode\extensions\ms-dotnettools.csharp-2.0.248-win32-x64\dist\extension.js:2:1915643)
at o.provideDocumentSymbols (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:101:37263)

Steps to reproduce

  1. Create a new CSharp file in the project.
  2. type 'puc' at the top of the empty file in the editor (this is a user-defined snippet that expands to 'public class')
  3. hit Tab - error appears at bottom of screen

Expected behavior

puc should expand to public class without throwing an error

Actual behavior

error appears at bottom of screen when hitting the Tab key to expand the user snippet

Additional context

this error did not occur when using the C#/OmniSharp setup, prior to using the new C# dev extension

the "puc" is my code snippet shortcut for this snippet:
"PublicClass": {
"prefix": "puc",
"body": ["public class "],
"description": "puc expands to public class"
},
which is in my AppData > Roaming > Code > User > snippets > csharp.json file

@beccamc - new bug as you requested
(from #5891 (comment))

@arunchndr arunchndr added this to the GA milestone Jul 20, 2023
@beccamc
Copy link
Contributor

beccamc commented Jul 21, 2023

Sorry @rledyard, maybe I misread your original comment. This does look the same. Is it fixed on latest version 2.0.283? If not I'll take a look at a fix.

@arunchndr arunchndr modified the milestones: GA, Post GA Jul 25, 2023
@rledyard
Copy link
Author

@beccamc Yes it appears to work correctly now with my snippets.

@beccamc beccamc closed this as completed Jul 31, 2023
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

3 participants