Skip to content

Commit ffe6a72

Browse files
bergercookienikoskoukis-slamcore
authored andcommitted
Add support for Rust + test case
1 parent 5bc8565 commit ffe6a72

5 files changed

Lines changed: 15 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ PHP | :heavy_check_mark: | :heavy_check_mark:
6666
Python | :heavy_check_mark: | :heavy_check_mark:
6767
R | :heavy_check_mark: | :heavy_check_mark:
6868
Ruby | :heavy_check_mark: | :heavy_check_mark:
69-
Rust | :x: | :x:
69+
Rust | :heavy_check_mark: | :heavy_check_mark:
7070
Shell | :heavy_check_mark: | :heavy_check_mark:
7171
Vim | :heavy_check_mark: | :heavy_check_mark:
7272

ftplugin/rs.vim

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

test/basic.vader

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ Execute (R):
4949
:set filetype=r
5050
Execute (Ruby):
5151
:set filetype=ruby
52+
Execute (Rust):
53+
:set filetype=rs
5254
Execute (Shell):
5355
:set filetype=sh
5456
Execute (Vim):

test/ft/a.rs

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

test/run-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
unset CDPATH
66

77
cd "$(dirname "$(dirname "${BASH_SOURCE[0]}")")"
8-
vim -Nu test/vimrc -c 'Vader! test/*'
8+
command vim -Nu test/vimrc -c 'Vader! test/*'
99
cd -

0 commit comments

Comments
 (0)