message: Correct matching for prerelease .NET versions. Fixes
diff: @@ -34,11 +34,29 @@ export class OmniSharpDotnetResolver implements IHostExecutableResolver {
  throw new Error(`Unable to read dotnet version information. Error ${result.stderr}`);
  }
  - const segments = result.stdout.split('.').map(str => Number.parseInt(str));
  - if (segments.length != 3) {
  + const segments: number[] = [];
  + const stdoutSplit = result.stdout.split('.');
  + if (stdoutSplit.length != 3) {
  throw new Error(`Unknown result output from 'dotnet --version'. Received ${result.stdout}`);
  }
  + let isPrerelease = false;
  +
  + for (let i = 0; i < 3; i++) {
  + let segment = stdoutSplit[i];
  + if (i === 2) {
  + const dashIndex = segment.indexOf('-');
  + if (dashIndex !== -1) {
  + isPrerelease = true;
  + segment = segment.substring(0, dashIndex);
  + }
  + }
  +
  + segments.push(Number.parseInt(segment));
  + }
  +
  + result.stdout.split('.').map(str => Number.parseInt(str));
  +
  if (this.versionPartIsGreaterThanMinimum(segments[0], minimumDotnetMajor, result.stdout)
  || this.versionPartIsGreaterThanMinimum(segments[1], minimumDotnetMinor, result.stdout)) {
  return {
  @@ -48,7 +66,9 @@ export class OmniSharpDotnetResolver implements IHostExecutableResolver {
  };
  }
  - this.versionPartIsGreaterThanMinimum(segments[2], minimumDotnetPatch, result.stdout);
  + // If the found SDK is a pre-release version of .NET, then we need to ensure that it's a _higher_ patch version than the required
  + // minimum, not a prerelease version of the required minimum.
  + this.versionPartIsGreaterThanMinimum(segments[2], minimumDotnetPatch, result.stdout, /*disallowExactMatch*/ isPrerelease);
  return {
  version: result.stdout,
  @@ -57,8 +77,8 @@ export class OmniSharpDotnetResolver implements IHostExecutableResolver {
  };
  }
  - private versionPartIsGreaterThanMinimum(actualVersion: number, minimumRequired: number, foundVersion: string): boolean {
  - if (actualVersion < minimumRequired) {
  + private versionPartIsGreaterThanMinimum(actualVersion: number, minimumRequired: number, foundVersion: string, disallowExactMatch: boolean = false): boolean {
  + if (actualVersion < minimumRequired || (disallowExactMatch && actualVersion === minimumRequired)) {
  throw new Error(`Found dotnet version ${foundVersion}. Minimum required version is ${minimumDotnetMajor}.${minimumDotnetMinor}.${minimumDotnetPatch}.`);
  }
  