[vim/vim] Import rust files (#1356)

121 views
Skip to first unread message

Steve Klabnik

unread,
Jan 5, 2017, 12:05:44 PM1/5/17
to vim/vim, Subscribed

This is my first contribution to vim, so please bear with me as I learn the ropes.

This patch imports rust-lang/rust.vim@732b5fc into vim itself. I've built vim and confirmed that at least the syntax highlighting is working; frankly, I don't use many of its other features myself.

I am not an expert on vim plugins; some of the files included in rust.vim don't have a directory here in vim itself, like after/syntax. I am not sure if they're needed when not run as a plugin.

Any and all feedback welcome; I'm happy to update with any requirements. Thanks!

Addresses #1354


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/1356

Commit Summary

  • Import rust files

File Changes

Patch Links:


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub

Steve Klabnik

unread,
Jan 5, 2017, 12:11:25 PM1/5/17
to vim/vim, Subscribed

Oh, one thing I forgot:

When you do, please mention who you are, the license under which this is developed and that you give us allowance to distribute it with Vim.

I am on the Rust core team, and am one of the maintainers of rust.vim. rust.vim is distributed under the terms of both the MIT license and the Apache License (Version 2.0), at your option. As such, you don't need me to allow it, but I allow it regardless 😄

Nikolai Aleksandrovich Pavlov

unread,
Jan 5, 2017, 1:07:59 PM1/5/17
to vim/vim, Subscribed

If I am not mistaking, rust.txt should be ft_rust.txt with tags looking like ft-rust…, possibly with ft-rust-plugin, ft-rust-syntax and ft-rust-indent tags.

There are lots of examples of this convention, though e.g. ft_sql.txt does not follow it; other tags are normally present in syntax.txt (ft-…-syntax; though ft-ada-syntax is in ft_ada.txt), ), insert.txt (ft-…-omni, except for ft-ada-omni), indent.txt (ft-…-indent, except for ft-ada-indent), filetype.txt (ft-…-plugin, except for ft-ada-plugin): as you see, ft_ada.txt was allowed to contain them all instead of scattering documentation over the files. Compilers are described in quickfix.txt with tag like compiler-rust, but I do not know exceptions here.

Christian Brabandt

unread,
Jan 5, 2017, 2:56:14 PM1/5/17
to vim/vim, Subscribed

this is for #1354
Thanks for that. If I am not mistaken, there are some functions, that seem not needed, e.g. autoload/rust.vim autoload/rustfmt.vim Or some files are missing. In particular I am missing the command definitions for those :RustRun , :RustExpand RustEmitIr RustEmitAsm and RustFmt and RustFmtRange command. Ah, I think, those commands are defined in ftplugin/rust.vim which is not included in this PR.

Also plugin/rust.vim only seems to be about syntastic, so we can probably skip that.

syntax/rust.vim and indent/rust.vim look fine

Also you might want to mention in those files, that they are maintained at https://github.com/rust-lang/rust.vim so that people having issues can direct them directly to the upstream repository.

Bram Moolenaar

unread,
Jan 6, 2017, 2:04:44 PM1/6/17
to vim/vim, Subscribed

Steve Klabnik wrote:

> Oh, one thing I forgot:
>
> > When you do, please mention who you are, the license under which
> > this is developed and that you give us allowance to distribute it
> > with Vim.
>
> I am on the Rust core team, and am one of the maintainers of
> `rust.vim`. rust.vim is distributed under the terms of both the MIT

> license and the Apache License (Version 2.0), at your option. As such,
> you don't need me to allow it, but I allow it regardless 𐟘„

Please update the headeer of each file to make clear where users should
send comments/patches.

Please add a remark about the license. I think that using MIT is fine
and does not conflict with how Vim is distributed.

A link to the github repository probably covers both. E.g.:

For bugs, patches and license go to https://github.com/rust-lang/rust.vim

--
hundred-and-one symptoms of being an internet addict:
196. Your computer costs more than your car.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Steve Klabnik

unread,
Jan 7, 2017, 2:31:44 PM1/7/17
to vim/vim, Push

@steveklabnik pushed 1 commit.

  • 27b3264 leave notes for where to file bugs and get the liccense


You are receiving this because you are subscribed to this thread.

View it on GitHub

Steve Klabnik

unread,
Jan 7, 2017, 2:34:37 PM1/7/17
to vim/vim, Subscribed

Thanks @chrisbra and @brammool ! I've pushed a second commit; please let me know if you want me to squash them.

@chris,

Also plugin/rust.vim only seems to be about syntastic, so we can probably skip that.

Ah yes, we probably have some extra stuff that's not needed. I can remove them. syntastic has been causing us headaches anyway... I'll push a commit with this.

If I am not mistaken, there are some functions, that seem not needed, e.g. autoload/rust.vim autoload/rustfmt.vim Or some files are missing. In particular I am missing the command definitions for those :RustRun , :RustExpand RustEmitIr RustEmitAsm and RustFmt and RustFmtRange command.

Ah, I think, those commands are defined in ftplugin/rust.vim which is not included in this PR.

I've pushed a second commit that added ftplugin, don't know how I missed it the first time. Thanks!

Steve Klabnik

unread,
Jan 7, 2017, 2:35:42 PM1/7/17
to vim/vim, Push

@steveklabnik pushed 1 commit.

  • 9ab71de Add ftplugin, remove plugin


You are receiving this because you are subscribed to this thread.

View it on GitHub

Bram Moolenaar

unread,
Jan 17, 2017, 12:36:31 PM1/17/17
to vim/vim, Subscribed

A few more remarks.

Please remove loading the matchit plugin, that is a user preference unrelated to rust.

Please use a tabstop of 8. And adjust the modeline for that.

The header for runtime/ftplugin/rust.vim says it's a syntax file.

As mentioned, please rename the doc file to ft_rust.vim

The ftplugin file is missing the link to the github project.

Steve Klabnik

unread,
Feb 1, 2017, 12:19:49 PM2/1/17
to vim/vim, Subscribed

A quick update on this PR: the last few weeks have been very busy for me, but I intend to address @brammool 's comments no later than next week. Sorry about taking so long here!

Steve Klabnik

unread,
Feb 7, 2017, 1:52:53 PM2/7/17
to vim/vim, Subscribed

I believe I have now addressed all the review comments. Thanks again for your patience here.

Linda_pp

unread,
Mar 8, 2017, 5:27:28 AM3/8/17
to vim/vim, Subscribed

Any update on this? I think this would be a great contribution.

Steve Klabnik

unread,
Mar 8, 2017, 10:34:13 AM3/8/17
to vim/vim, Subscribed

Done. Your build exited with 0.

Looks like this Travis failure was spurious, so I didn't say anything. Happy to do whatever to get this merged.

Christian Brabandt

unread,
Mar 22, 2017, 7:31:40 AM3/22/17
to vim/vim, Subscribed

Closed #1356.

Christian Brabandt

unread,
Mar 22, 2017, 7:31:43 AM3/22/17
to vim/vim, Subscribed

included as of 3c2881d

Steve Klabnik

unread,
Mar 22, 2017, 12:49:03 PM3/22/17
to vim/vim, Subscribed

Thank you so much!

Reply all
Reply to author
Forward
0 new messages