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

Sdk element improvements #225

Merged
merged 6 commits into from
May 9, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ Task<List<CompletionItem>> GetSdkCompletions (MSBuildRootDocument doc, Cancellat
AddSdksFromDir (sdksPath);
}

var dotNetSdk = doc.Environment.ResolveSdk (("Microsoft.NET.Sdk", null, null), null, null, Logger);
var dotNetSdk = doc.Environment.ResolveSdk (new ("Microsoft.NET.Sdk", null, null), null, null, Logger);
if (dotNetSdk?.Path is string sdkPath) {
string dotNetSdkPath = Path.GetDirectoryName (Path.GetDirectoryName (sdkPath));
if (sdksPath == null || Path.GetFullPath (dotNetSdkPath) != Path.GetFullPath (sdksPath)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class TestMSBuildEnvironment (MSBuildEnvironmentLogger environmentLogger) : Curr
// However, suppress resolution of Microsoft.NET.SDK so tests don't use the SDK fallback.
// The SDK fallback substantially slows down the tests and is not necessary for the tests,
// and different versions of the SDK may introduce unexpected values from inference.
public override SdkInfo ResolveSdk ((string name, string version, string minimumVersion) sdk, string projectFile, string solutionPath, ILogger logger = null)
=> null;
public override SdkInfo ResolveSdk (MSBuildSdkReference sdk, string projectFile, string solutionPath, ILogger logger = null) => null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public static async Task<CodeFixesWithContext> GetCodeFixes (
logger ??= TestLoggerFactory.CreateTestMethodLogger ().RethrowExceptions ();

var snapshot = textView.TextBuffer.CurrentSnapshot;
var diagnostics = MSBuildDocumentTest.GetDiagnostics (snapshot.GetText (), out var parsedDocument, analyzers, includeCoreDiagnostics, logger, schema, null, cancellationToken);
var diagnostics = MSBuildDocumentTest.GetDiagnostics (snapshot.GetText (), out var parsedDocument, analyzers, includeCoreDiagnostics, logger, schema, cancellationToken: cancellationToken);

var codeFixService = new MSBuildCodeFixService (codeFixes.ToArray ());
var fixes = await codeFixService.GetFixes (textView.TextBuffer, parsedDocument, diagnostics, range, requestedSeverities, cancellationToken);
Expand Down
Loading
Loading