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

OmniSharp can't parse Assembly-CSharp-Editor. #43

Closed
dmitry1100 opened this issue Dec 1, 2015 · 2 comments
Closed

OmniSharp can't parse Assembly-CSharp-Editor. #43

dmitry1100 opened this issue Dec 1, 2015 · 2 comments

Comments

@dmitry1100
Copy link

I tried mono and dnx from homebrew and as standalone installers from their websites. After opening solution VS Code produces the following log:

[INFO] Starting OmniSharp at '/Users/dmitry/projects/fiftytwo/OneHandGame/OneHandGame.sln'...
[INFO] Started OmniSharp from '/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/csharp-o/bin/omnisharp' with process id 77639...
[INFORMATION:OmniSharp.Startup] Omnisharp server running using stdio at location '/Users/dmitry/projects/fiftytwo/OneHandGame' on host 77282.
[INFORMATION:OmniSharp.Dnx.DnxPaths] Using runtime '/Users/dmitry/.dnx/runtimes/dnx-mono.1.0.0-rc2-16249'.
[INFORMATION:OmniSharp.Dnx.DnxProjectSystem] Scanning '/Users/dmitry/projects/fiftytwo/OneHandGame' for DNX projects
[INFORMATION:OmniSharp.Dnx.DnxProjectSystem] No project.json based projects found
[INFORMATION:OmniSharp.MSBuild.MSBuildProjectSystem] Detecting projects in '/Users/dmitry/projects/fiftytwo/OneHandGame/OneHandGame.sln'.
[INFORMATION:OmniSharp.MSBuild.MSBuildProjectSystem] Loading project from '/Users/dmitry/projects/fiftytwo/OneHandGame/Assembly-CSharp-firstpass.csproj'.
[INFORMATION:OmniSharp.MSBuild.MSBuildProjectSystem] Loading project from '/Users/dmitry/projects/fiftytwo/OneHandGame/Assembly-CSharp.csproj'.
[INFORMATION:OmniSharp.MSBuild.MSBuildProjectSystem] Loading project from '/Users/dmitry/projects/fiftytwo/OneHandGame/Assembly-CSharp-Editor-firstpass.csproj'.
[INFORMATION:OmniSharp.MSBuild.MSBuildProjectSystem] Loading project from '/Users/dmitry/projects/fiftytwo/OneHandGame/Assembly-CSharp-Editor.csproj'.
[ERROR:OmniSharp.MSBuild.MSBuildProjectSystem] Unexpected symbol `1E-05', expecting `.' or `['
[ERROR:OmniSharp.MSBuild.MSBuildProjectSystem] Unexpected symbol `1E-05', expecting `.' or `['
[ERROR:OmniSharp.MSBuild.MSBuildProjectSystem] Unexpected symbol `1E-05', expecting `.' or `['
[ERROR:OmniSharp.MSBuild.MSBuildProjectSystem] Unexpected symbol `1E-05', expecting `.' or `['
[WARNING:OmniSharp.MSBuild.MSBuildProjectSystem] Failed to process project file '/Users/dmitry/projects/fiftytwo/OneHandGame/Assembly-CSharp-Editor.csproj'.
/Users/dmitry/projects/fiftytwo/OneHandGame/Assembly-CSharp-Editor.csproj

[INFORMATION:OmniSharp.ScriptCs.ScriptCsProjectSystem] Detecting CSX files in '/Users/dmitry/projects/fiftytwo/OneHandGame'.
[INFORMATION:OmniSharp.ScriptCs.ScriptCsProjectSystem] Could not find any CSX files
[INFORMATION:OmniSharp.Startup] Solution has finished loading

So, it can't load Assembly-CSharp-Editor.csproj, but it seems other projects loaded fine. Have you some ideas about it, what can be wrong? OmniSharp does not write a place of the unexpected symbol, so I have no idea where it is located. I tried to find 1E-05 in the file, but it does not present there. Maybe it is some code of character, I don't know...

PS: I created new test project that doesn't have the issue. So, it's project specific and appeared in large game project.

@dmitry1100
Copy link
Author

I localised problem in Assembly-CSharp-Editor.csproj.
I started to comment some blocks and try to reparse solution, so I found that it works well if I comment following reference:

<ProjectReference Include="Assembly-CSharp.csproj">
      <Project>{8381B963-6524-C8D5-5241-27F33A508CE0}</Project>      <Name>Assembly-CSharp</Name>    </ProjectReference>

@dmitry1100
Copy link
Author

Finally I've fixed an issue =) The problem was in on of file from unity asset Particle Playground https://www.assetstore.unity3d.com/en/#!/content/13325

For guys who will meet the same problem.
To fix, it is needed to find function UpdateShuriken() in file PlaygroundParticlesC.cs
This function contains following code:

float mslt = minShurikenLifetime<.00001f?.00001f:minShurikenLifetime;

1E-05 is related to .00001f and OmniSharp was unable to parse this string coded in terrible style.
So, change it to

float mslt = minShurikenLifetime < 0.00001f ? 0.00001f : minShurikenLifetime;

And reparse project, intelli sense should work now.

PS: The only annoying thing - VS Code doesn't go to definition of system symbol (for example some class of UnityEngine or inside System namespace), but it goes to classes and their methods inside scripts of project.

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

No branches or pull requests

1 participant