dotbunny / vscode Goto Github PK
View Code? Open in Web Editor NEWUnity Visual Studio Code Integration
License: MIT License
Unity Visual Studio Code Integration
License: MIT License
I followed all the instructions(https://code.visualstudio.com/Docs/runtimes/unity), but IntelliSense still does not work
(log shows that it does)
VSCode can't seem to find any of the Unity references. When opening VSCode I get the warning message "Some projects have trouble loading. Please review the output for more details."
In the output:
[WARNING:OmniSharp.MSBuild.MSBuildProjectSystem] The primary reference "System.Core",
which is a framework assembly, could not be resolved in the currently targeted framework.
".NETFramework,Version=v2.0". To resolve this problem, either remove the reference
"System.Core" or retarget your application to a framework version which contains
"System.Core".
[WARNING:OmniSharp.MSBuild.MSBuildProjectSystem] The primary reference "UnityEngine" could
not be resolved because it has an indirect dependency on the framework assembly
"System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which
could not be resolved in the currently targeted framework. ".NETFramework,Version=v2.0".
To resolve this problem, either remove the reference "UnityEngine" or retarget your
application to a framework version which contains "System.Core, Version=3.5.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089".
...
...
There's red squiggly underlines everywhere saying things like UnityEngine not found
System: Windows 7 Pro
Unity version: 5.3.1f1
Unity VSCode plugin version: 2.20-RELEASE
VSCode version: 0.10.6
Just created a new C# class in Unity through the editor. VSCode hasn't picked it up yet. I've tried restarting both applications, enabling and disabling integration, force syncing the project, opening the project through the VSCode menu... no luck.
The class is quite simple - just a MonoBehavior that uses the UnityEngine and has a bunch of tweakables in it.
using UnityEngine;
public class HUDConfig : MonoBehaviour {
[Header("HUD Configuration")]
public Vector3 pulseTargetScale = Vector3.one;
public float pulseScaleTime = 1.0f;
public iTween.EaseType pulseScaleEaseType = iTween.EaseType.easeInSine;
public float pulseInterDelayMax = 1.25f;
public float pulseInterDelayMin = 0.4f;
public Vector3 pulseShakeMax = Vector3.one;
public Vector3 pulseShakeMin = Vector3.zero;
public GameObject streakContainerPrefab = null;
public int fastestPulseAtStreak = 75;
}
Hello,
This is not an issue but I was wondering if there is a way for the syntax highlighting to color class names specifically?
Thanks!
Looks like OmniSharp can't start, so many features aren't working? My log:
[INFO] Starting OmniSharp at '/Users/mathe015/Repositories/MatchThreeMoji/MatchThreeMoji-csharp.sln'...
[INFO] Started OmniSharp from '/Applications/Visual Studio Code.app/Contents/Resources/app/plugins/vs.language.csharp.o/bin/omnisharp' with process id 77938...
Can't find custom attr constructor image: /Applications/Visual Studio Code.app/Contents/Resources/app/plugins/vs.language.csharp.o/bin/approot/packages/Microsoft.AspNet.Cryptography.Internal/1.0.0-beta4/lib/dnx451/Microsoft.AspNet.Cryptography.Internal.dll mtoken: 0x0a000004
* Assertion at class.c:5695, condition `!mono_loader_get_last_error ()' not met
Stacktrace:
at <unknown> <0xffffffff>
at Microsoft.Framework.DependencyInjection.DataProtectionServices/<GetDefaultServices>d__0.MoveNext () <0x0021b>
at Microsoft.Framework.DependencyInjection.ServiceCollectionExtensions.TryAdd (Microsoft.Framework.DependencyInjection.IServiceCollection,System.Collections.Generic.IEnumerable`1<Microsoft.Framework.DependencyInjection.ServiceDescriptor>) <0x00064>
at Microsoft.Framework.DependencyInjection.DataProtectionServiceCollectionExtensions.AddDataProtection (Microsoft.Framework.DependencyInjection.IServiceCollection) <0x0002b>
at Microsoft.Framework.DependencyInjection.MvcServiceCollectionExtensions.ConfigureDefaultServices (Microsoft.Framework.DependencyInjection.IServiceCollection) <0x0001b>
at Microsoft.Framework.DependencyInjection.MvcServiceCollectionExtensions.AddMvc (Microsoft.Framework.DependencyInjection.IServiceCollection) <0x00013>
at OmniSharp.Startup.ConfigureServices (Microsoft.Framework.DependencyInjection.IServiceCollection) <0x0003f>
at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object (object,intptr,intptr,intptr) <0xffffffff>
at <unknown> <0xffffffff>
at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) <0xffffffff>
* Assertion at class.c:5695, condition `!mono_loader_get_last_error ()' not met
When opened any script cmd window doesn't close.
I fix it by add this string
proc.StartInfo.CreateNoWindow = true;
after this code start on line 297
#elif UNITY_EDITOR_WIN
proc.StartInfo.FileName = "code";
proc.StartInfo.Arguments = args;
proc.StartInfo.UseShellExecute = false;
Is it possible to enable the Unity syntax highlighting and the preprocessor directives?
Should add this as a feature where you dont always have to write out the launch.json ... so people can have multiple configs if they for some reason do :D
I have installed the files, moved the "Plugins" folder with all its content into my unity project but can't find VSCode in the preferences. I really want VSCode to work with unity! Please help me!
I understand that this might not happen on OSX (for obvious reason), but on Windows, with Visual Studio 2013/2010 installed. Every time I click on the menu entry, it opens Visual Studio 2013 and VSCode. Previously when MonoDevelop is installed, it would start MonoDevelop. Is this supposed to be this way (VSCode require one of these IDE to also open)? I already install Unity without MonoDevelop and uninstall the Microsoft Visual Studio Tools for Unity. I also tried resetting the preference, but it appears that Unity automatically detect if Visual Studio is installed on the system.
Piggy back on the Open C# Project menu item, allowing for the removal of the VSCode menu entirely.
[ERROR] Error: Cannot start Omnisharp because Mono version >=4.0.1 is required. See http://go.microsoft.com/fwlink/?linkID=534832#_20001
The latest mono version is installed /Library/Frameworks/.
[WARNING:OmniSharp.MSBuild.MSBuildProjectSystem] Failed to process project file '/Users/xyz/project/Assembly-CSharp-Editor-vs.csproj'.
/Users/xyz/project/Assembly-CSharp-Editor-vs.csproj
thought it might be project specific but now see it twice on 2 computers on different unity versions (4.6 vs 5.3), and 2 totally different projects from totally different companies.
What gives? How do i debug? there's no other issues related to that csproj listed in the output.
On updating from version 2.2 to 2.3 when starting unity (not automatic update) VSCode.cs has '???' a the start of the file before the comment. The three question marks don't appear to be in the plugin repo.
When using the Debugger for Unity and installing this script from the unity asset store then the launcher config:
{
"version":"0.1.0",
"configurations":[
{
"name":"Unity Editor",
"type": "unity",
"request": "launch",
}
]
}
get replaced with
{
"version":"0.2.0",
"configurations":[
{
"name":"Unity",
"type":"mono",
"request":"attach",
"address":"localhost",
"port":6068
}
]
}
which means debugging unity doesn't work with Windows.
The work around is to manually overwrite the launch config back to the Debugger for Unity launch config.
Hi.
the flame icon is not showing up at all. OmniSharp features are not working. I read everything I could find.
My Setup:
Regarding VSCode.cs file:
Any idea?
I've got a lot of Asset Store assets stored under my project's "Standard Assets" directory. (to speed up compiles)
When VSCode fires up OmniSharp I get a pile of errors like the following because evidently OmniSharp isn't looking inside the "Standard Assets" directory for code:
[ERROR:OmniSharp.MSBuild.MSBuildProjectSystem] The type or namespace name `TextMeshPro' could not be found. Are you missing an assembly reference?
Assuming this is a bug, but please forgive if not. Any ideas how to fix?
Have the ability to revert to previous settings when leaving the editor, so that the overrides do not persist between projects.
An odd request, but I see purpose in this.
The latest vs code update has broken debugging, but modifying line 815 of the vscode.cs file seems to fix it:
string fileContent = "{\n\t\"version\":\"0.2.0\",\n\t\"configurations\":[ \n\t\t{\n\t\t\t\"name\":\"Unity\",\n\t\t\t\"type\":\"mono\",\n\t\t\t\"request\":\"attach\",\n\t\t\t\"address\":\"localhost\",\n\t\t\t\"port\":" + port + "\n\t\t}\n\t]\n}";
Basically, the version number is updated and request:attach is added.
PS, extensions functionality is now available in vs code.
I did everything like indicated in MS site, I'm on 0.10.3, Unity 5.3.0 and your latest package. I'm also using Unity's debugger package, I get the exception when I open a file or the C# project.
I've been trying to get this plugin working with Unity 5.2 so that I can use Code properly with intellisense and the other features that are specific to code. I have tried redownloading the plugin, using the unity store version and the github version and it never shows up in the unity preferences window. This is my folder structure:
Edit: I am running version 5.2.3f of Unity, the latest version of mono and 0.10 of Code
Just a heads up that line #933 is missing an escape character:
"\t\t\"**/.gitattributes":true,\n" +
vs
"\t\t\"**/.gitattributes\":true,\n" +
Tried various settings in the launch.json files. Can't get it do attach or hit any breakpoints.
Right now opening an asset directly from Unity does not force open the project first, I think I might want to change this behaviour.
To ease install, it should be possible to install the addon though an asset package.
It's easy enough to create and then can be either hosted as a download / release on the GitHub page or uploaded to the asset store.
Help me please, I think it has to do with CRX files and android extension namespace or omnisharpor something.
[WARNING:OmniSharp.MSBuild.MSBuildProjectSystem] The primary reference "UnityEditor.Android.Extensions" could not be resolved because it has an indirect dependency on the framework assembly "System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v2.0". To resolve this problem, either remove the reference "UnityEditor.Android.Extensions" or retarget your application to a framework version which contains "System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089".
I think the asset store only lets you download assets when you use unity versions that are equal or higher than the one you submitted the asset to the store with.
Since the asset was submitted using 5.2, anyone with a lower version can't download it.
I would be great if you can resubmit the asset with unity 4.6, so anyone with a version higher than that can get the asset from the store.
Thanks!
UnityVS and some other extensions have a top level menu option to highlight the functionality.
Instead of the current location:
Assets -> VSCode -> options
It should just be
VSCode -> options
makes it cleaner and a lot easier to find for new users
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.
I tried changing default Unity profile in "configurations" (by adding "request":"attach" line), adding custom profile, but every time I run project in Editor, launch.json resets to its default state.
Unity3D version: 5.2.1f1
OS: MacOS Yosemite 10.10.5.
VS Code version: 0.10.1 (issue was there before).
The code that is available on the Unity Asset Store was last updated in October. There's several things that can are fixed since then such as #57
the title say it all
This is more of a reminder to create the required features for linux support, which should have mono debugging! yay!
OmniSharp has a few errors when opening my project, including:
[ERROR:OmniSharp.Dnx.DnxPaths] The specified runtime path 'default' does not exist. Searched locations /Users/david/.dnx/runtimes/dnx-mono.default
/Users/david/.dnx/runtimes/kre-mono.default
/Users/david/.dnx/packages/KRE-Mono.default
/Users/david/.k/runtimes/dnx-mono.default
/Users/david/.k/runtimes/kre-mono.default
/Users/david/.k/packages/KRE-Mono.default
/Users/david/.kre/runtimes/dnx-mono.default
/Users/david/.kre/runtimes/kre-mono.default
/Users/david/.kre/packages/KRE-Mono.default.
Sometimes old data lingering around is causing issues, so we should clear out any old project files when enabling and force a fresh sync.
After testing VSCode 0.7.x on Windows, I've found that my VSCode doesn't like the idea of debugging "mono".
Reached out to the VS Code team for some direction.
Have a toggle option to automatically poll GitHub for the latest version and automatically update if need be.
The script should also automatically move itself into /Plugins/Editor/
Just upgraded to 0.9.0 and now when I have Enable Integration selected there is no intellisense and OmniSharp says "select project". What's up?
Hi! I'm getting a lot of ...
"[ERROR:OmniSharp.MSBuild.MSBuildProjectSystem] The type or namespace name `SomeClass' could not be found. Are you missing an assembly reference?"
Did I do something stupid or are the project files not properly set up for VSCode?
Edit: These are third party assemblies btw.
It seems at times the editor set by preference to open a project isn't being respected (shown in preferences) ... takes a few times of settigns before it does?
This could resolve the open with c# project if i fix that
Bring the help file to current version (particularly the art work and definitions)
OmniSharp has errors open my project. I think it has something to do with a plugin using unsafe DLL code:
[ERROR:OmniSharp.MSBuild.MSBuildProjectSystem] Unsafe code requires the `unsafe' command line option to be specified
Any ideas on how to fix this in VSCode?
I had debugging working until one day unity just started freezing up / beachballing immediately after debug attach (with no breakpoints being hit). Has anyone else run into this issue?
There are patches in the works from Unity to fix the annoying MD popping despite the settings.
Once those are out in the wild, I will get rid of this option.
When debugging in VSCode while attached to Unity, attempting to invoke an overloaded method on an instance of a derived class will instead invoke the method on the parent class. During normal execution the correct method gets called.
Note that this only occurs if the scoped instance is referenced by the parent type, rather than by the derived type.
public class Foo
{
public virtual string getString() { return "foo"; }
}
public class Bar : Foo
{
override public string getString() { return "bar"; }
}
public class Example
{
Bar bar1 = new Bar();
Foo bar2 = new Bar();
}
While debugging:
bar1.getString()
"bar"
bar2.getString()
"foo"
((Bar)bar2).getString()
"bar"
This may not be the fault of the plugin! However, it seems likely, as a similar fix had to be made to the now-obsolete UnityVS library: http://unityvs.com/documentation/changelog/
If you open a file in a folder that is symbolically linked it will open in the file's original location as opposed to the linked directory.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.