Skip to content

Commit a3dd335

Browse files
committed
Bunch of fixes. Should finally take care of all corner cases #41
1 parent 2bea759 commit a3dd335

22 files changed

+169
-138
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[0] = {
2-
"Message": " Compiling pls_core_extras v0.1.0 (D:\\src\\dpt\\pls\\pls_core_extras)"
2+
"Message": " Compiling pls_core_extras v0.1.0 (file:///D:/src/dpt/pls/pls_core_extras)"
33
}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[0] = {
2-
"Message": " Compiling tera v1.17.1"
2+
"Message": " Compiling tera v1.17.1 (https://github.com/rust-lang/crates.io-index)"
33
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[0] = {
2+
"Message": " Compiling file:///D:/src/u/rlenvs/client-rust#gymnasium v0.1.0"
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[0] = {
2+
"Message": " Compiling https://github.com/rust-lang/crates.io-index#futures-util v0.3.30"
3+
}

src/RustAnalyzer.TestAdapter.UnitTests/Cargo/BuildJsonOutputParserTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ public void IfNotParsableReturnAsIs()
3030
[InlineData("CompilerArtifact1.json")]
3131
[InlineData("CompilerArtifact2.json")]
3232
[InlineData("CompilerArtifact3.json")]
33+
[InlineData("CompilerArtifact4.json")]
34+
[InlineData("CompilerArtifact5.json")]
3335
public void ParseCompilerArtifiacts(string dataFile)
3436
{
3537
NamerFactory.AdditionalInformation = $"datafile-{dataFile}";
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"reason": "compiler-artifact",
3+
"package_id": "path+file:///D:/src/u/rlenvs/client-rust#[email protected]",
4+
"manifest_path": "D:\\src\\u\\rlenvs\\client-rust\\Cargo.toml",
5+
"target": {
6+
"kind": [ "lib" ],
7+
"crate_types": [ "lib" ],
8+
"name": "gymnasium",
9+
"src_path": "D:\\src\\u\\rlenvs\\client-rust\\src\\lib.rs",
10+
"edition": "2021",
11+
"doc": true,
12+
"doctest": true,
13+
"test": true
14+
},
15+
"profile": {
16+
"opt_level": "0",
17+
"debuginfo": 2,
18+
"debug_assertions": true,
19+
"overflow_checks": true,
20+
"test": false
21+
},
22+
"features": [],
23+
"filenames": [ "D:\\src\\u\\rlenvs\\client-rust\\target\\debug\\libgymnasium.rlib", "D:\\src\\u\\rlenvs\\client-rust\\target\\debug\\deps\\libgymnasium-dfb398c6697a955e.rmeta" ],
24+
"executable": null,
25+
"fresh": false
26+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"reason": "compiler-artifact",
3+
"package_id": "registry+https://github.com/rust-lang/crates.io-index#[email protected]",
4+
"manifest_path": "C:\\Users\\parth\\scoop\\persist\\rustup\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\futures-util-0.3.30\\Cargo.toml",
5+
"target": {
6+
"kind": [ "lib" ],
7+
"crate_types": [ "lib" ],
8+
"name": "futures-util",
9+
"src_path": "C:\\Users\\parth\\scoop\\persist\\rustup\\.cargo\\registry\\src\\index.crates.io-6f17d22bba15001f\\futures-util-0.3.30\\src\\lib.rs",
10+
"edition": "2018",
11+
"doc": true,
12+
"doctest": true,
13+
"test": true
14+
},
15+
"profile": {
16+
"opt_level": "0",
17+
"debuginfo": 2,
18+
"debug_assertions": true,
19+
"overflow_checks": true,
20+
"test": false
21+
},
22+
"features": [ "alloc", "futures-io", "io", "memchr", "slab", "std" ],
23+
"filenames": [ "D:\\src\\u\\rlenvs\\client-rust\\target\\debug\\deps\\libfutures_util-98553cccec1b9aaa.rlib", "D:\\src\\u\\rlenvs\\client-rust\\target\\debug\\deps\\libfutures_util-98553cccec1b9aaa.rmeta" ],
24+
"executable": null,
25+
"fresh": false
26+
}

src/RustAnalyzer.TestAdapter.UnitTests/Cargo/ToolChainServiceTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public async Task GetTestSuiteTestsAsync(string workspaceRelRoot, string contain
125125
var tcPath = targetPath + (PathEx)containerName;
126126

127127
await _tcs.DoBuildAsync(workspacePath, manifestPath, profile);
128-
var testSuites = await _tcs.GetTestSuiteInfoAsync(tcPath, profile, default).ToArrayAsync();
128+
var testSuites = await (await _tcs.GetTestSuiteInfoAsync(tcPath, profile, default)).ToTaskEnumerableAsync();
129129
var tc = JsonConvert.DeserializeObject<TestContainer>(await tcPath.ReadAllTextAsync(default));
130130

131131
tc.TestExes.All(e => e.FileExists()).Should().BeTrue();

src/RustAnalyzer.TestAdapter.UnitTests/RustAnalyzer.TestAdapter.UnitTests.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@
6565
<None Include="Cargo\TestData\**\*.*">
6666
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
6767
</None>
68+
<None Include="Cargo\TestData\CompilerArtifact5.json">
69+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
70+
</None>
71+
<None Include="Cargo\TestData\CompilerArtifact4.json">
72+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
73+
</None>
6874
</ItemGroup>
6975
<Target Name="CopyTestProjects" AfterTargets="Build">
7076
<ItemGroup>
Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
using System;
21
using System.Collections.Generic;
32
using System.Linq;
4-
using System.Reflection;
53
using KS.RustAnalyzer.TestAdapter.Common;
64
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter;
75
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging;
@@ -24,31 +22,4 @@ public void DiscoverTests(PathEx source, IDiscoveryContext discoveryContext, IMe
2422
}
2523

2624
public abstract void DiscoverTests(IEnumerable<PathEx> sources, IDiscoveryContext discoveryContext, IMessageLogger logger, ITestCaseDiscoverySink discoverySink);
27-
28-
protected void SignupForAssemblyResolution(ILogger logger)
29-
{
30-
AppDomain.CurrentDomain.AssemblyResolve +=
31-
new ResolveEventHandler(CurrentDomain_AssemblyResolve(logger));
32-
}
33-
34-
protected Func<object, ResolveEventArgs, Assembly> CurrentDomain_AssemblyResolve(ILogger logger)
35-
{
36-
return (object sender, ResolveEventArgs args) =>
37-
{
38-
logger.WriteLine(@"This is a sign of impending doom. Have been asked by '{0}' to resolve '{1}'.", args.RequestingAssembly.FullName, args.Name);
39-
40-
var name = new AssemblyName(args.Name);
41-
if (name.Name == "System.Diagnostics.DiagnosticSource")
42-
{
43-
return typeof(System.Diagnostics.DiagnosticSource).Assembly;
44-
}
45-
else if (name.Name == "System.Runtime.CompilerServices.Unsafe")
46-
{
47-
return typeof(System.Runtime.CompilerServices.Unsafe).Assembly;
48-
}
49-
50-
logger.WriteError(@"Unable to resolve resolve assembly '{0}'. Behavior unknow from this point on. Please file a bug at https://github.com/kitamstudios/rust-analyzer.vs.", args.Name);
51-
return null;
52-
};
53-
}
5425
}

0 commit comments

Comments
 (0)