Skip to content

Expose methods to locate and load config #1613

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

Merged
merged 2 commits into from
May 31, 2017
Merged

Conversation

khadiwala
Copy link
Contributor

  • Make method for searching parents for toml file public
  • Make method for loading config from path directly public, tweak the
    API since it was never returning None

Would allow RLS to reuse the rustfmt.toml searching/loading code (rust-lang/rls#331)

* Make method for searching parents for toml file public
* Make method for loading config from path directly public, tweak the
  API since it was never returning None
src/config.rs Outdated
/// Construct a `Config` from the toml file specified at `file_path`.
///
/// This method only looks at the provided path, for a method that
/// searches parents for an `rls.toml` see `resolve_config`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this line a typo, or only relevant when using from rls? If so, I would like to have it explained here since it may confusing afterward.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, just a typo. Pushed a fix.

@topecongiro
Copy link
Contributor

LGTM, thank you for cleaning up! Left a small nit inline, please take a look.

Copy link
Member

@nrc nrc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a minor error in the docs to fix

src/config.rs Outdated
/// Construct a `Config` from the toml file specified at `file_path`.
///
/// This method only looks at the provided path, for a method that
/// searches parents for an `rls.toml` see `resolve_config`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see resolve_config, I think the name is changed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh boy, two typos in the same line. Pushed a fix, thanks.

@nrc nrc merged commit f6e8e9f into rust-lang:master May 31, 2017
@nrc
Copy link
Member

nrc commented May 31, 2017

Thank you!

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.

3 participants