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

Multi-target project support #205

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
32 changes: 32 additions & 0 deletions tests/CSharpLanguageServer.Tests/InitializationTests.fs
Original file line number Diff line number Diff line change
@@ -116,3 +116,35 @@ let testServerRegistersCapabilitiesWithTheClient () =

Assert.IsTrue(client.ServerDidRespondTo("initialize"))
Assert.IsTrue(client.ServerDidRespondTo("initialized"))


[<TestCase>]
let testMultiTargetProjectLoads () =
use client = setupServerClient { defaultClientProfile with LoggingEnabled=true }
"TestData/testMultiTargetProjectLoads"
client.StartAndWaitForSolutionLoad()

use classFile = client.Open("Project/Class.cs")

let hover0Params: HoverParams =
{ TextDocument = { Uri = classFile.Uri }
Position = { Line = 2u; Character = 16u }
WorkDoneToken = None
}

let hover0: Hover option =
client.Request("textDocument/hover", hover0Params)

match hover0 with
| Some hover ->
match hover.Contents with
| U3.C1 c ->
Assert.AreEqual(MarkupKind.Markdown, c.Kind)
Assert.AreEqual("`` void Class.Method(string arg) ``", c.Value)
| _ -> failwith "C1 was expected"

Assert.IsTrue(hover.Range.IsNone)

| x -> failwithf "Some (U3.C1 c) was expected but '%s' received" (string x)

Assert.IsTrue(false)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class Class
{
public void Method(string arg)
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
</PropertyGroup>
</Project>

Unchanged files with check annotations Beta

match definition0 with
| Some (U2.C2 definition0Locations) ->
Assert.AreEqual(expectedLocations0, definition0Locations)
| _ -> failwithf "Some Location[] was expected but %s received" (string definition0)

Check warning on line 82 in tests/CSharpLanguageServer.Tests/DefinitionTests.fs

GitHub Actions / build (windows-latest, 8.0.404)

Main module of program is empty: nothing will happen when it is run

Check warning on line 82 in tests/CSharpLanguageServer.Tests/DefinitionTests.fs

GitHub Actions / build (windows-latest, 8.0.404)

Main module of program is empty: nothing will happen when it is run

Check warning on line 82 in tests/CSharpLanguageServer.Tests/DefinitionTests.fs

GitHub Actions / build (ubuntu-24.04, 8.0.404)

Main module of program is empty: nothing will happen when it is run

Check warning on line 82 in tests/CSharpLanguageServer.Tests/DefinitionTests.fs

GitHub Actions / build (ubuntu-24.04, 8.0.404)

Main module of program is empty: nothing will happen when it is run