@@ -189,15 +189,16 @@ public virtual string Name
189
189
public static string QualifiedNameSeparator = "::" ;
190
190
191
191
public string GetQualifiedName ( Func < Declaration , string > getName ,
192
- Func < Declaration , DeclarationContext > getNamespace )
192
+ Func < Declaration , DeclarationContext > getNamespace , bool getOriginal )
193
193
{
194
- if ( Namespace == null )
194
+ DeclarationContext @namespace = getNamespace ( this ) ;
195
+ if ( @namespace == null )
195
196
return getName ( this ) ;
196
197
197
- if ( Namespace . IsRoot )
198
+ if ( @namespace . IsRoot )
198
199
return getName ( this ) ;
199
200
200
- var namespaces = GatherNamespaces ( getNamespace ( this ) ) ;
201
+ var namespaces = GatherNamespaces ( @namespace , getOriginal ) ;
201
202
202
203
var names = namespaces . Select ( getName ) . ToList ( ) ;
203
204
names . Add ( getName ( this ) ) ;
@@ -206,7 +207,7 @@ public string GetQualifiedName(Func<Declaration, string> getName,
206
207
return string . Join ( QualifiedNameSeparator , names ) ;
207
208
}
208
209
209
- public static IEnumerable < Declaration > GatherNamespaces ( DeclarationContext @namespace )
210
+ public static IEnumerable < Declaration > GatherNamespaces ( DeclarationContext @namespace , bool getOriginal )
210
211
{
211
212
var namespaces = new Stack < Declaration > ( ) ;
212
213
@@ -216,7 +217,7 @@ public static IEnumerable<Declaration> GatherNamespaces(DeclarationContext @name
216
217
var isInlineNamespace = currentNamespace is Namespace { IsInline : true } ;
217
218
if ( ! isInlineNamespace )
218
219
namespaces . Push ( currentNamespace ) ;
219
- currentNamespace = currentNamespace . Namespace ;
220
+ currentNamespace = getOriginal ? currentNamespace . OriginalNamespace : currentNamespace . Namespace ;
220
221
}
221
222
222
223
return namespaces ;
@@ -226,7 +227,7 @@ public string QualifiedName
226
227
{
227
228
get
228
229
{
229
- return GetQualifiedName ( decl => GetDeclName ( decl , decl . Name ) , decl => decl . Namespace ) ;
230
+ return GetQualifiedName ( decl => GetDeclName ( decl , decl . Name ) , decl => decl . Namespace , false ) ;
230
231
}
231
232
}
232
233
@@ -235,7 +236,7 @@ public string QualifiedOriginalName
235
236
get
236
237
{
237
238
return GetQualifiedName (
238
- decl => GetDeclName ( decl , decl . OriginalName ) , decl => decl . OriginalNamespace ) ;
239
+ decl => GetDeclName ( decl , decl . OriginalName ) , decl => decl . OriginalNamespace , true ) ;
239
240
}
240
241
}
241
242
@@ -244,7 +245,7 @@ public string QualifiedLogicalName
244
245
get
245
246
{
246
247
return GetQualifiedName (
247
- decl => GetDeclName ( decl , decl . LogicalName ) , decl => decl . Namespace ) ;
248
+ decl => GetDeclName ( decl , decl . LogicalName ) , decl => decl . Namespace , false ) ;
248
249
}
249
250
}
250
251
@@ -253,7 +254,7 @@ public string QualifiedLogicalOriginalName
253
254
get
254
255
{
255
256
return GetQualifiedName (
256
- decl => GetDeclName ( decl , decl . LogicalOriginalName ) , decl => decl . OriginalNamespace ) ;
257
+ decl => GetDeclName ( decl , decl . LogicalOriginalName ) , decl => decl . OriginalNamespace , true ) ;
257
258
}
258
259
}
259
260
0 commit comments