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

Rename methods on SyntaxSetBuilder #195

Merged
merged 1 commit into from
Aug 2, 2018
Merged

Rename methods on SyntaxSetBuilder #195

merged 1 commit into from
Aug 2, 2018

Conversation

robinst
Copy link
Collaborator

@robinst robinst commented Aug 2, 2018

While we're breaking API anyway, I think this makes them a bit clearer:

  • add_syntax -> add
  • load_syntaxes -> load_from_folder
  • load_plain_text_syntax -> add_plain_text_syntax

While we're breaking API anyway, I think this makes them a bit clearer:

* `add_syntax` -> `add`
* `load_syntaxes` -> `load_from_folder`
* `load_plain_text_syntax` -> `add_plain_text_syntax`
@@ -292,22 +295,22 @@ impl SyntaxSetBuilder {
}

/// Add a syntax to the set.
pub fn add_syntax(&mut self, syntax: SyntaxDefinition) {
pub fn add(&mut self, syntax: SyntaxDefinition) {
self.syntaxes.push(syntax);
}

/// Rarely useful method that loads in a syntax with no highlighting rules for plain text.
/// Exists mainly for adding the plain text syntax to syntax set dumps, because for some
/// reason the default Sublime plain text syntax is still in `.tmLanguage` format.
#[cfg(feature = "yaml-load")]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I noticed that this needs YAML, but we could change it to instead just create the structs directly. Any thoughts?

Copy link
Owner

Choose a reason for hiding this comment

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

Sure if you want to do the translation, submit a separate PR and I'll approve.

Copy link
Owner

@trishume trishume 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 thanks!

@trishume trishume merged commit ea4076d into master Aug 2, 2018
@trishume trishume deleted the api-renames branch August 2, 2018 18:12
@trishume
Copy link
Owner

trishume commented Aug 2, 2018

I have a breaking change I may want to make to the html API, and then may review #185, then I'll look at drafting 3.0 in a few days ✨.

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

2 participants