Skip to content

Commit

Permalink
Make find_by_name case-sensitive again
Browse files Browse the repository at this point in the history
  • Loading branch information
alan-j-hu committed Jul 15, 2021
1 parent d9c9ffe commit d400bc7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
3 changes: 1 addition & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
## 0.4.0 (July 15, 2021)
## 0.3.1 (July 15, 2021)

- Add `find_by_filetype` function.
- Make `find_by_scope_name` case-sensitive.

## 0.3.0 (July 4, 2021)

Expand Down
3 changes: 2 additions & 1 deletion src/common.ml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ let add_grammar t grammar =
Hashtbl.add t.by_filetype filetype grammar
) grammar.filetypes

let find_by_name t = Hashtbl.find_opt t.by_name
let find_by_name t name =
Hashtbl.find_opt t.by_name (String.lowercase_ascii name)

let find_by_scope_name t = Hashtbl.find_opt t.by_scope_name

Expand Down
6 changes: 3 additions & 3 deletions src/tmLanguage.mli
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ val add_grammar : t -> grammar -> unit
(** Add a grammar to the collection. *)

val find_by_name : t -> string -> grammar option
(** Finds a grammar by its [name] attribute. *)
(** Finds a grammar by its [name] attribute. Case-insensitive. *)

val find_by_scope_name : t -> string -> grammar option
(** Finds a grammar by its [scopeName] attribute. *)
(** Finds a grammar by its [scopeName] attribute. Case-sensitive. *)

val find_by_filetype : t -> string -> grammar option
(** Finds a grammar by matching one of the strings in its [fileTypes]
attribute. *)
attribute. Case-sensitive. *)

val of_plist_exn : plist -> grammar
(** Reads a TextMate grammar from a PLIST file. Raises {!exception:Error} if
Expand Down

0 comments on commit d400bc7

Please sign in to comment.