Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rust-mode.el: check for possible space between variable name and type #325

Merged
merged 1 commit into from Sep 30, 2019

Conversation

Hi-Angel
Copy link
Contributor

@Hi-Angel Hi-Angel commented Sep 29, 2019

Fixes the following problem: consider code

fn foo(a: u32, b : u32) {}

Here, b was not highlighted as a variable, because the regex didn't
take into account possible space before the colon.

Signed-off-by: Konstantin Kharlamov Hi-Angel@yandex.ru

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nikomatsakis (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@Hi-Angel
Copy link
Contributor Author

Err, rather "before" the colon… Let me fix the description in a moment

@Hi-Angel
Copy link
Contributor Author

Done

@mookid
Copy link
Contributor

mookid commented Sep 29, 2019

It looks ok. Could you add some tests?

edit: it reminded me of something, because of #274 :)

@Hi-Angel
Copy link
Contributor Author

It looks ok. Could you add some tests?

Sure, done.

@Hi-Angel
Copy link
Contributor Author

Although, wait a moment, I figured I shouldn't add this test to an existing one, but rather create a separate test. Let me fix this

Fixes the following problem: consider code

    fn foo(a: u32, b : u32) {}

Here, `b` was not highlighted as a variable, because the regex didn't
take into account possible space before the colon.

Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
@Hi-Angel
Copy link
Contributor Author

Done

@Hi-Angel
Copy link
Contributor Author

Hi-Angel commented Sep 29, 2019

edit: it reminded me of something, because of #274 :)

Sorry, didn't see the edit. That's cool btw, our code changes are pretty similar :) Why did you close it back then?

@mookid
Copy link
Contributor

mookid commented Sep 29, 2019

because there was no answer, I thought that there was no interest.

I will merge once tests pass.

@Hi-Angel
Copy link
Contributor Author

because there was no answer, I thought that there was no interest.

Well, it's a bugfix after all. They usually are boring, which doesn't make them less useful :)

The font-lock-variable-face is important for users of color-identifiers mode, which makes such discrepancy pretty visible.

@Hi-Angel
Copy link
Contributor Author

I think there's a bug with Travis CI: while this page says lots of builds are queued,

Screenshot_20191001_013855

but if you click any link in them, for example 422.6, it says it already passed:

Screenshot_20191001_014000

@mookid mookid merged commit 897af24 into rust-lang:master Sep 30, 2019
@mookid
Copy link
Contributor

mookid commented Sep 30, 2019

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants