Skip to content

Commit 1acb4eb

Browse files
committed
Fix up c# support
1 parent 2dc0ffd commit 1acb4eb

File tree

7 files changed

+33
-27
lines changed

7 files changed

+33
-27
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
[0.3.15]
2+
3+
- Add C# support
4+
15
[0.3.14]
26

37
- Add Zig support

Cargo.lock

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ tree-sitter-rust = "<0.25.0"
6262
tree-sitter-toml-ng = "<0.8.0"
6363
tree-sitter-typescript = "0.23.2"
6464
tree-sitter-zig = "<2"
65-
tree-sitter-c-sharp= "<0.23.1"
65+
tree-sitter-c-sharp= "<0.24.0"
6666
codebook-tree-sitter-latex = "<0.7.0"
6767
unicode-segmentation = "1.12.0"
6868
url = "2.4.0"

crates/codebook/src/dictionaries/combined.gen.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,6 +1436,7 @@ link
14361436
linkcol
14371437
linkedlist
14381438
links
1439+
linq
14391440
lint
14401441
linter
14411442
linux

crates/codebook/src/queries.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ use tree_sitter::Language;
66
pub enum LanguageType {
77
Bash,
88
C,
9+
CSharp,
910
Cpp,
1011
Css,
1112
Elixir,
1213
Go,
13-
Haskell,
1414
HTML,
15+
Haskell,
1516
Java,
1617
Javascript,
1718
Latex,
@@ -25,7 +26,6 @@ pub enum LanguageType {
2526
Text,
2627
Typescript,
2728
Zig,
28-
CSharp
2929
}
3030

3131
impl FromStr for LanguageType {
@@ -224,12 +224,13 @@ impl LanguageSetting {
224224
match self.type_ {
225225
LanguageType::Bash => Some(tree_sitter_bash::LANGUAGE.into()),
226226
LanguageType::C => Some(tree_sitter_c::LANGUAGE.into()),
227+
LanguageType::CSharp => Some(tree_sitter_c_sharp::LANGUAGE.into()),
227228
LanguageType::Cpp => Some(tree_sitter_cpp::LANGUAGE.into()),
228229
LanguageType::Css => Some(tree_sitter_css::LANGUAGE.into()),
229230
LanguageType::Elixir => Some(tree_sitter_elixir::LANGUAGE.into()),
230231
LanguageType::Go => Some(tree_sitter_go::LANGUAGE.into()),
231-
LanguageType::Haskell => Some(tree_sitter_haskell::LANGUAGE.into()),
232232
LanguageType::HTML => Some(tree_sitter_html::LANGUAGE.into()),
233+
LanguageType::Haskell => Some(tree_sitter_haskell::LANGUAGE.into()),
233234
LanguageType::Java => Some(tree_sitter_java::LANGUAGE.into()),
234235
LanguageType::Javascript => Some(tree_sitter_javascript::LANGUAGE.into()),
235236
LanguageType::Latex => Some(codebook_tree_sitter_latex::language()),
@@ -243,7 +244,6 @@ impl LanguageSetting {
243244
LanguageType::Text => None,
244245
LanguageType::Typescript => Some(tree_sitter_typescript::LANGUAGE_TYPESCRIPT.into()),
245246
LanguageType::Zig => Some(tree_sitter_zig::LANGUAGE.into()),
246-
LanguageType::CSharp=> Some(tree_sitter_c_sharp::LANGUAGE.into()),
247247
}
248248
}
249249
}

examples/example.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
using System.Collections.Generic;
66
using System.Linq;
77

8-
namespace SpellcheckDemo
8+
namespace SpellcheckDemoo
99
{
10-
// Interface with a mispelled name/method
10+
// Interface with a mispelled name/methodd
1111
public interface IProcesor
1212
{
1313
int Proccess(string inputt);
@@ -18,7 +18,7 @@ public class DataProccessor : IProcesor
1818
{
1919
// Field & property with typos
2020
private readonly List<string> logg = new();
21-
public string Environmant { get; set; } = "Prodction";
21+
public string Environmantt { get; set; } = "Prodction";
2222

2323
// Const field with a typo in the identifier and the string
2424
public const string myVarible = "Hello Wolrd";
@@ -65,7 +65,7 @@ private static string formattMesage(string namee) =>
6565
// Expose something that calls the helper to keep it realistic
6666
public void EmitWellcome(string namee)
6767
{
68-
Console.WriteLine(formattMesage(namee));
68+
Consoole.WriteLine(formattMesage(namee));
6969
}
7070
}
7171

@@ -87,7 +87,7 @@ public static int Main(string[] args)
8787
procesor.PrintMesage(new Usr(42, "Sofsu"));
8888
procesor.EmitWellcome("Wolrd");
8989

90-
// Realistic output line with typos in the string
90+
// Realistic output line with typos in the stringg
9191
Console.WriteLine("Done proccessing; final resullt = " + resullt);
9292

9393
return 0;

word_lists/c_sharp.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
linq

0 commit comments

Comments
 (0)