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

Start Rls with configuration #711

Closed
alexheretic opened this issue Feb 13, 2018 · 3 comments
Closed

Start Rls with configuration #711

alexheretic opened this issue Feb 13, 2018 · 3 comments

Comments

@alexheretic
Copy link
Member

To configure Rls you must start it then send a workspace/didChangeConfiguration message. Rls triggers a build on startup & whenever configuration is changed.

Normally fine, at startup however this means 2 builds have triggered. 2 bulids on startup can cause 2 builds to happen (at least when the builds were eagerly debounced) and for 2 build fail messages to be sent to the client (if, for example, the project has an invalid Cargo.toml).

Is there/can we add a more graceful way to start Rls with configuration?

@nrc
Copy link
Member

nrc commented Feb 13, 2018

cc @Xanewok since I remember discussing this at some point

One easy solution would be to not to do an initial build and just wait for the workspace/didChangeConfiguration message. This is sub-optimal for client which don't send that message on startup, but it's not too bad, just means they don't start the initial build and index until the user starts typing.

Actually, thinking about this, I think we implemented an opt-in version of this where you can start the RLS without an initial build by setting a custom flag on the startup message or something. I don't know what happened to that.

@Xanewok
Copy link
Member

Xanewok commented Feb 13, 2018

Yeah, you're right! We implemented (c2b44b8) additional omitInitBuild param, which when passed (and set to true), didn't automatically start build immediately after initialization to work around this specific problem. Now that I think about it, I probably should've documented that somewhere 😞

@alexheretic
Copy link
Member Author

Cool, thanks guys this seems to do the trick in the initialize message

{
  ...
  initializationOptions: {
    ...
    omitInitBuild: true
  }
}

bors added a commit that referenced this issue Jan 28, 2019
Bump rand from 0.6.4 to 0.6.5

Bumps [rand](https://github.com/rust-random/rand) from 0.6.4 to 0.6.5.
<details>
<summary>Changelog</summary>

*Sourced from [rand's changelog](https://github.com/rust-random/rand/blob/master/CHANGELOG.md).*

> ## [0.6.5] - 2019-01-28
> ### Crates
> - Update `rand_core` to 0.4 ([#703](https://github-redirect.dependabot.com/rust-random/rand/issues/703))
> - Move `JitterRng` to its own crate ([#685](https://github-redirect.dependabot.com/rust-random/rand/issues/685))
> - Add a warm-bindgen test crate ([#696](https://github-redirect.dependabot.com/rust-random/rand/issues/696))
>
> ### Platforms
> - Fuchsia: Replaced fuchsia-zircon with fuchsia-cprng
>
> ### Doc
> - Use RFC 1946 for doc links ([#691](https://github-redirect.dependabot.com/rust-random/rand/issues/691))
> - Fix some doc links and notes ([#711](https://github-redirect.dependabot.com/rust-random/rand/issues/711))
</details>
<details>
<summary>Commits</summary>

- [`a8dc9ad`](rust-random/rand@a8dc9ad) Merge pull request [#714](https://github-redirect.dependabot.com/rust-random/rand/issues/714) from dhardy/master
- [`625411c`](rust-random/rand@625411c) Update changelog for 0.6.5
- [`76acffe`](rust-random/rand@76acffe) Merge pull request [#712](https://github-redirect.dependabot.com/rust-random/rand/issues/712) from erickt/master
- [`351edce`](rust-random/rand@351edce) Merge pull request [#711](https://github-redirect.dependabot.com/rust-random/rand/issues/711) from dhardy/master
- [`1d0d26c`](rust-random/rand@1d0d26c) Bump version, and document fuchsia_cprng change
- [`9ffaeb7`](rust-random/rand@9ffaeb7) Add rustdoc logo/root link config to sub-crates
- [`ec13800`](rust-random/rand@ec13800) Travis: allow failure of Android test
- [`b22b637`](rust-random/rand@b22b637) Fix external links in SmallRng documentation
- [`6ce5f81`](rust-random/rand@6ce5f81) Add links to the crate pages for the rngs mentioned in StdRng docs
- [`8112daa`](rust-random/rand@8112daa) Merge pull request [#703](https://github-redirect.dependabot.com/rust-random/rand/issues/703) from dhardy/master
- Additional commits viewable in [compare view](rust-random/rand@0.6.4...0.6.5)
</details>
<br />

[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=rand&package-manager=cargo&previous-version=0.6.4&new-version=0.6.5)](https://dependabot.com/compatibility-score.html?dependency-name=rand&package-manager=cargo&previous-version=0.6.4&new-version=0.6.5)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot ignore this [patch|minor|major] version` will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in the `.dependabot/config.yml` file in this repo:
- Update frequency (including time of day and day of week)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

</details>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants