Skip to content

Commit

Permalink
Add csharp
Browse files Browse the repository at this point in the history
  • Loading branch information
jdsutherland authored and bergercookie committed Dec 26, 2020
1 parent 0fb8211 commit 4376ca3
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Lang | Debug String | Debug Variable
Arduino | :heavy_check_mark: | :heavy_check_mark:
Awk | :x: | :x:
C | :heavy_check_mark: | :heavy_check_mark:
C# | :x: | :x:
C# | :heavy_check_mark: | :heavy_check_mark:
C++ | :heavy_check_mark: | :heavy_check_mark:
CMake | :heavy_check_mark: | :heavy_check_mark:
D | :x: | :x:
Expand Down
12 changes: 12 additions & 0 deletions ftplugin/cs.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
function! s:DebugStringFunBase(desc, var)
let l:debug_str = 'System.Console.WriteLine($"'
\ . a:desc
\ . '{' . a:var . '}'
\ . '");'
return l:debug_str
endfunc

command! -buffer -nargs=0 AddDebugString
\ put=s:DebugStringFunBase(g:DebugstringPrefixStr(), g:debugStringCounter)
command! -buffer -nargs=1 AddDebugStringExpr
\ put=s:DebugStringFunBase(<args> . ': ', <args>)
2 changes: 2 additions & 0 deletions test/basic.vader
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ Execute (C):
:set filetype=c
Execute (C++):
:set filetype=cpp
Execute (C#):
:set filetype=cs
Execute (CMake):
:set filetype=cmake
Execute (Haskell):
Expand Down
2 changes: 2 additions & 0 deletions test/ft/a.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
System.Console.WriteLine($"[[Vader-workbench]:$1$] DEBUGGING STRING ==> {$2$}");
System.Console.WriteLine($"a**2 + b**2: {a**2 + b**2}");

0 comments on commit 4376ca3

Please sign in to comment.