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

Additional filtering of namespaces #305

Merged
merged 5 commits into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ public void CreateFile(IFileSyntax fileSyntax, IxNodeVisitor visitor)
AddToSource("using System.Collections.Generic;");
AddToSource("using AXSharp.Connector.Localizations;");

foreach (var fileSyntaxUsingDirective in fileSyntax.UsingDirectives)

foreach (var fileSyntaxUsingDirective in fileSyntax.UsingDirectives
.Where(p => this.Compilation.GetSemanticTree().Namespaces.Select(p => p.FullyQualifiedName).Contains(p.QualifiedIdentifierList.GetText())))
{
AddToSource($"using {fileSyntaxUsingDirective.QualifiedIdentifierList.GetText()};");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ public void CreateFile(IFileSyntax fileSyntax, IxNodeVisitor visitor)
{
AddToSource("using System;");

foreach (var fileSyntaxUsingDirective in fileSyntax.UsingDirectives)
foreach (var fileSyntaxUsingDirective in
fileSyntax.UsingDirectives
.Where(p => this.Compilation.GetSemanticTree().Namespaces.Select(p => p.FullyQualifiedName).Contains(p.QualifiedIdentifierList.GetText())))
{
AddToSource($"using Pocos.{fileSyntaxUsingDirective.QualifiedIdentifierList.GetText()};");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
using AXSharp.Connector.ValueTypes;
using System.Collections.Generic;
using AXSharp.Connector.Localizations;
using Simatic.Ax.Stateframework;
using Simatic.Ax.StatePattern;

namespace Simatic.Ax.StateFramework
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using Pocos.Simatic.Ax.Stateframework;
using Pocos.Simatic.Ax.StatePattern;

namespace Pocos
{
Expand Down
Loading