Enable Dockerfile detection

This commit is contained in:
ema
2025-07-10 07:10:48 +08:00
parent 4c4375612e
commit d06abf461e
3 changed files with 31 additions and 2 deletions

View File

@@ -24,7 +24,7 @@ public sealed class DockerfileDetector : IFormatDetector
{
public string Name => "Dockerfile";
public string Extension => null;
public string Extension => ".sh";
public bool Detect(string path, string text)
{

View File

@@ -30,7 +30,7 @@ public class FormatDetector
new MakefileDetector(),
new CMakeListsDetector(),
//new HostsDetector(),
//new DockerfileDetector(),
new DockerfileDetector(),
];
public static IFormatDetector Confuse(string path, string text)

View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<SyntaxDefinition name="Shell Script" extensions=".sh">
<RuleSets>
<RuleSet ignorecase="false">
<Span name="LineComment" stopateol="true" color="#6A9955" bold="false" italic="false">
<Begin>#</Begin>
</Span>
<Span name="String" color="#CE9178" stopateol="true" bold="false" italic="false" escapecharacter="\">
<Begin>"</Begin>
<End>"</End>
</Span>
<Span name="Char" color="#CE9178" stopateol="true" bold="false" italic="false" escapecharacter="\">
<Begin>'</Begin>
<End>'</End>
</Span>
<KeyWords name="Syntax" color="#569CD6" bold="false">
<Key word="if"/>
<Key word="then"/>
<Key word="fi"/>
</KeyWords>
</RuleSet>
</RuleSets>
</SyntaxDefinition>