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

Dev macro manager #268

Merged
merged 9 commits into from
Jul 18, 2024
Merged

Conversation

SergeyNefyodov
Copy link
Contributor

@SergeyNefyodov SergeyNefyodov commented Jul 14, 2024

Summary of the Pull Request

I added support to MacroManager class (and also we can see MacroModule and Macro)

Description:

Quality Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

…-manager

# Conflicts:
#	source/RevitLookup/Core/ComponentModel/DescriptorMap.cs
#	source/RevitLookup/Core/ComponentModel/Descriptors/DocumentDescriptor.cs
Copy link

github-actions bot commented Jul 14, 2024

Qodana for .NET

2 new problems were found

Inspection name Severity Problems
Redundant using directive 🔶 Warning 2

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Detected 203 dependencies

Third-party software list

This page lists the third-party software dependencies used in RevitLookup

Dependency Version Licenses
Azure.Core 1.36.0 MIT
Azure.Identity 1.10.4 MIT
Azure.Security.KeyVault.Certificates 4.5.1 MIT
Azure.Security.KeyVault.Keys 4.5.0 MIT
Azure.Security.KeyVault.Secrets 4.5.0 MIT
BenchmarkDotNet.Annotations 0.13.12 MIT
BenchmarkDotNet 0.13.12 MIT
Bogus 34.0.2 MIT
CommandLineParser 2.9.1 MIT
CommunityToolkit.Mvvm 8.2.2 MIT
Gee.External.Capstone 2.3.0 MIT
Glob 1.1.9 MIT
Iced 1.17.0 MIT
JetBrains.Annotations 2023.3.0 MIT
Microsoft.ApplicationInsights 2.21.0 MIT
Microsoft.Bcl.AsyncInterfaces 1.1.0 MIT
Microsoft.Bcl.AsyncInterfaces 1.1.1 MIT
Microsoft.Bcl.AsyncInterfaces 8.0.0 MIT
Microsoft.Build.Framework 17.8.3 MIT
Microsoft.Build.Locator 1.6.10 MIT
Microsoft.Build.Tasks.Core 17.8.3 MIT
Microsoft.Build.Utilities.Core 17.8.3 MIT
Microsoft.Build 17.8.3 MIT
Microsoft.CodeAnalysis.Analyzers 3.3.3 MIT
Microsoft.CodeAnalysis.CSharp 4.1.0 MIT
Microsoft.CodeAnalysis.Common 4.1.0 MIT
Microsoft.Diagnostics.NETCore.Client 0.2.251802 MIT
Microsoft.Diagnostics.Runtime 2.2.332302 MS-NET-LIBRARY
Microsoft.Diagnostics.Tracing.TraceEvent 3.0.2 MIT
Microsoft.DotNet.PlatformAbstractions 3.1.6 MIT
Microsoft.Extensions.Configuration.Abstractions 2.1.1 Apache-2.0
Microsoft.Extensions.Configuration.Abstractions 8.0.0 MIT
Microsoft.Extensions.Configuration.Binder 2.1.1 Apache-2.0
Microsoft.Extensions.Configuration.Binder 8.0.0 MIT
Microsoft.Extensions.Configuration.CommandLine 8.0.0 MIT
Microsoft.Extensions.Configuration.EnvironmentVariables 8.0.0 MIT
Microsoft.Extensions.Configuration.FileExtensions 8.0.0 MIT
Microsoft.Extensions.Configuration.Json 8.0.0 MIT
Microsoft.Extensions.Configuration.UserSecrets 8.0.0 MIT
Microsoft.Extensions.Configuration 2.1.1 Apache-2.0
Microsoft.Extensions.Configuration 8.0.0 MIT
Microsoft.Extensions.DependencyInjection.Abstractions 2.1.1 Apache-2.0
Microsoft.Extensions.DependencyInjection.Abstractions 8.0.0 MIT
Microsoft.Extensions.DependencyInjection 8.0.0 MIT
Microsoft.Extensions.DependencyModel 8.0.0 MIT
Microsoft.Extensions.Diagnostics.Abstractions 8.0.0 MIT
Microsoft.Extensions.Diagnostics 8.0.0 MIT
Microsoft.Extensions.FileProviders.Abstractions 8.0.0 MIT
Microsoft.Extensions.FileProviders.Physical 8.0.0 MIT
Microsoft.Extensions.FileSystemGlobbing 8.0.0 MIT
Microsoft.Extensions.Hosting.Abstractions 8.0.0 MIT
Microsoft.Extensions.Hosting 8.0.0 MIT
Microsoft.Extensions.Logging.Abstractions 2.1.1 Apache-2.0
Microsoft.Extensions.Logging.Abstractions 8.0.0 MIT
Microsoft.Extensions.Logging.Configuration 8.0.0 MIT
Microsoft.Extensions.Logging.Console 8.0.0 MIT
Microsoft.Extensions.Logging.Debug 8.0.0 MIT
Microsoft.Extensions.Logging.EventLog 8.0.0 MIT
Microsoft.Extensions.Logging.EventSource 8.0.0 MIT
Microsoft.Extensions.Logging 2.1.1 Apache-2.0
Microsoft.Extensions.Logging 8.0.0 MIT
Microsoft.Extensions.Options.ConfigurationExtensions 8.0.0 MIT
Microsoft.Extensions.Options 2.1.1 Apache-2.0
Microsoft.Extensions.Options 8.0.0 MIT
Microsoft.Extensions.Primitives 2.1.1 Apache-2.0
Microsoft.Extensions.Primitives 8.0.0 MIT
Microsoft.Identity.Client.Extensions.Msal 4.56.0 MIT
Microsoft.Identity.Client 4.56.0 MIT
Microsoft.IdentityModel.Abstractions 6.22.0 MIT
Microsoft.NET.StringTools 17.8.3 MIT
Microsoft.NETCore.Platforms 5.0.0 MIT
Microsoft.NETCore.Targets 1.1.0 MS-NET-LIBRARY-2019-06
Microsoft.Win32.Registry 5.0.0 MIT
Microsoft.Win32.SystemEvents 7.0.0 MIT
Newtonsoft.Json 13.0.3 MIT
Nice3point.Revit.Api.AdWindows 2021.1.50 MIT
Nice3point.Revit.Api.RevitAPI 2021.1.50 MIT
Nice3point.Revit.Api.RevitAPIMacros 2021.1.50 MIT
Nice3point.Revit.Api.RevitAPIUI 2021.1.50 MIT
Nice3point.Revit.Api.UIFramework 2021.1.50 MIT
Nice3point.Revit.Api.UIFrameworkServices 2021.1.50 MIT
Nice3point.Revit.Build.Tasks 2.0 MIT
Nice3point.Revit.Extensions 2021.3.0 MIT
Nice3point.Revit.Toolkit 2021.2.1 MIT
NuGet.Common 6.7.0 Apache-2.0
NuGet.Configuration 6.7.0 Apache-2.0
NuGet.Frameworks 6.7.0 Apache-2.0
NuGet.Packaging 6.7.0 Apache-2.0
NuGet.Versioning 6.7.0 Apache-2.0
Nuke.Build.Shared 8.0.0 MIT
Nuke.Build 8.0.0 MIT
Nuke.Common 8.0.0 MIT
Nuke.ProjectModel 8.0.0 MIT
Nuke.SolutionModel 8.0.0 MIT
Nuke.Tooling 8.0.0 MIT
Nuke.Utilities.IO.Compression 8.0.0 MIT
Nuke.Utilities.IO.Globbing 8.0.0 MIT
Nuke.Utilities.Net 8.0.0 MIT
Nuke.Utilities.Text.Json 8.0.0 MIT
Nuke.Utilities.Text.Yaml 8.0.0 MIT
Nuke.Utilities 8.0.0 MIT
Octokit 9.0.0 MIT
Perfolizer 0.2.1 MIT
Serilog.Extensions.Hosting 8.0.0 Apache-2.0
Serilog.Extensions.Logging 8.0.0 Apache-2.0
Serilog.Formatting.Compact.Reader 3.0.0 Apache-2.0
Serilog.Formatting.Compact 2.0.0 Apache-2.0
Serilog.Sinks.Autodesk.Revit 2.0.1 MIT
Serilog.Sinks.Console 5.0.0 Apache-2.0
Serilog.Sinks.Console 6.0.0 Apache-2.0
Serilog.Sinks.Debug 3.0.0 Apache-2.0
Serilog.Sinks.File 5.0.0 Apache-2.0
Serilog 3.1.1 Apache-2.0
Serilog 4.0.0 Apache-2.0
SharpZipLib 1.4.2 MIT
System.Buffers 4.5.1 MIT
System.CodeDom 7.0.0 MIT
System.Collections.Concurrent 4.3.0 MS-NET-LIBRARY-2019-06
System.Collections.Immutable 5.0.0 MIT
System.Collections.Immutable 7.0.0 MIT
System.Collections 4.3.0 MS-NET-LIBRARY-2019-06
System.ComponentModel.Annotations 5.0.0 MIT
System.Configuration.ConfigurationManager 7.0.0 MIT
System.Diagnostics.Debug 4.3.0 MS-NET-LIBRARY-2019-06
System.Diagnostics.DiagnosticSource 6.0.1 MIT
System.Diagnostics.DiagnosticSource 8.0.1 MIT
System.Diagnostics.EventLog 7.0.0 MIT
System.Diagnostics.Tracing 4.3.0 MS-NET-LIBRARY-2019-06
System.Drawing.Common 7.0.0 MIT
System.Formats.Asn1 7.0.0 MIT
System.Globalization.Calendars 4.3.0 MS-NET-LIBRARY-2019-06
System.Globalization.Extensions 4.3.0 MS-NET-LIBRARY-2019-06
System.Globalization 4.3.0 MS-NET-LIBRARY-2019-06
System.IO.FileSystem.AccessControl 5.0.0 MIT
System.IO.FileSystem.Primitives 4.3.0 MS-NET-LIBRARY-2019-06
System.IO.FileSystem 4.3.0 MS-NET-LIBRARY-2019-06
System.IO 4.3.0 MS-NET-LIBRARY-2019-06
System.Linq 4.3.0 MS-NET-LIBRARY-2019-06
System.Management 5.0.0 MIT
System.Memory.Data 1.0.2 MIT
System.Memory 4.5.4 MIT
System.Memory 4.5.5 MIT
System.Net.Http 4.3.4 MS-NET-LIBRARY-2019-06
System.Net.Primitives 4.3.0 MS-NET-LIBRARY-2019-06
System.Numerics.Vectors 4.5.0 MIT
System.Reflection.Emit.Lightweight 4.7.0 MIT
System.Reflection.Emit 4.7.0 MIT
System.Reflection.Metadata 5.0.0 MIT
System.Reflection.Metadata 7.0.0 MIT
System.Reflection.MetadataLoadContext 7.0.0 MIT
System.Reflection.Primitives 4.3.0 MS-NET-LIBRARY-2019-06
System.Reflection 4.3.0 MS-NET-LIBRARY-2019-06
System.Resources.Extensions 7.0.0 MIT
System.Resources.ResourceManager 4.3.0 MS-NET-LIBRARY-2019-06
System.Runtime.CompilerServices.Unsafe 5.0.0 MIT
System.Runtime.CompilerServices.Unsafe 6.0.0 MIT
System.Runtime.Extensions 4.3.0 MS-NET-LIBRARY-2019-06
System.Runtime.Handles 4.3.0 MS-NET-LIBRARY-2019-06
System.Runtime.InteropServices.RuntimeInformation 4.0.0 MS-NET-LIBRARY-2019-06
System.Runtime.InteropServices 4.3.0 MS-NET-LIBRARY-2019-06
System.Runtime.Numerics 4.3.0 MS-NET-LIBRARY-2019-06
System.Runtime 4.3.0 MS-NET-LIBRARY-2019-06
System.Security.AccessControl 5.0.0 MIT
System.Security.Cryptography.Algorithms 4.3.0 MS-NET-LIBRARY-2019-06
System.Security.Cryptography.Cng 4.3.0 MS-NET-LIBRARY-2019-06
System.Security.Cryptography.Csp 4.3.0 MS-NET-LIBRARY-2019-06
System.Security.Cryptography.Encoding 4.3.0 MS-NET-LIBRARY-2019-06
System.Security.Cryptography.OpenSsl 4.3.0 MS-NET-LIBRARY-2019-06
System.Security.Cryptography.Pkcs 7.0.2 MIT
System.Security.Cryptography.Primitives 4.3.0 MS-NET-LIBRARY-2019-06
System.Security.Cryptography.ProtectedData 7.0.0 MIT
System.Security.Cryptography.X509Certificates 4.3.0 MS-NET-LIBRARY-2019-06
System.Security.Cryptography.Xml 7.0.1 MIT
System.Security.Permissions 7.0.0 MIT
System.Security.Principal.Windows 5.0.0 MIT
System.Text.Encoding.CodePages 4.5.1 MIT
System.Text.Encoding 4.3.0 MS-NET-LIBRARY-2019-06
System.Text.Encodings.Web 8.0.0 MIT
System.Text.Json 8.0.0 MIT
System.Threading.Channels 8.0.0 MIT
System.Threading.Tasks.Dataflow 7.0.0 MIT
System.Threading.Tasks.Extensions 4.5.4 MIT
System.Threading.Tasks 4.3.0 MS-NET-LIBRARY-2019-06
System.Threading 4.3.0 MS-NET-LIBRARY-2019-06
System.ValueTuple 4.5.0 MIT
System.Windows.Extensions 7.0.0 MIT
WixSharp.bin 1.25.3 MIT
YamlDotNet 13.7.1 MIT
runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2 MS-NET-LIBRARY-2019-06
runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2 MS-NET-LIBRARY-2019-06
runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2 MS-NET-LIBRARY-2019-06
runtime.native.System.Net.Http 4.3.0 MS-NET-LIBRARY-2019-06
runtime.native.System.Security.Cryptography.Apple 4.3.0 MS-NET-LIBRARY-2019-06
runtime.native.System.Security.Cryptography.OpenSsl 4.3.2 MS-NET-LIBRARY-2019-06
runtime.native.System 4.3.0 MS-NET-LIBRARY-2019-06
runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2 MS-NET-LIBRARY-2019-06
runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2 MS-NET-LIBRARY-2019-06
runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple 4.3.0 MS-NET-LIBRARY-2019-06
runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2 MS-NET-LIBRARY-2019-06
runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2 MS-NET-LIBRARY-2019-06
runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2 MS-NET-LIBRARY-2019-06
runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2 MS-NET-LIBRARY-2019-06
runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2 MS-NET-LIBRARY-2019-06
Contact Qodana team

Contact us at qodana-support@jetbrains.com

…-manager

# Conflicts:
#	source/RevitLookup/Core/ComponentModel/Descriptors/ApplicationDescriptor.cs
#	source/RevitLookup/Core/ComponentModel/Descriptors/EnumerableDescriptor.cs
}

public void RegisterExtensions(IExtensionManager manager)
{
manager.Register("GetFormulaFunctions", _ => FormulaManager.GetFunctions());
manager.Register("GetFormulaOperators", _ => FormulaManager.GetOperators());
manager.Register(nameof(MacroManager.GetMacroManager), _ => Variants.Single(MacroManager.GetMacroManager(_application)));
Copy link
Collaborator

Choose a reason for hiding this comment

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

u can remove Variants.Single for extensions

nameof(MacroManager.GetDocumentMacroSecurityOptions) => ResolveDocumentMacroSecurityOptions,
#endif
nameof(MacroManager.GetApplicationMacroSecurityOptions) => ResolveApplicationMacroSecurityOptions,
nameof(IEnumerable.GetEnumerator) => ResolveGetEnumerator,
Copy link
Collaborator

Choose a reason for hiding this comment

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

GetEnumerator should be automatically resolved, what problem does using it in a Resolve method solve?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had some problems with it but resolved it. We really don't need this, I removed

@@ -36,6 +37,7 @@ public EnumerableDescriptor(IEnumerable value)
IsEmpty = value switch
{
string => true,
MacroManager enumerable => enumerable.Count == 0,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Move it to the very bottom. In the top position you should insert frequently used types to increase the efficiency of resolving switching cases

@Nice3point Nice3point merged commit fe1ce3e into jeremytammik:dev Jul 18, 2024
2 checks passed
@SergeyNefyodov SergeyNefyodov deleted the dev-macro-manager branch July 20, 2024 10:19
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.

2 participants