about summary refs log tree commit diff
path: root/src/etc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-06-17 02:51:53 +0000
committerbors <bors@rust-lang.org>2014-06-17 02:51:53 +0000
commit09967665eaa5ca3d259f0f59ef26c8d236bf47a7 (patch)
treeae450abfecbe1fdec6f583cf7cf743c35663a4c7 /src/etc
parentcc30abbcad282634fb99089eb9297e7cc4f26729 (diff)
parentb9adb6c717627ab6dcc9298b79a8d44cfe2fc616 (diff)
downloadrust-09967665eaa5ca3d259f0f59ef26c8d236bf47a7.tar.gz
rust-09967665eaa5ca3d259f0f59ef26c8d236bf47a7.zip
auto merge of #14955 : alexcrichton/rust/rollup, r=alexcrichton
Diffstat (limited to 'src/etc')
-rw-r--r--src/etc/emacs/rust-mode.el2
-rwxr-xr-xsrc/etc/generate-keyword-tests.py2
-rw-r--r--src/etc/vim/plugin/rust.vim22
-rw-r--r--src/etc/vim/syntax_checkers/rust/rustc.vim35
4 files changed, 59 insertions, 2 deletions
diff --git a/src/etc/emacs/rust-mode.el b/src/etc/emacs/rust-mode.el
index 175592d792b..818595b9dc1 100644
--- a/src/etc/emacs/rust-mode.el
+++ b/src/etc/emacs/rust-mode.el
@@ -2,7 +2,7 @@
 
 ;; Version: 0.2.0
 ;; Author: Mozilla
-;; Url: https://github.com/mozilla/rust
+;; Url: https://github.com/rust-lang/rust
 ;; Keywords: languages
 
 ;;; Commentary:
diff --git a/src/etc/generate-keyword-tests.py b/src/etc/generate-keyword-tests.py
index de148f3cfab..bf421513cba 100755
--- a/src/etc/generate-keyword-tests.py
+++ b/src/etc/generate-keyword-tests.py
@@ -13,7 +13,7 @@
 This script takes a list of keywords and generates a testcase, that checks
 if using the keyword as identifier fails, for every keyword. The generate
 test files are set read-only.
-Test for https://github.com/mozilla/rust/issues/2275
+Test for https://github.com/rust-lang/rust/issues/2275
 
 sample usage: src/etc/generate-keyword-tests.py as break
 """
diff --git a/src/etc/vim/plugin/rust.vim b/src/etc/vim/plugin/rust.vim
new file mode 100644
index 00000000000..4ec4f33d545
--- /dev/null
+++ b/src/etc/vim/plugin/rust.vim
@@ -0,0 +1,22 @@
+" Vim syntastic plugin helper
+" Language:     Rust
+" Maintainer:   Andrew Gallant <jamslam@gmail.com>
+
+if exists("g:loaded_syntastic_rust_filetype")
+  finish
+endif
+let g:loaded_syntastic_rust_filetype = 1
+let s:save_cpo = &cpo
+set cpo&vim
+
+" This is to let Syntastic know about the Rust filetype.
+" It enables tab completion for the 'SyntasticInfo' command.
+" (This does not actually register the syntax checker.)
+if exists('g:syntastic_extra_filetypes')
+    call add(g:syntastic_extra_filetypes, 'rust')
+else
+    let g:syntastic_extra_filetypes = ['rust']
+endif
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
diff --git a/src/etc/vim/syntax_checkers/rust/rustc.vim b/src/etc/vim/syntax_checkers/rust/rustc.vim
new file mode 100644
index 00000000000..5cd419ca732
--- /dev/null
+++ b/src/etc/vim/syntax_checkers/rust/rustc.vim
@@ -0,0 +1,35 @@
+" Vim syntastic plugin
+" Language:     Rust
+" Maintainer:   Andrew Gallant <jamslam@gmail.com>
+"
+" See for details on how to add an external Syntastic checker:
+" https://github.com/scrooloose/syntastic/wiki/Syntax-Checker-Guide#external
+
+if exists("g:loaded_syntastic_rust_rustc_checker")
+    finish
+endif
+let g:loaded_syntastic_rust_rustc_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_rust_rustc_GetLocList() dict
+    let makeprg = self.makeprgBuild({ 'args': '--parse-only' })
+
+    let errorformat  =
+        \ '%E%f:%l:%c: %\d%#:%\d%# %.%\{-}error:%.%\{-} %m,'   .
+        \ '%W%f:%l:%c: %\d%#:%\d%# %.%\{-}warning:%.%\{-} %m,' .
+        \ '%C%f:%l %m,' .
+        \ '%-Z%.%#'
+
+    return SyntasticMake({
+        \ 'makeprg': makeprg,
+        \ 'errorformat': errorformat })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+    \ 'filetype': 'rust',
+    \ 'name': 'rustc'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo