Skip to content

Conversation

@popzxc
Copy link
Contributor

@popzxc popzxc commented Nov 1, 2020

This PR extracts rendering-related things from Completions structure to the new render module.

render module declares a Render structure (which is a generic renderer interface), RenderContext (interface for data/methods not required for completions generating, but required for rendering), and a bunch of smaller *Render structures which encapsulate logic behind rendering a certain item.

This is just a step in full separation direction, since the following this are still to be done:

  • Move some data from CompletionContext to the RenderContext;
  • Forbid any kind of rendering outside of render module;
  • Extract score computing into a separate module.

This PR is already pretty big, so not to make it even harder to review I decided to split this process into several subsequent PRs.

@popzxc popzxc changed the title Separate completions rendering into a separate module Move completions rendering into a separate module Nov 1, 2020
@matklad
Copy link
Contributor

matklad commented Nov 2, 2020

Looks good to me, this is definitely a direction worth exploring. I like the stricter separation, and I like that each thing gets its dedicated module.

I slightly don't like the proliferation of types here. There's a natural tension between "every bit of logic is separated into a module" and "there's only few vocabulary types". In an ideal world, there should be many pieces, but they all should operate the same types.

I am also not sure if super-strict separation would be benefitial long-term (although i expect that it would).

The only not-so-minor complaint I have is about do-er objects, the rest looks good to me!

bors d+

@bors
Copy link
Contributor

bors bot commented Nov 2, 2020

✌️ popzxc can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@popzxc popzxc force-pushed the completions-rendering branch from 62edb10 to 8efe432 Compare November 3, 2020 07:37
@popzxc
Copy link
Contributor Author

popzxc commented Nov 3, 2020

bors r+

@bors
Copy link
Contributor

bors bot commented Nov 3, 2020

@bors bors bot merged commit 07c7f35 into rust-lang:master Nov 3, 2020
@popzxc popzxc deleted the completions-rendering branch November 3, 2020 08:02
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.

2 participants