Skip to content

Commit

Permalink
Intellisense now displays optional parameters. Fixes issue #15
Browse files Browse the repository at this point in the history
  • Loading branch information
Þorgeir committed Aug 9, 2016
1 parent 19ea2ab commit dce8df9
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,13 @@ public static MemberDetails GetMemberDetails(MethodInfo meth)

syntax.AddRange(RexUtils.GetCSharpRepresentation(paras[i].ParameterType));
syntax.AddRange(new[] { Syntax.Space, Syntax.ParaName(paras[i].Name) });

if (paras[i].IsOptional)
{
syntax.AddRange(new[] { Syntax.Space, Syntax.EqualsOp, Syntax.Space });
syntax.AddRange(GetSyntaxForValue(paras[i].RawDefaultValue));
}

if (i + 1 != paras.Length)
syntax.AddRange(new[] { Syntax.Comma, Syntax.Space });
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public void DefaultArgs()
var without = results[1].ToString();

Assert.AreEqual("void WithDefaultArg(int myInt = 42)", with);
Assert.AreEqual("void WithoutDefaultArg(int myInt)", with);
Assert.AreEqual("void WithoutDefaultArg(int myInt)", without);
}

private void EqualIntellisence(string search1, string search2)
Expand Down
6 changes: 6 additions & 0 deletions RexWindowProjcet/RexWindowProjcet.CSharp.Editor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@
<HintPath>Assets\AssetStoreTools\Editor\AssetStoreToolsExtra.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="RexWindowProjcet.CSharp.csproj">
<Project>{EFD6D296-BA78-FDE5-2467-38313012D23E}</Project>
<Name>RexWindowProjcet.CSharp</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile Include="Assets\Editor\RexDiagnostics\Core\Helpers\AOutputEntry.cs" />
<Compile Include="Assets\Editor\RexDiagnostics\Core\Helpers\AccessingDeletedVariableException.cs" />
Expand Down
69 changes: 69 additions & 0 deletions RexWindowProjcet/RexWindowProjcet.CSharp.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>10.0.20506</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{EFD6D296-BA78-FDE5-2467-38313012D23E}</ProjectGuid>
<OutputType>Library</OutputType>
<AssemblyName>Assembly-CSharp</AssemblyName>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{E097FAD1-6243-4DAD-9C02-E9B9EFC3FFC1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkProfile>Unity Subset v3.5</TargetFrameworkProfile>
<CompilerResponseFile></CompilerResponseFile>
<UnityProjectType>Game:1</UnityProjectType>
<UnityBuildTarget>Android:13</UnityBuildTarget>
<UnityVersion>5.4.0f3</UnityVersion>
<RootNamespace></RootNamespace>
<LangVersion Condition=" '$(VisualStudioVersion)' != '10.0' ">4</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>false</Optimize>
<OutputPath>Temp\UnityVS_bin\Debug\</OutputPath>
<IntermediateOutputPath>Temp\UnityVS_obj\Debug\</IntermediateOutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DefineConstants>DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_4_0;UNITY_5_4;UNITY_5;ENABLE_NEW_BUGREPORTER;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_EDITOR_RETINA;ENABLE_RETINA_GUISTYLES;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_SPRITE_POLYGON;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_UNET;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;INCLUDE_DIRECTX12;PLATFORM_SUPPORTS_MONO;INCLUDE_PUBNUB;ENABLE_LOCALIZATION;ENABLE_ANDROID_ATLAS_ETC1_COMPRESSION;ENABLE_EDITOR_TESTS_RUNNER;UNITY_ANDROID;UNITY_ANDROID_API;ENABLE_SUBSTANCE;UNITY_ANDROID_API;ENABLE_TEXTUREID_MAP;ENABLE_EGL;ENABLE_NETWORK;ENABLE_RUNTIME_GI;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;PLATFORM_SUPPORTS_ADS_ID;UNITY_CAN_SHOW_SPLASH_SCREEN;ENABLE_UNITYADS_RUNTIME;UNITY_UNITYADS_API;ENABLE_MONO;DEVELOPMENT_BUILD;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;UNITY_TEAM_LICENSE;ENABLE_VSTU</DefineConstants>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>false</Optimize>
<OutputPath>Temp\UnityVS_bin\Release\</OutputPath>
<IntermediateOutputPath>Temp\UnityVS_obj\Release\</IntermediateOutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DefineConstants>TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_4_0;UNITY_5_4;UNITY_5;ENABLE_NEW_BUGREPORTER;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_EDITOR_RETINA;ENABLE_RETINA_GUISTYLES;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_SPRITE_POLYGON;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_UNET;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;INCLUDE_DIRECTX12;PLATFORM_SUPPORTS_MONO;INCLUDE_PUBNUB;ENABLE_LOCALIZATION;ENABLE_ANDROID_ATLAS_ETC1_COMPRESSION;ENABLE_EDITOR_TESTS_RUNNER;UNITY_ANDROID;UNITY_ANDROID_API;ENABLE_SUBSTANCE;UNITY_ANDROID_API;ENABLE_TEXTUREID_MAP;ENABLE_EGL;ENABLE_NETWORK;ENABLE_RUNTIME_GI;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;PLATFORM_SUPPORTS_ADS_ID;UNITY_CAN_SHOW_SPLASH_SCREEN;ENABLE_UNITYADS_RUNTIME;UNITY_UNITYADS_API;ENABLE_MONO;DEVELOPMENT_BUILD;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;UNITY_TEAM_LICENSE;ENABLE_VSTU</DefineConstants>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="System" />
<Reference Include="System.XML" />
<Reference Include="System.Core" />
<Reference Include="Boo.Lang" />
<Reference Include="UnityScript.Lang" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Xml.Linq" />
<Reference Include="UnityEngine">
<HintPath>Library\UnityAssemblies\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>Library\UnityAssemblies\UnityEngine.UI.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Networking">
<HintPath>Library\UnityAssemblies\UnityEngine.Networking.dll</HintPath>
</Reference>
<Reference Include="UnityEditor">
<HintPath>Library\UnityAssemblies\UnityEditor.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Assets\Class1.cs" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\SyntaxTree\UnityVS\2015\UnityVS.CSharp.targets" />
</Project>
6 changes: 6 additions & 0 deletions RexWindowProjcet/RexWindowProjcet.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2015
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RexWindowProjcet.CSharp", "RexWindowProjcet.CSharp.csproj", "{EFD6D296-BA78-FDE5-2467-38313012D23E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RexWindowProjcet.CSharp.Editor", "RexWindowProjcet.CSharp.Editor.csproj", "{3813EA15-7ED8-0A46-2C08-8A01CC425257}"
EndProject
Global
Expand All @@ -9,6 +11,10 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{EFD6D296-BA78-FDE5-2467-38313012D23E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EFD6D296-BA78-FDE5-2467-38313012D23E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EFD6D296-BA78-FDE5-2467-38313012D23E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EFD6D296-BA78-FDE5-2467-38313012D23E}.Release|Any CPU.Build.0 = Release|Any CPU
{3813EA15-7ED8-0A46-2C08-8A01CC425257}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3813EA15-7ED8-0A46-2C08-8A01CC425257}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3813EA15-7ED8-0A46-2C08-8A01CC425257}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down

0 comments on commit dce8df9

Please sign in to comment.