Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Add syntastic_rustc_config_file handling #1112

Closed
wants to merge 1 commit into from

Conversation

brookst
Copy link

@brookst brookst commented Jun 12, 2014

Add args from g:syntastic_rustc_config_file to rustc command.
Had to borrow syntastic#c#ReadConfig code to parse the -L flag.

Could this function be made more general to allow reuse?

@lcd047
Copy link
Collaborator

lcd047 commented Jun 12, 2014

Had to borrow syntastic#c#ReadConfig code to parse the -L flag.

Oh please, you can do much better than that. Like, add an option to syntastic#c#ReadConfig() to handle -L, or simply add that to syntastic#c#ReadConfig() (off hand, I think all compilers have that option).

Still, can you pleaes give an example why is all this needed in the first place?

@brookst
Copy link
Author

brookst commented Jun 12, 2014

I'm using this to add an external library to the checker. It doesn't make sense to do this globally so I thought a project-local config file would be the way to do this: This is how I set up C++ projects. Is there a better way to provide library paths on a project local basis?

It was my intention to reuse the ReadConfig function but I didn't want to start changing it without some comments on what would be best to do. I don't know if any other checkers would use library paths like this, I guess it's just a rust quirk that libraries are linked with -L instead of -I.

@lcd047
Copy link
Collaborator

lcd047 commented Jun 12, 2014

This is better, but it still seems to be way overkill. Config files are useful for long, complicated lists of options. As far as I can tell, in your case a simple autocmd would be enough:

autocmd /some/path/*.rs let g:syntastic_rust_rustc_args='-L /some/other/path'

@brookst
Copy link
Author

brookst commented Jun 12, 2014

Hmm, to me it just seems more intuitive to put these options in a file with the projects they relate to. Having a stack of autocmds in my vimrc doesn't seem very appealing.

Unless you mean in a local vimrc but I thought they were frowned upon.

Would it not make sense for rustc to read config files, given many other checkers do?

@lcd047
Copy link
Collaborator

lcd047 commented Jun 12, 2014

Using autocmd is Vim's way of doing things. It's still cleaner than adding an option that is useful for a single checker. shrug

Add args from g:syntastic_rustc_config_file to rustc command.
@brookst
Copy link
Author

brookst commented Jun 12, 2014

OK, what if I don't touch the ReadConfig and just use args as:

-Lpath/to/lib

or

-L
path/to/lib

Then there's no extra option. (I re-read the wiki entry on config files)

@lcd047
Copy link
Collaborator

lcd047 commented Jun 12, 2014

Like I said, for better or worse, using autocmd for that is the Vim way. One line in your vimrc, as opposed to many more lines in syntastic. shrug

@lcd047 lcd047 closed this Jun 12, 2014
lcd047 added a commit that referenced this pull request Jun 12, 2014
Between #947, #1114, and #1112, this checker is too controversial to
maintain in syntastic.  Please consider using it as an external checker
if you need it:

https://github.com/scrooloose/syntastic/wiki/Syntax-Checker-Guide#external
slm0n87 pushed a commit to slm0n87/syntastic that referenced this pull request Mar 7, 2019
Between vim-syntastic#947, vim-syntastic#1114, and vim-syntastic#1112, this checker is too controversial to
maintain in syntastic.  Please consider using it as an external checker
if you need it:

https://github.com/scrooloose/syntastic/wiki/Syntax-Checker-Guide#external
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants