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

fix collecting unexpected solution file like 'sln*' #1320

Merged
merged 2 commits into from
Nov 2, 2018

Conversation

itn3000
Copy link
Contributor

@itn3000 itn3000 commented Oct 26, 2018

Overview

This PR fixes omnisharp crash when the directory has '*.slnxxx' file.

Problem Detail

Environment

  • windows8.1-x64
  • omnisharp-vscode: 1.16.2
  • vscode: 1.28.2

Steps to reproduce

  1. create new console project in empty directory
  2. create 'x.slnproj' and edit <Project Sdk="MSBuild.SolutionSdk/0.1.0"></Project>
  3. Restart Omnisharp

Expected behavior

Omnisharp start to watch the project folder.

Actual Behavior

Omnisharp throw the following exception and stop to watch the project.

OmniSharp.MSBuild.SolutionParsing.InvalidSolutionFileException: Solution header should be on first or second line.
   場所 OmniSharp.MSBuild.SolutionParsing.SolutionFile.ParseHeaderAndVersion(Scanner scanner)
   場所 OmniSharp.MSBuild.SolutionParsing.SolutionFile.Parse(String text)
   場所 OmniSharp.MSBuild.ProjectSystem.GetProjectPathsFromSolution(String solutionFilePath)
   場所 OmniSharp.MSBuild.ProjectSystem.Initalize(IConfiguration configuration)
   場所 OmniSharp.WorkspaceInitializer.Initialize(IServiceProvider serviceProvider, CompositionHost compositionHost)

This behavior is caused by Directory.GetFiles specification (in 'Note' section)

Copy link
Contributor

@DustinCampbell DustinCampbell left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

Copy link
Member

@filipw filipw left a comment

Choose a reason for hiding this comment

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

makes sense indeed

@david-driscoll david-driscoll merged commit 4ced49b into OmniSharp:master Nov 2, 2018
itn3000 added a commit to itn3000/omnisharp-roslyn that referenced this pull request Nov 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants