Skip to content

Commit 4376ca3

Browse files
jdsutherlandbergercookie
authored andcommitted
Add csharp
1 parent 0fb8211 commit 4376ca3

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Lang | Debug String | Debug Variable
6464
Arduino | :heavy_check_mark: | :heavy_check_mark:
6565
Awk | :x: | :x:
6666
C | :heavy_check_mark: | :heavy_check_mark:
67-
C# | :x: | :x:
67+
C# | :heavy_check_mark: | :heavy_check_mark:
6868
C++ | :heavy_check_mark: | :heavy_check_mark:
6969
CMake | :heavy_check_mark: | :heavy_check_mark:
7070
D | :x: | :x:

ftplugin/cs.vim

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
function! s:DebugStringFunBase(desc, var)
2+
let l:debug_str = 'System.Console.WriteLine($"'
3+
\ . a:desc
4+
\ . '{' . a:var . '}'
5+
\ . '");'
6+
return l:debug_str
7+
endfunc
8+
9+
command! -buffer -nargs=0 AddDebugString
10+
\ put=s:DebugStringFunBase(g:DebugstringPrefixStr(), g:debugStringCounter)
11+
command! -buffer -nargs=1 AddDebugStringExpr
12+
\ put=s:DebugStringFunBase(<args> . ': ', <args>)

test/basic.vader

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ Execute (C):
3838
:set filetype=c
3939
Execute (C++):
4040
:set filetype=cpp
41+
Execute (C#):
42+
:set filetype=cs
4143
Execute (CMake):
4244
:set filetype=cmake
4345
Execute (Haskell):

test/ft/a.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
System.Console.WriteLine($"[[Vader-workbench]:$1$] DEBUGGING STRING ==> {$2$}");
2+
System.Console.WriteLine($"a**2 + b**2: {a**2 + b**2}");

0 commit comments

Comments
 (0)