Quantcast
Channel: ResX Resource Manager
Viewing all articles
Browse latest Browse all 2435

New Post: "Detect code references" feature question

$
0
0
The key is only unique per resource file, and there is no demand to have a specific prefix to distinguish it from other names. I had projects where e.g. one key was "System", and it found hundreds of matches when looking only for the key.
Also looking for the class name first speeds up the search a bit.

I have already added code looking for a special key that we use when generating some code with text templates:
foreach (var sourceFile in sourceFiles.Where(file => file.FileKind != FileKind.Undefined))
{
    Contract.Assume(sourceFile != null);
    FindCodeReferences(sourceFile, @"StringResourceKey", resourceTableEntries);
}
So you could add something like
foreach (var sourceFile in sourceFiles)
{
    Contract.Assume(sourceFile != null);
    FindCodeReferences(sourceFile, @"LOC", resourceTableEntries);
}
and extend the function IsValidClassValueDeclaration so it matches your pattern.

Viewing all articles
Browse latest Browse all 2435

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>