-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: convert roblox-cs.yml EnableDebugTransformer setting into Enabl…
…edBuiltInTransformers
- Loading branch information
Showing
9 changed files
with
40 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using Microsoft.CodeAnalysis; | ||
|
||
namespace RobloxCS | ||
{ | ||
using TransformMethod = Func<SyntaxTree, ConfigData, SyntaxTree>; | ||
|
||
public static partial class BuiltInTransformers | ||
{ | ||
public static TransformMethod Main() | ||
{ | ||
return (tree, config) => new MainTransformer(tree, config).TransformTree(); | ||
} | ||
|
||
public static TransformMethod Get(string name) | ||
{ | ||
return name.ToLower() switch | ||
{ | ||
"debug" => (tree, config) => new DebugTransformer(tree, config).TransformTree(), | ||
_ => FailedToGetTransformer(name) | ||
}; | ||
} | ||
|
||
private static TransformMethod FailedToGetTransformer(string name) | ||
{ | ||
Logger.Error($"No built-in transformer \"{name}\" exists (roblox-cs.yml)"); | ||
return null!; // hack | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters