Skip to content

Commit 81dfaf5

Browse files
authored
96 Fixing bug introduced by previous #95 (#100)
* Create draft PR for #96 * [connector] temporarily removes localization tags from string attributes * asp --------- Co-authored-by: PTKu <[email protected]>
1 parent ab88f3b commit 81dfaf5

34 files changed

+695
-58
lines changed

src/ix.compiler/src/IX.Cs.Compiler/Onliner/CsOnlinerSourceBuilder.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,8 @@ private void CreateITwinObjectImplementation()
266266
"public string GetSymbolTail() { return this.SymbolTail; }" +
267267
$"public {typeof(ITwinObject).n()} GetParent() {{ return this.@Parent; }}" +
268268
"public string Symbol { get; protected set; }" +
269-
"public System.String AttributeName { get; set; }" +
269+
"private string _attributeName;" +
270+
"public System.String AttributeName { get {return Ix.Localizations.LocalizationHelper.CleanUpLocalizationTokens(_attributeName); } set { _attributeName = value; } }" +
270271
"public string HumanReadable { get; set; }" +
271272
"protected System.String @SymbolTail { get; set;}" +
272273
$"protected {typeof(ITwinObject).n()} @Parent {{ get; set; }}"

src/ix.compiler/src/IX.Cs.Compiler/Pragmas/PragmaParser/Ast/AddedPropertyDeclarationAstNode.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public override void AcceptVisitor(IAstVisitor visitor)
3737
$"{{ " +
3838
$"return Ix.Localizations.LocalizationHelper.CleanUpLocalizationTokens(_{Identifier}); " +
3939
$"}} " +
40-
$"set; " +
40+
$"set " +
4141
$"{{_{Identifier} = value;" +
4242
$"}} " +
4343
$"}}";

src/ix.compiler/tests/Ix.Compiler.CsTests/Cs/PragmasExtensionsTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public void should_get_attribute_source()
5858
[Fact]
5959
public void should_declare_property()
6060
{
61-
var expected = "private string _AttributeName;\npublic string AttributeName { get{ return Ix.Localizations.LocalizationHelper.CleanUpLocalizationTokens(_AttributeName); } set; {_AttributeName = value;} }";
61+
var expected = "private string _AttributeName;\npublic string AttributeName { get{ return Ix.Localizations.LocalizationHelper.CleanUpLocalizationTokens(_AttributeName); } set {_AttributeName = value;} }";
6262
var field = new TypeMock("someField",
6363
new ReadOnlyCollection<IPragma>(new IPragma[]
6464
{

src/ix.compiler/tests/Ix.Compiler.CsTests/samples/units/expected/.g/Onliners/array_declaration.g.cs

+26-2
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,19 @@ public Ix.Connector.ITwinObject GetParent()
132132

133133
public string Symbol { get; protected set; }
134134

135-
public System.String AttributeName { get; set; }
135+
private string _attributeName;
136+
public System.String AttributeName
137+
{
138+
get
139+
{
140+
return Ix.Localizations.LocalizationHelper.CleanUpLocalizationTokens(_attributeName);
141+
}
142+
143+
set
144+
{
145+
_attributeName = value;
146+
}
147+
}
136148

137149
public string HumanReadable { get; set; }
138150

@@ -244,7 +256,19 @@ public Ix.Connector.ITwinObject GetParent()
244256

245257
public string Symbol { get; protected set; }
246258

247-
public System.String AttributeName { get; set; }
259+
private string _attributeName;
260+
public System.String AttributeName
261+
{
262+
get
263+
{
264+
return Ix.Localizations.LocalizationHelper.CleanUpLocalizationTokens(_attributeName);
265+
}
266+
267+
set
268+
{
269+
_attributeName = value;
270+
}
271+
}
248272

249273
public string HumanReadable { get; set; }
250274

src/ix.compiler/tests/Ix.Compiler.CsTests/samples/units/expected/.g/Onliners/class_all_primitives.g.cs

+13-1
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,19 @@ public Ix.Connector.ITwinObject GetParent()
304304

305305
public string Symbol { get; protected set; }
306306

307-
public System.String AttributeName { get; set; }
307+
private string _attributeName;
308+
public System.String AttributeName
309+
{
310+
get
311+
{
312+
return Ix.Localizations.LocalizationHelper.CleanUpLocalizationTokens(_attributeName);
313+
}
314+
315+
set
316+
{
317+
_attributeName = value;
318+
}
319+
}
308320

309321
public string HumanReadable { get; set; }
310322

src/ix.compiler/tests/Ix.Compiler.CsTests/samples/units/expected/.g/Onliners/class_extended_by_known_type.g.cs

+13-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,19 @@ public Ix.Connector.ITwinObject GetParent()
181181

182182
public string Symbol { get; protected set; }
183183

184-
public System.String AttributeName { get; set; }
184+
private string _attributeName;
185+
public System.String AttributeName
186+
{
187+
get
188+
{
189+
return Ix.Localizations.LocalizationHelper.CleanUpLocalizationTokens(_attributeName);
190+
}
191+
192+
set
193+
{
194+
_attributeName = value;
195+
}
196+
}
185197

186198
public string HumanReadable { get; set; }
187199

src/ix.compiler/tests/Ix.Compiler.CsTests/samples/units/expected/.g/Onliners/class_extends.g.cs

+13-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,19 @@ public Ix.Connector.ITwinObject GetParent()
158158

159159
public string Symbol { get; protected set; }
160160

161-
public System.String AttributeName { get; set; }
161+
private string _attributeName;
162+
public System.String AttributeName
163+
{
164+
get
165+
{
166+
return Ix.Localizations.LocalizationHelper.CleanUpLocalizationTokens(_attributeName);
167+
}
168+
169+
set
170+
{
171+
_attributeName = value;
172+
}
173+
}
162174

163175
public string HumanReadable { get; set; }
164176

src/ix.compiler/tests/Ix.Compiler.CsTests/samples/units/expected/.g/Onliners/class_extends_and_implements.g.cs

+13-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,19 @@ public Ix.Connector.ITwinObject GetParent()
158158

159159
public string Symbol { get; protected set; }
160160

161-
public System.String AttributeName { get; set; }
161+
private string _attributeName;
162+
public System.String AttributeName
163+
{
164+
get
165+
{
166+
return Ix.Localizations.LocalizationHelper.CleanUpLocalizationTokens(_attributeName);
167+
}
168+
169+
set
170+
{
171+
_attributeName = value;
172+
}
173+
}
162174

163175
public string HumanReadable { get; set; }
164176

src/ix.compiler/tests/Ix.Compiler.CsTests/samples/units/expected/.g/Onliners/class_implements.g.cs

+13-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,19 @@ public Ix.Connector.ITwinObject GetParent()
106106

107107
public string Symbol { get; protected set; }
108108

109-
public System.String AttributeName { get; set; }
109+
private string _attributeName;
110+
public System.String AttributeName
111+
{
112+
get
113+
{
114+
return Ix.Localizations.LocalizationHelper.CleanUpLocalizationTokens(_attributeName);
115+
}
116+
117+
set
118+
{
119+
_attributeName = value;
120+
}
121+
}
110122

111123
public string HumanReadable { get; set; }
112124

src/ix.compiler/tests/Ix.Compiler.CsTests/samples/units/expected/.g/Onliners/class_implements_multiple.g.cs

+13-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,19 @@ public Ix.Connector.ITwinObject GetParent()
106106

107107
public string Symbol { get; protected set; }
108108

109-
public System.String AttributeName { get; set; }
109+
private string _attributeName;
110+
public System.String AttributeName
111+
{
112+
get
113+
{
114+
return Ix.Localizations.LocalizationHelper.CleanUpLocalizationTokens(_attributeName);
115+
}
116+
117+
set
118+
{
119+
_attributeName = value;
120+
}
121+
}
110122

111123
public string HumanReadable { get; set; }
112124

src/ix.compiler/tests/Ix.Compiler.CsTests/samples/units/expected/.g/Onliners/class_internal.g.cs

+13-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,19 @@ public Ix.Connector.ITwinObject GetParent()
106106

107107
public string Symbol { get; protected set; }
108108

109-
public System.String AttributeName { get; set; }
109+
private string _attributeName;
110+
public System.String AttributeName
111+
{
112+
get
113+
{
114+
return Ix.Localizations.LocalizationHelper.CleanUpLocalizationTokens(_attributeName);
115+
}
116+
117+
set
118+
{
119+
_attributeName = value;
120+
}
121+
}
110122

111123
public string HumanReadable { get; set; }
112124

src/ix.compiler/tests/Ix.Compiler.CsTests/samples/units/expected/.g/Onliners/class_no_access_modifier.g.cs

+13-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,19 @@ public Ix.Connector.ITwinObject GetParent()
106106

107107
public string Symbol { get; protected set; }
108108

109-
public System.String AttributeName { get; set; }
109+
private string _attributeName;
110+
public System.String AttributeName
111+
{
112+
get
113+
{
114+
return Ix.Localizations.LocalizationHelper.CleanUpLocalizationTokens(_attributeName);
115+
}
116+
117+
set
118+
{
119+
_attributeName = value;
120+
}
121+
}
110122

111123
public string HumanReadable { get; set; }
112124

src/ix.compiler/tests/Ix.Compiler.CsTests/samples/units/expected/.g/Onliners/class_with_complex_members.g.cs

+26-2
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,19 @@ public Ix.Connector.ITwinObject GetParent()
117117

118118
public string Symbol { get; protected set; }
119119

120-
public System.String AttributeName { get; set; }
120+
private string _attributeName;
121+
public System.String AttributeName
122+
{
123+
get
124+
{
125+
return Ix.Localizations.LocalizationHelper.CleanUpLocalizationTokens(_attributeName);
126+
}
127+
128+
set
129+
{
130+
_attributeName = value;
131+
}
132+
}
121133

122134
public string HumanReadable { get; set; }
123135

@@ -229,7 +241,19 @@ public Ix.Connector.ITwinObject GetParent()
229241

230242
public string Symbol { get; protected set; }
231243

232-
public System.String AttributeName { get; set; }
244+
private string _attributeName;
245+
public System.String AttributeName
246+
{
247+
get
248+
{
249+
return Ix.Localizations.LocalizationHelper.CleanUpLocalizationTokens(_attributeName);
250+
}
251+
252+
set
253+
{
254+
_attributeName = value;
255+
}
256+
}
233257

234258
public string HumanReadable { get; set; }
235259

src/ix.compiler/tests/Ix.Compiler.CsTests/samples/units/expected/.g/Onliners/class_with_non_public_members.g.cs

+26-2
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,19 @@ public Ix.Connector.ITwinObject GetParent()
117117

118118
public string Symbol { get; protected set; }
119119

120-
public System.String AttributeName { get; set; }
120+
private string _attributeName;
121+
public System.String AttributeName
122+
{
123+
get
124+
{
125+
return Ix.Localizations.LocalizationHelper.CleanUpLocalizationTokens(_attributeName);
126+
}
127+
128+
set
129+
{
130+
_attributeName = value;
131+
}
132+
}
121133

122134
public string HumanReadable { get; set; }
123135

@@ -229,7 +241,19 @@ public Ix.Connector.ITwinObject GetParent()
229241

230242
public string Symbol { get; protected set; }
231243

232-
public System.String AttributeName { get; set; }
244+
private string _attributeName;
245+
public System.String AttributeName
246+
{
247+
get
248+
{
249+
return Ix.Localizations.LocalizationHelper.CleanUpLocalizationTokens(_attributeName);
250+
}
251+
252+
set
253+
{
254+
_attributeName = value;
255+
}
256+
}
233257

234258
public string HumanReadable { get; set; }
235259

src/ix.compiler/tests/Ix.Compiler.CsTests/samples/units/expected/.g/Onliners/class_with_pragmas.g.cs

+26-2
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,19 @@ public Ix.Connector.ITwinObject GetParent()
119119

120120
public string Symbol { get; protected set; }
121121

122-
public System.String AttributeName { get; set; }
122+
private string _attributeName;
123+
public System.String AttributeName
124+
{
125+
get
126+
{
127+
return Ix.Localizations.LocalizationHelper.CleanUpLocalizationTokens(_attributeName);
128+
}
129+
130+
set
131+
{
132+
_attributeName = value;
133+
}
134+
}
123135

124136
public string HumanReadable { get; set; }
125137

@@ -231,7 +243,19 @@ public Ix.Connector.ITwinObject GetParent()
231243

232244
public string Symbol { get; protected set; }
233245

234-
public System.String AttributeName { get; set; }
246+
private string _attributeName;
247+
public System.String AttributeName
248+
{
249+
get
250+
{
251+
return Ix.Localizations.LocalizationHelper.CleanUpLocalizationTokens(_attributeName);
252+
}
253+
254+
set
255+
{
256+
_attributeName = value;
257+
}
258+
}
235259

236260
public string HumanReadable { get; set; }
237261

src/ix.compiler/tests/Ix.Compiler.CsTests/samples/units/expected/.g/Onliners/class_with_primitive_members.g.cs

+13-1
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,19 @@ public Ix.Connector.ITwinObject GetParent()
351351

352352
public string Symbol { get; protected set; }
353353

354-
public System.String AttributeName { get; set; }
354+
private string _attributeName;
355+
public System.String AttributeName
356+
{
357+
get
358+
{
359+
return Ix.Localizations.LocalizationHelper.CleanUpLocalizationTokens(_attributeName);
360+
}
361+
362+
set
363+
{
364+
_attributeName = value;
365+
}
366+
}
355367

356368
public string HumanReadable { get; set; }
357369

0 commit comments

Comments
 (0)