Skip to content

Commit 7b76ed2

Browse files
committed
fix: CatglobeResXFileCodeGenerator007 was reported for the mainfile instead of the sub file so reference when building client project was broken
1 parent a150907 commit 7b76ed2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Catglobe.ResXFileCodeGenerator/StringBuilderGenerator.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,10 @@ bool ReadSingleResxFile(ResxFile lang, out Dictionary<string, (string, IXmlLineI
258258
{
259259
if (fallback is not null && !fallback.ContainsKey(entry.key))
260260
errorsAndWarnings.Add(Diagnostic.Create(s_spuriousKey,
261-
GetMemberLocation(options, entry.line, entry.key), entry.key));
261+
GetMemberLocation(lang, entry.line, entry.key), entry.key));
262262
else if (dictionary.ContainsKey(entry.key))
263263
errorsAndWarnings.Add(Diagnostic.Create(s_duplicateWarning,
264-
GetMemberLocation(options, entry.line, entry.key), entry.key));
264+
GetMemberLocation(lang, entry.line, entry.key), entry.key));
265265
else
266266
dictionary.Add(entry.key, (entry.value, entry.line));
267267
}
@@ -295,9 +295,9 @@ bool ReadSingleResxFile(ResxFile lang, out Dictionary<string, (string, IXmlLineI
295295
}
296296
}
297297

298-
private static Location GetMemberLocation(FileOptions fileOptions, IXmlLineInfo line, string memberName) =>
298+
private static Location GetMemberLocation(ResxFile fileOptions, IXmlLineInfo line, string memberName) =>
299299
Location.Create(
300-
filePath: fileOptions.GroupedFile.MainFile.File.Path,
300+
filePath: fileOptions.File.Path,
301301
textSpan: new(),
302302
lineSpan: new(
303303
start: new(line.LineNumber - 1, line.LinePosition - 1),
@@ -335,7 +335,7 @@ out bool resourceAccessByName
335335
{
336336
errorsAndWarnings.Add(Diagnostic.Create(
337337
descriptor: s_memberSameAsClassWarning,
338-
location: GetMemberLocation(options, line, memberName), memberName
338+
location: GetMemberLocation(options.GroupedFile.MainFile, line, memberName), memberName
339339
));
340340
return false;
341341
}

0 commit comments

Comments
 (0)