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

Bump LSP protocol version #61494

Merged
merged 3 commits into from
May 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<VisualStudioEditorPackagesVersion>17.2.3194</VisualStudioEditorPackagesVersion>
<ILAsmPackageVersion>5.0.0-alpha1.19409.1</ILAsmPackageVersion>
<ILDAsmPackageVersion>5.0.0-preview.1.20112.8</ILDAsmPackageVersion>
<MicrosoftVisualStudioLanguageServerProtocolPackagesVersion>17.3.5</MicrosoftVisualStudioLanguageServerProtocolPackagesVersion>
<MicrosoftVisualStudioLanguageServerProtocolPackagesVersion>17.3.15</MicrosoftVisualStudioLanguageServerProtocolPackagesVersion>
<MicrosoftVisualStudioShellPackagesVersion>17.2.32505.113</MicrosoftVisualStudioShellPackagesVersion>
<RefOnlyMicrosoftBuildPackagesVersion>16.5.0</RefOnlyMicrosoftBuildPackagesVersion>
<!-- The version of Roslyn we build Source Generators against that are built in this
Expand Down
15 changes: 9 additions & 6 deletions src/Features/Lsif/GeneratorTest/FoldingRangeTests.vb
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ class C{|foldingRange:
#endregion|}", Nothing)>
<InlineData("
using {|foldingRange:System;
using System.Linq;|}", FoldingRangeKind.Imports)>
using System.Linq;|}", "imports")>
<InlineData("
using {|foldingRange:S = System.String;
using System.Linq;|}", FoldingRangeKind.Imports)>
using System.Linq;|}", "imports")>
<InlineData("
{|foldingRange:// Comment Line 1
// Comment Line 2|}", Nothing)>
Public Async Function TestFoldingRanges(code As String, rangeKind As FoldingRangeKind?) As Task
Public Async Function TestFoldingRanges(code As String, rangeKind As String) As Task
Using workspace = TestWorkspace.CreateWorkspace(
<Workspace>
<Project Language="C#" AssemblyName=<%= TestProjectAssemblyName %> FilePath="Z:\TestProject.csproj" CommonReferences="true">
Expand All @@ -64,15 +64,18 @@ using System.Linq;|}", FoldingRangeKind.Imports)>
End Using
End Function

Private Shared Function CreateFoldingRange(kind As FoldingRangeKind?, range As Range) As FoldingRange
Return New FoldingRange() With
Private Shared Function CreateFoldingRange(kind As String, range As Range) As FoldingRange
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@genlu the attributes must be a constant value, or theres an error

BC30934	Conversion from 'FoldingRangeKind' to 'Object' cannot occur in a constant expression used as an argument to an attribute.	Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator.UnitTests	C:\Users\dabarbet\source\repos\roslyn\src\Features\Lsif\GeneratorTest\FoldingRangeTests.vb	39	

Dim foldingRange As FoldingRange = New FoldingRange() With
{
.Kind = kind,
.StartCharacter = range.Start.Character,
.EndCharacter = range.End.Character,
.StartLine = range.Start.Line,
.EndLine = range.End.Line
}
If kind IsNot Nothing Then
foldingRange.Kind = New FoldingRangeKind(kind)
End If
Return foldingRange
End Function
End Class
End Namespace