Skip to content
This repository has been archived by the owner on Jun 7, 2022. It is now read-only.

Newline chars in function signatures #21

Closed
Valloric opened this issue Jan 29, 2016 · 4 comments · Fixed by #22
Closed

Newline chars in function signatures #21

Valloric opened this issue Jan 29, 2016 · 4 comments · Fixed by #22

Comments

@Valloric
Copy link
Contributor

Testcase code

struct foo {}

impl foo {
  fn format( &self )
    -> u32 {
  }
}

fn main() {
  let x = foo{};
  x.
}

Completion shown in Vim through YCM:

bug

One could consider this a bug in ycmd since it might make sense to remove the newline there, or possibly in YCM itself because the newline doesn't render sensibly in Vim so the Vim workaround should be there, but racerd (or racer itself) should probably not be returning a newline here either. I can't imagine an editor for which a newline should be displayed here.

I'd suggest replacing all whitespace char runs with a single space... somewhere.

(We're "turtles all the way down" on this bug...)

@jwilm
Copy link
Owner

jwilm commented Jan 29, 2016

Thanks for filing the issue!

I'd suggest replacing all whitespace char runs with a single space... somewhere.

I've been thinking it would be nice to clean up the signatures in the completemenu, and this sounds like an easy thing to do for now. In the future, Racer will hopefully offer more granular signature info - return type, where clauses, arguments as separate properties. Since this project will need to be updated when that happens anyway, this seems like a fine place to make the whitespace change.

If you're feeling really ambitious, our iteration over matches from Racer would probably be a good place to apply this transformation. Otherwise, I'll get to this... eventually.

@Valloric
Copy link
Contributor Author

@jwilm Thanks for pointing me in the right direction; I might just send you a PR! :)

@jwilm
Copy link
Owner

jwilm commented Jan 29, 2016

I love PRs!

@Valloric
Copy link
Contributor Author

PR #22 created! :)

@jwilm jwilm closed this as completed in #22 Jan 30, 2016
homu added a commit to ycm-core/ycmd that referenced this issue Jan 30, 2016
Updating to latest racerd

We'd like to pick up the fix for jwilm/racerd#21.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/valloric/ycmd/329)
<!-- Reviewable:end -->
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 a pull request may close this issue.

2 participants