You've already forked com.unity.ide.cursor
mirror of
https://github.com/boxqkrtm/com.unity.ide.cursor.git
synced 2026-05-14 22:30:10 +00:00
com.unity.ide.visualstudio@2.0.1
## [2.0.1] - 2020-03-19 When Visual Studio installation is compatible with C# 8.0, setup the language version to not prompt the user with unsupported constructs. (So far Unity only supports C# 7.3). Use Unity's TypeCache to improve project generation speed. Properly check for a managed assembly before displaying a warning regarding legacy PDB usage. Add support for selective project generation (embedded, local, registry, git, builtin, player).
This commit is contained in:
@@ -80,8 +80,6 @@ namespace Microsoft.Unity.VisualStudio.Editor
|
||||
|
||||
public void OnGUI()
|
||||
{
|
||||
const string unity_generate_all = "unity_generate_all_csproj";
|
||||
|
||||
GUILayout.BeginHorizontal();
|
||||
GUILayout.FlexibleSpace();
|
||||
|
||||
@@ -96,14 +94,38 @@ namespace Microsoft.Unity.VisualStudio.Editor
|
||||
GUILayout.Label($"<size=10><color=grey>{package.displayName} v{package.version} enabled</color></size>", style);
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
var prevGenerate = EditorPrefs.GetBool(unity_generate_all, false);
|
||||
var generateAll = EditorGUILayout.Toggle("Generate all .csproj files.", prevGenerate);
|
||||
if (generateAll != prevGenerate)
|
||||
{
|
||||
EditorPrefs.SetBool(unity_generate_all, generateAll);
|
||||
}
|
||||
EditorGUILayout.LabelField("Generate .csproj files for:");
|
||||
EditorGUI.indentLevel++;
|
||||
SettingsButton(ProjectGenerationFlag.Embedded, "Embedded packages", "");
|
||||
SettingsButton(ProjectGenerationFlag.Local, "Local packages", "");
|
||||
SettingsButton(ProjectGenerationFlag.Registry, "Registry packages", "");
|
||||
SettingsButton(ProjectGenerationFlag.Git, "Git packages", "");
|
||||
SettingsButton(ProjectGenerationFlag.BuiltIn, "Built-in packages", "");
|
||||
SettingsButton(ProjectGenerationFlag.LocalTarBall, "Local tarball", "");
|
||||
SettingsButton(ProjectGenerationFlag.Unknown, "Packages from unknown sources", "");
|
||||
SettingsButton(ProjectGenerationFlag.PlayerAssemblies, "Player projects", "For each player project generate an additional csproj with the name 'project-player.csproj'");
|
||||
RegenerateProjectFiles();
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
|
||||
_generator.GenerateAll(generateAll);
|
||||
void RegenerateProjectFiles()
|
||||
{
|
||||
var rect = EditorGUI.IndentedRect(EditorGUILayout.GetControlRect(new GUILayoutOption[] {}));
|
||||
rect.width = 252;
|
||||
if (GUI.Button(rect, "Regenerate project files"))
|
||||
{
|
||||
_generator.Sync();
|
||||
}
|
||||
}
|
||||
|
||||
void SettingsButton(ProjectGenerationFlag preference, string guiMessage, string toolTip)
|
||||
{
|
||||
var prevValue = _generator.AssemblyNameProvider.ProjectGenerationFlag.HasFlag(preference);
|
||||
var newValue = EditorGUILayout.Toggle(new GUIContent(guiMessage, toolTip), prevValue);
|
||||
if (newValue != prevValue)
|
||||
{
|
||||
_generator.AssemblyNameProvider.ToggleProjectGeneration(preference);
|
||||
}
|
||||
}
|
||||
|
||||
public void SyncIfNeeded(string[] addedFiles, string[] deletedFiles, string[] movedFiles, string[] movedFromFiles, string[] importedFiles)
|
||||
@@ -113,6 +135,11 @@ namespace Microsoft.Unity.VisualStudio.Editor
|
||||
foreach (var file in importedFiles.Where(a => Path.GetExtension(a) == ".pdb"))
|
||||
{
|
||||
var pdbFile = FileUtility.GetAssetFullPath(file);
|
||||
var asmFile = Path.ChangeExtension(pdbFile, ".dll");
|
||||
|
||||
if (!File.Exists(asmFile) || !Image.IsAssembly(asmFile))
|
||||
continue;
|
||||
|
||||
if (Symbols.IsPortableSymbolFile(pdbFile))
|
||||
continue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user