mirror of
https://github.com/openai/codex.git
synced 2026-03-05 21:45:28 +03:00
Add C# syntax option to highlight selections (#12511)
Summary - map csharp/c-sharp aliases to the existing C# syntax in the highlight matcher - ensure the extension list and tests include .cs and the new aliases so coverage stays accurate Testing <img width="543" height="266" alt="image" src="https://github.com/user-attachments/assets/e6c8a42f-649c-4c30-b574-421b4287534c" />
This commit is contained in:
@@ -403,6 +403,7 @@ fn find_syntax(lang: &str) -> Option<&'static SyntaxReference> {
|
||||
|
||||
// Aliases that two-face does not resolve on its own.
|
||||
let patched = match lang {
|
||||
"csharp" | "c-sharp" => "c#",
|
||||
"golang" => "go",
|
||||
"python3" => "python",
|
||||
"shell" => "bash",
|
||||
@@ -806,6 +807,7 @@ mod tests {
|
||||
"zig",
|
||||
"swift",
|
||||
"java",
|
||||
"c#",
|
||||
"elixir",
|
||||
"haskell",
|
||||
"scala",
|
||||
@@ -829,7 +831,7 @@ mod tests {
|
||||
// Common file extensions.
|
||||
let extensions = [
|
||||
"rs", "py", "js", "ts", "rb", "go", "sh", "md", "yml", "kt", "ex", "hs", "pl", "php",
|
||||
"css", "html",
|
||||
"css", "html", "cs",
|
||||
];
|
||||
for ext in extensions {
|
||||
assert!(
|
||||
@@ -838,7 +840,7 @@ mod tests {
|
||||
);
|
||||
}
|
||||
// Patched aliases that two-face cannot resolve on its own.
|
||||
for alias in ["golang", "python3", "shell"] {
|
||||
for alias in ["csharp", "c-sharp", "golang", "python3", "shell"] {
|
||||
assert!(
|
||||
find_syntax(alias).is_some(),
|
||||
"find_syntax({alias:?}) returned None — patched alias broken"
|
||||
|
||||
Reference in New Issue
Block a user