From 829e80d7b37309f4b37a7585d725d0fcfdd1d133 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20F=C3=B6rster?= Date: Sun, 2 Nov 2025 21:11:12 +0100 Subject: [PATCH] Run "cargo fmt" (#1479) --- crates/base-db/src/data.rs | 156 +++++++++++++----- crates/base-db/src/deps.rs | 2 +- crates/base-db/src/deps/graph.rs | 2 +- crates/base-db/src/deps/root.rs | 2 +- crates/base-db/src/document.rs | 4 +- crates/base-db/src/semantics/bib.rs | 2 +- crates/base-db/src/semantics/tex.rs | 2 +- crates/base-db/src/util.rs | 2 +- crates/base-db/src/util/label.rs | 2 +- crates/base-db/src/util/queries.rs | 2 +- crates/base-db/src/workspace.rs | 2 +- crates/bibfmt/src/lib.rs | 2 +- crates/bibfmt/src/tests.rs | 2 +- crates/bibtex-utils/src/field/author.rs | 2 +- crates/bibtex-utils/src/field/date.rs | 2 +- crates/bibtex-utils/src/field/number.rs | 2 +- crates/bibtex-utils/src/field/text.rs | 2 +- crates/citeproc/src/entry.rs | 2 +- crates/citeproc/src/tests.rs | 2 +- crates/commands/src/build.rs | 2 +- crates/commands/src/change_env.rs | 2 +- crates/commands/src/clean.rs | 2 +- crates/commands/src/dep_graph.rs | 2 +- crates/commands/src/find_envs.rs | 6 +- crates/commands/src/fwd_search.rs | 2 +- crates/commands/src/lib.rs | 2 +- crates/completion/benches/bench_main.rs | 2 +- crates/completion/src/lib.rs | 2 +- crates/completion/src/providers/argument.rs | 4 +- crates/completion/src/providers/citations.rs | 2 +- crates/completion/src/providers/color.rs | 2 +- .../completion/src/providers/color_model.rs | 2 +- crates/completion/src/providers/command.rs | 4 +- crates/completion/src/providers/entry_type.rs | 2 +- .../completion/src/providers/environment.rs | 2 +- crates/completion/src/providers/field.rs | 4 +- crates/completion/src/providers/glossary.rs | 2 +- crates/completion/src/providers/import.rs | 2 +- crates/completion/src/providers/include.rs | 7 +- crates/completion/src/providers/label_def.rs | 4 +- crates/completion/src/providers/label_ref.rs | 6 +- .../completion/src/providers/tikz_library.rs | 2 +- crates/completion/src/tests.rs | 6 +- crates/completion/src/util/patterns.rs | 2 +- crates/definition/src/command.rs | 2 +- crates/diagnostics/src/build_log.rs | 2 +- crates/diagnostics/src/chktex.rs | 4 +- crates/diagnostics/src/citations.rs | 2 +- crates/diagnostics/src/grammar/bib.rs | 2 +- crates/diagnostics/src/grammar/tex.rs | 2 +- crates/diagnostics/src/labels.rs | 2 +- crates/diagnostics/src/manager.rs | 2 +- crates/diagnostics/src/tests.rs | 2 +- crates/folding/src/lib.rs | 2 +- crates/folding/src/tests.rs | 2 +- crates/hover/src/citation.rs | 2 +- crates/hover/src/lib.rs | 2 +- crates/hover/src/tests.rs | 2 +- crates/inlay-hints/src/label.rs | 2 +- crates/inlay-hints/src/lib.rs | 2 +- crates/inlay-hints/src/tests.rs | 2 +- crates/ipc/src/lib.rs | 2 +- crates/links/src/include.rs | 2 +- crates/links/src/tests.rs | 2 +- crates/parser/src/bibtex/tests.rs | 2 +- crates/parser/src/build_log/tests.rs | 2 +- crates/parser/src/config.rs | 2 +- crates/parser/src/latex.rs | 2 +- crates/parser/src/latex/lexer/commands.rs | 9 +- crates/parser/src/latex/tests.rs | 4 +- crates/references/src/command.rs | 2 +- crates/references/src/entry.rs | 2 +- crates/references/src/label.rs | 2 +- crates/rename/src/command.rs | 2 +- crates/rename/src/entry.rs | 4 +- crates/rename/src/label.rs | 2 +- crates/symbols/src/document.rs | 2 +- crates/symbols/src/workspace.rs | 2 +- crates/symbols/src/workspace/tests.rs | 2 +- crates/syntax/src/bibtex/cst.rs | 2 +- crates/syntax/src/latex/cst.rs | 2 +- crates/texlab/benches/bench_main.rs | 4 +- crates/texlab/src/client.rs | 8 +- crates/texlab/src/features/definition.rs | 2 +- crates/texlab/src/features/folding.rs | 2 +- .../src/features/formatting/latexindent.rs | 2 +- crates/texlab/src/features/symbols.rs | 2 +- 87 files changed, 228 insertions(+), 148 deletions(-) diff --git a/crates/base-db/src/data.rs b/crates/base-db/src/data.rs index 8dbb8cdf..82427c14 100644 --- a/crates/base-db/src/data.rs +++ b/crates/base-db/src/data.rs @@ -59,122 +59,170 @@ pub static BIBTEX_ENTRY_TYPES: &[BibtexEntryType<'static>] = &[ BibtexEntryType { name: "@article", category: BibtexEntryTypeCategory::Article, - documentation: Some("An article in a journal, magazine, newspaper, or other periodical which forms a \n self-contained unit with its own title. The title of the periodical is given in the \n journaltitle field. If the issue has its own title in addition to the main title of \n the periodical, it goes in the issuetitle field. Note that editor and related \n fields refer to the journal while translator and related fields refer to the article.\n\nRequired fields: `author`, `title`, `journaltitle`, `year/date`"), + documentation: Some( + "An article in a journal, magazine, newspaper, or other periodical which forms a \n self-contained unit with its own title. The title of the periodical is given in the \n journaltitle field. If the issue has its own title in addition to the main title of \n the periodical, it goes in the issuetitle field. Note that editor and related \n fields refer to the journal while translator and related fields refer to the article.\n\nRequired fields: `author`, `title`, `journaltitle`, `year/date`", + ), }, BibtexEntryType { name: "@book", category: BibtexEntryTypeCategory::Book, - documentation: Some("A single-volume book with one or more authors where the authors share credit for\n the work as a whole. This entry type also covers the function of the `@inbook` type\n of traditional BibTeX.\n\nRequired fields: `author`, `title`, `year/date`"), + documentation: Some( + "A single-volume book with one or more authors where the authors share credit for\n the work as a whole. This entry type also covers the function of the `@inbook` type\n of traditional BibTeX.\n\nRequired fields: `author`, `title`, `year/date`", + ), }, BibtexEntryType { name: "@mvbook", category: BibtexEntryTypeCategory::Book, - documentation: Some("A multi-volume `@book`. For backwards compatibility, multi-volume books are also\n supported by the entry type `@book`. However, it is advisable to make use of the\n dedicated entry type `@mvbook`.\n\nRequired fields: `author`, `title`, `year/date`"), + documentation: Some( + "A multi-volume `@book`. For backwards compatibility, multi-volume books are also\n supported by the entry type `@book`. However, it is advisable to make use of the\n dedicated entry type `@mvbook`.\n\nRequired fields: `author`, `title`, `year/date`", + ), }, BibtexEntryType { name: "@inbook", category: BibtexEntryTypeCategory::Part, - documentation: Some("A part of a book which forms a self-contained unit with its own title. Note that the\n profile of this entry type is different from standard BibTeX.\n\nRequired fields: `author`, `title`, `booktitle`, `year/date`"), + documentation: Some( + "A part of a book which forms a self-contained unit with its own title. Note that the\n profile of this entry type is different from standard BibTeX.\n\nRequired fields: `author`, `title`, `booktitle`, `year/date`", + ), }, BibtexEntryType { name: "@bookinbook", category: BibtexEntryTypeCategory::Part, - documentation: Some("This type is similar to `@inbook` but intended for works originally published as a\n stand-alone book. A typical example are books reprinted in the collected works of\n an author."), + documentation: Some( + "This type is similar to `@inbook` but intended for works originally published as a\n stand-alone book. A typical example are books reprinted in the collected works of\n an author.", + ), }, BibtexEntryType { name: "@suppbook", category: BibtexEntryTypeCategory::Book, - documentation: Some("Supplemental material in a `@book`. This type is closely related to the `@inbook`\n entry type. While `@inbook` is primarily intended for a part of a book with its own\n title (e. g., a single essay in a collection of essays by the same author), this type is\n provided for elements such as prefaces, introductions, forewords, afterwords, etc.\n which often have a generic title only. Style guides may require such items to be\n formatted differently from other `@inbook` items. The standard styles will treat this\n entry type as an alias for `@inbook`."), + documentation: Some( + "Supplemental material in a `@book`. This type is closely related to the `@inbook`\n entry type. While `@inbook` is primarily intended for a part of a book with its own\n title (e. g., a single essay in a collection of essays by the same author), this type is\n provided for elements such as prefaces, introductions, forewords, afterwords, etc.\n which often have a generic title only. Style guides may require such items to be\n formatted differently from other `@inbook` items. The standard styles will treat this\n entry type as an alias for `@inbook`.", + ), }, BibtexEntryType { name: "@booklet", category: BibtexEntryTypeCategory::Book, - documentation: Some("A book-like work without a formal publisher or sponsoring institution. Use the field\n howpublished to supply publishing information in free format, if applicable. The\n field type may be useful as well.\n\nRequired fields: `author/editor`, `title`, `year/date`"), + documentation: Some( + "A book-like work without a formal publisher or sponsoring institution. Use the field\n howpublished to supply publishing information in free format, if applicable. The\n field type may be useful as well.\n\nRequired fields: `author/editor`, `title`, `year/date`", + ), }, BibtexEntryType { name: "@collection", category: BibtexEntryTypeCategory::Collection, - documentation: Some("A single-volume collection with multiple, self-contained contributions by distinct\n authors which have their own title. The work as a whole has no overall author but it\n will usually have an editor.\n\nRequired fields: `editor`, `title`, `year/date`"), + documentation: Some( + "A single-volume collection with multiple, self-contained contributions by distinct\n authors which have their own title. The work as a whole has no overall author but it\n will usually have an editor.\n\nRequired fields: `editor`, `title`, `year/date`", + ), }, BibtexEntryType { name: "@mvcollection", category: BibtexEntryTypeCategory::Collection, - documentation: Some("A multi-volume `@collection`. For backwards compatibility, multi-volume collections\n are also supported by the entry type `@collection`. However, it is advisable\n to make use of the dedicated entry type `@mvcollection`.\n\nRequired fields: `editor`, `title`, `year/date`"), + documentation: Some( + "A multi-volume `@collection`. For backwards compatibility, multi-volume collections\n are also supported by the entry type `@collection`. However, it is advisable\n to make use of the dedicated entry type `@mvcollection`.\n\nRequired fields: `editor`, `title`, `year/date`", + ), }, BibtexEntryType { name: "@incollection", category: BibtexEntryTypeCategory::Part, - documentation: Some("A contribution to a collection which forms a self-contained unit with a distinct author\n and title. The `author` refers to the `title`, the `editor` to the `booktitle`, i. e.,\n the title of the collection.\n\nRequired fields: `author`, `title`, `booktitle`, `year/date`"), + documentation: Some( + "A contribution to a collection which forms a self-contained unit with a distinct author\n and title. The `author` refers to the `title`, the `editor` to the `booktitle`, i. e.,\n the title of the collection.\n\nRequired fields: `author`, `title`, `booktitle`, `year/date`", + ), }, BibtexEntryType { name: "@suppcollection", category: BibtexEntryTypeCategory::Collection, - documentation: Some("Supplemental material in a `@collection`. This type is similar to `@suppbook` but\n related to the `@collection` entry type. The standard styles will treat this entry\n type as an alias for `@incollection`."), + documentation: Some( + "Supplemental material in a `@collection`. This type is similar to `@suppbook` but\n related to the `@collection` entry type. The standard styles will treat this entry\n type as an alias for `@incollection`.", + ), }, BibtexEntryType { name: "@manual", category: BibtexEntryTypeCategory::Misc, - documentation: Some("Technical or other documentation, not necessarily in printed form. The author or\n editor is omissible.\n\nRequired fields: `author/editor`, `title`, `year/date`"), + documentation: Some( + "Technical or other documentation, not necessarily in printed form. The author or\n editor is omissible.\n\nRequired fields: `author/editor`, `title`, `year/date`", + ), }, BibtexEntryType { name: "@misc", category: BibtexEntryTypeCategory::Misc, - documentation: Some("A fallback type for entries which do not fit into any other category. Use the field\n howpublished to supply publishing information in free format, if applicable. The\n field type may be useful as well. author, editor, and year are omissible.\n\nRequired fields: `author/editor`, `title`, `year/date`"), + documentation: Some( + "A fallback type for entries which do not fit into any other category. Use the field\n howpublished to supply publishing information in free format, if applicable. The\n field type may be useful as well. author, editor, and year are omissible.\n\nRequired fields: `author/editor`, `title`, `year/date`", + ), }, BibtexEntryType { name: "@online", category: BibtexEntryTypeCategory::Misc, - documentation: Some("An online resource. `author`, `editor`, and `year` are omissible.\n This entry type is intended for sources such as web sites which are intrinsically\n online resources. Note that all entry types support the url field. For example, when\n adding an article from an online journal, it may be preferable to use the `@article`\n type and its url field.\n\nRequired fields: `author/editor`, `title`, `year/date`, `url`"), + documentation: Some( + "An online resource. `author`, `editor`, and `year` are omissible.\n This entry type is intended for sources such as web sites which are intrinsically\n online resources. Note that all entry types support the url field. For example, when\n adding an article from an online journal, it may be preferable to use the `@article`\n type and its url field.\n\nRequired fields: `author/editor`, `title`, `year/date`, `url`", + ), }, BibtexEntryType { name: "@patent", category: BibtexEntryTypeCategory::Misc, - documentation: Some("A patent or patent request. The number or record token is given in the number\n field. Use the type field to specify the type and the location field to indicate the\n scope of the patent, if different from the scope implied by the type. Note that the\n location field is treated as a key list with this entry type.\n\nRequired fields: `author`, `title`, `number`, `year/date`"), + documentation: Some( + "A patent or patent request. The number or record token is given in the number\n field. Use the type field to specify the type and the location field to indicate the\n scope of the patent, if different from the scope implied by the type. Note that the\n location field is treated as a key list with this entry type.\n\nRequired fields: `author`, `title`, `number`, `year/date`", + ), }, BibtexEntryType { name: "@periodical", category: BibtexEntryTypeCategory::Misc, - documentation: Some("An complete issue of a periodical, such as a special issue of a journal. The title of\n the periodical is given in the title field. If the issue has its own title in addition to\n the main title of the periodical, it goes in the issuetitle field. The editor is\n omissible.\n\nRequired fields: `editor`, `title`, `year/date`"), + documentation: Some( + "An complete issue of a periodical, such as a special issue of a journal. The title of\n the periodical is given in the title field. If the issue has its own title in addition to\n the main title of the periodical, it goes in the issuetitle field. The editor is\n omissible.\n\nRequired fields: `editor`, `title`, `year/date`", + ), }, BibtexEntryType { name: "@suppperiodical", category: BibtexEntryTypeCategory::Misc, - documentation: Some("Supplemental material in a `@periodical`. This type is similar to `@suppbook`\n but related to the `@periodical` entry type. The role of this entry type may be\n more obvious if you bear in mind that the `@article` type could also be called\n `@inperiodical`. This type may be useful when referring to items such as regular\n columns, obituaries, letters to the editor, etc. which only have a generic title. Style\n guides may require such items to be formatted differently from articles in the strict\n sense of the word. The standard styles will treat this entry type as an alias for\n `@article`."), + documentation: Some( + "Supplemental material in a `@periodical`. This type is similar to `@suppbook`\n but related to the `@periodical` entry type. The role of this entry type may be\n more obvious if you bear in mind that the `@article` type could also be called\n `@inperiodical`. This type may be useful when referring to items such as regular\n columns, obituaries, letters to the editor, etc. which only have a generic title. Style\n guides may require such items to be formatted differently from articles in the strict\n sense of the word. The standard styles will treat this entry type as an alias for\n `@article`.", + ), }, BibtexEntryType { name: "@proceedings", category: BibtexEntryTypeCategory::Book, - documentation: Some("A single-volume conference proceedings. This type is very similar to `@collection`.\n It supports an optional organization field which holds the sponsoring institution.\n The editor is omissible.\n\nRequired fields: `title`, `year/date`"), + documentation: Some( + "A single-volume conference proceedings. This type is very similar to `@collection`.\n It supports an optional organization field which holds the sponsoring institution.\n The editor is omissible.\n\nRequired fields: `title`, `year/date`", + ), }, BibtexEntryType { name: "@mvproceedings", category: BibtexEntryTypeCategory::Book, - documentation: Some("A multi-volume `@proceedings` entry. For backwards compatibility, multi-volume\n proceedings are also supported by the entry type `@proceedings`. However, it is\n advisable to make use of the dedicated entry type `@mvproceedings`\n\nRequired fields: `title`, `year/date`"), + documentation: Some( + "A multi-volume `@proceedings` entry. For backwards compatibility, multi-volume\n proceedings are also supported by the entry type `@proceedings`. However, it is\n advisable to make use of the dedicated entry type `@mvproceedings`\n\nRequired fields: `title`, `year/date`", + ), }, BibtexEntryType { name: "@inproceedings", category: BibtexEntryTypeCategory::Part, - documentation: Some("An article in a conference proceedings. This type is similar to `@incollection`. It\n supports an optional `organization` field.\n\nRequired fields: `author`, `title`, `booktitle`, `year/date`"), + documentation: Some( + "An article in a conference proceedings. This type is similar to `@incollection`. It\n supports an optional `organization` field.\n\nRequired fields: `author`, `title`, `booktitle`, `year/date`", + ), }, BibtexEntryType { name: "@reference", category: BibtexEntryTypeCategory::Collection, - documentation: Some("A single-volume work of reference such as an encyclopedia or a dictionary. This is a\n more specific variant of the generic `@collection` entry type. The standard styles\n will treat this entry type as an alias for `@collection`."), + documentation: Some( + "A single-volume work of reference such as an encyclopedia or a dictionary. This is a\n more specific variant of the generic `@collection` entry type. The standard styles\n will treat this entry type as an alias for `@collection`.", + ), }, BibtexEntryType { name: "@mvreference", category: BibtexEntryTypeCategory::Collection, - documentation: Some("A multi-volume `@reference` entry. The standard styles will treat this entry type\n as an alias for `@mvcollection`. For backwards compatibility, multi-volume references\n are also supported by the entry type `@reference`. However, it is advisable\n to make use of the dedicated entry type `@mvreference`."), + documentation: Some( + "A multi-volume `@reference` entry. The standard styles will treat this entry type\n as an alias for `@mvcollection`. For backwards compatibility, multi-volume references\n are also supported by the entry type `@reference`. However, it is advisable\n to make use of the dedicated entry type `@mvreference`.", + ), }, BibtexEntryType { name: "@inreference", category: BibtexEntryTypeCategory::Part, - documentation: Some("An article in a work of reference. This is a more specific variant of the generic\n `@incollection` entry type. The standard styles will treat this entry type as an\n alias for `@incollection`."), + documentation: Some( + "An article in a work of reference. This is a more specific variant of the generic\n `@incollection` entry type. The standard styles will treat this entry type as an\n alias for `@incollection`.", + ), }, BibtexEntryType { name: "@report", category: BibtexEntryTypeCategory::Misc, - documentation: Some("A technical report, research report, or white paper published by a university or some\n other institution. Use the `type` field to specify the type of report. The sponsoring\n institution goes in the `institution` field.\n\nRequired fields: `author`, `title`, `type`, `institution`, `year/date`"), + documentation: Some( + "A technical report, research report, or white paper published by a university or some\n other institution. Use the `type` field to specify the type of report. The sponsoring\n institution goes in the `institution` field.\n\nRequired fields: `author`, `title`, `type`, `institution`, `year/date`", + ), }, BibtexEntryType { name: "@set", @@ -184,17 +232,23 @@ pub static BIBTEX_ENTRY_TYPES: &[BibtexEntryType<'static>] = &[ BibtexEntryType { name: "@thesis", category: BibtexEntryTypeCategory::Thesis, - documentation: Some("A thesis written for an educational institution to satisfy the requirements for a degree.\n Use the `type` field to specify the type of thesis.\n\nRequired fields: `author`, `title`, `type`, `institution`, `year/date`"), + documentation: Some( + "A thesis written for an educational institution to satisfy the requirements for a degree.\n Use the `type` field to specify the type of thesis.\n\nRequired fields: `author`, `title`, `type`, `institution`, `year/date`", + ), }, BibtexEntryType { name: "@unpublished", category: BibtexEntryTypeCategory::Misc, - documentation: Some("A work with an author and a title which has not been formally published, such as\n a manuscript or the script of a talk. Use the fields `howpublished` and `note` to\n supply additional information in free format, if applicable.\n\nRequired fields: `author`, `title`, `year/date`"), + documentation: Some( + "A work with an author and a title which has not been formally published, such as\n a manuscript or the script of a talk. Use the fields `howpublished` and `note` to\n supply additional information in free format, if applicable.\n\nRequired fields: `author`, `title`, `year/date`", + ), }, BibtexEntryType { name: "@xdata", category: BibtexEntryTypeCategory::Misc, - documentation: Some("This entry type is special. `@xdata` entries hold data which may be inherited by other\n entries using the `xdata` field. Entries of this type only serve as data containers;\n they may not be cited or added to the bibliography."), + documentation: Some( + "This entry type is special. `@xdata` entries hold data which may be inherited by other\n entries using the `xdata` field. Entries of this type only serve as data containers;\n they may not be cited or added to the bibliography.", + ), }, BibtexEntryType { name: "@conference", @@ -209,17 +263,23 @@ pub static BIBTEX_ENTRY_TYPES: &[BibtexEntryType<'static>] = &[ BibtexEntryType { name: "@mastersthesis", category: BibtexEntryTypeCategory::Thesis, - documentation: Some("Similar to `@thesis` except that the `type` field is optional and defaults to the\n localised term ‘Master’s thesis’. You may still use the `type` field to override that."), + documentation: Some( + "Similar to `@thesis` except that the `type` field is optional and defaults to the\n localised term ‘Master’s thesis’. You may still use the `type` field to override that.", + ), }, BibtexEntryType { name: "@phdthesis", category: BibtexEntryTypeCategory::Thesis, - documentation: Some("Similar to `@thesis` except that the `type` field is optional and defaults to the\n localised term ‘PhD thesis’. You may still use the `type` field to override that."), + documentation: Some( + "Similar to `@thesis` except that the `type` field is optional and defaults to the\n localised term ‘PhD thesis’. You may still use the `type` field to override that.", + ), }, BibtexEntryType { name: "@techreport", category: BibtexEntryTypeCategory::Misc, - documentation: Some("Similar to `@report` except that the `type` field is optional and defaults to the\n localised term ‘technical report’. You may still use the `type` field to override that."), + documentation: Some( + "Similar to `@report` except that the `type` field is optional and defaults to the\n localised term ‘technical report’. You may still use the `type` field to override that.", + ), }, BibtexEntryType { name: "@www", @@ -229,22 +289,30 @@ pub static BIBTEX_ENTRY_TYPES: &[BibtexEntryType<'static>] = &[ BibtexEntryType { name: "@artwork", category: BibtexEntryTypeCategory::Misc, - documentation: Some("Works of the visual arts such as paintings, sculpture, and installations."), + documentation: Some( + "Works of the visual arts such as paintings, sculpture, and installations.", + ), }, BibtexEntryType { name: "@audio", category: BibtexEntryTypeCategory::Misc, - documentation: Some("Audio recordings, typically on audio cd, dvd, audio cassette, or similar media. See\n also `@music`."), + documentation: Some( + "Audio recordings, typically on audio cd, dvd, audio cassette, or similar media. See\n also `@music`.", + ), }, BibtexEntryType { name: "@bibnote", category: BibtexEntryTypeCategory::Misc, - documentation: Some("This special entry type is not meant to be used in the `bib` file like other types. It is\n provided for third-party packages like `notes2bib` which merge notes into the bibliography.\n The notes should go into the `note` field. Be advised that the `@bibnote`\n type is not related to the `defbibnote` command in any way. `defbibnote`\n is for adding comments at the beginning or the end of the bibliography, whereas\n the `@bibnote` type is meant for packages which render endnotes as bibliography\n entries."), + documentation: Some( + "This special entry type is not meant to be used in the `bib` file like other types. It is\n provided for third-party packages like `notes2bib` which merge notes into the bibliography.\n The notes should go into the `note` field. Be advised that the `@bibnote`\n type is not related to the `defbibnote` command in any way. `defbibnote`\n is for adding comments at the beginning or the end of the bibliography, whereas\n the `@bibnote` type is meant for packages which render endnotes as bibliography\n entries.", + ), }, BibtexEntryType { name: "@commentary", category: BibtexEntryTypeCategory::Misc, - documentation: Some("Commentaries which have a status different from regular books, such as legal commentaries."), + documentation: Some( + "Commentaries which have a status different from regular books, such as legal commentaries.", + ), }, BibtexEntryType { name: "@image", @@ -284,12 +352,16 @@ pub static BIBTEX_ENTRY_TYPES: &[BibtexEntryType<'static>] = &[ BibtexEntryType { name: "@performance", category: BibtexEntryTypeCategory::Misc, - documentation: Some("Musical and theatrical performances as well as other works of the performing arts.\n This type refers to the event as opposed to a recording, a score, or a printed play."), + documentation: Some( + "Musical and theatrical performances as well as other works of the performing arts.\n This type refers to the event as opposed to a recording, a score, or a printed play.", + ), }, BibtexEntryType { name: "@review", category: BibtexEntryTypeCategory::Misc, - documentation: Some("Reviews of some other work. This is a more specific variant of the `@article` type.\n The standard styles will treat this entry type as an alias for `@article`."), + documentation: Some( + "Reviews of some other work. This is a more specific variant of the `@article` type.\n The standard styles will treat this entry type as an alias for `@article`.", + ), }, BibtexEntryType { name: "@software", @@ -299,13 +371,17 @@ pub static BIBTEX_ENTRY_TYPES: &[BibtexEntryType<'static>] = &[ BibtexEntryType { name: "@standard", category: BibtexEntryTypeCategory::Misc, - documentation: Some("National and international standards issued by a standards body such as the International\n Organization for Standardization."), + documentation: Some( + "National and international standards issued by a standards body such as the International\n Organization for Standardization.", + ), }, BibtexEntryType { name: "@video", category: BibtexEntryTypeCategory::Misc, - documentation: Some("Audiovisual recordings, typically on dvd, vhs cassette, or similar media. See also\n `@movie`."), - } + documentation: Some( + "Audiovisual recordings, typically on dvd, vhs cassette, or similar media. See also\n `@movie`.", + ), + }, ]; pub static BIBTEX_FIELD_TYPES: &[BibtexFieldType<'static>] = &[ @@ -892,5 +968,5 @@ pub static BIBTEX_FIELD_TYPES: &[BibtexFieldType<'static>] = &[ BibtexFieldType { name: "school", documentation: "An alias for `institution`, provided for BibTeX compatibility. The `institution` field is used by traditional BibTeX for technical reports whereas the `school` field holds the institution associated with theses. The `biblatex` package employs the generic field name `institution` in both cases.", - } + }, ]; diff --git a/crates/base-db/src/deps.rs b/crates/base-db/src/deps.rs index f501d049..b9e70aac 100644 --- a/crates/base-db/src/deps.rs +++ b/crates/base-db/src/deps.rs @@ -6,6 +6,6 @@ mod root; pub use self::{ discover::{discover, watch}, graph::{DirectLinkData, Edge, EdgeData, Graph, HOME_DIR}, - project::{parents, Project}, + project::{Project, parents}, root::ProjectRoot, }; diff --git a/crates/base-db/src/deps/graph.rs b/crates/base-db/src/deps/graph.rs index 9cd7464f..b12fc8a5 100644 --- a/crates/base-db/src/deps/graph.rs +++ b/crates/base-db/src/deps/graph.rs @@ -7,7 +7,7 @@ use percent_encoding::percent_decode_str; use rustc_hash::FxHashSet; use url::Url; -use crate::{semantics, util, Document, Workspace}; +use crate::{Document, Workspace, semantics, util}; use super::ProjectRoot; diff --git a/crates/base-db/src/deps/root.rs b/crates/base-db/src/deps/root.rs index 31f335e8..e626e6c2 100644 --- a/crates/base-db/src/deps/root.rs +++ b/crates/base-db/src/deps/root.rs @@ -3,7 +3,7 @@ use std::sync::Arc; use distro::FileNameDB; use url::Url; -use crate::{util, DocumentData, Workspace}; +use crate::{DocumentData, Workspace, util}; use super::graph::HOME_DIR; diff --git a/crates/base-db/src/document.rs b/crates/base-db/src/document.rs index 0b81fa28..06cdd6b5 100644 --- a/crates/base-db/src/document.rs +++ b/crates/base-db/src/document.rs @@ -3,10 +3,10 @@ use std::path::PathBuf; use distro::Language; use line_index::{LineCol, LineIndex}; use rowan::TextRange; -use syntax::{bibtex, file_list::FileList, latex, latexmkrc::LatexmkrcData, BuildError}; +use syntax::{BuildError, bibtex, file_list::FileList, latex, latexmkrc::LatexmkrcData}; use url::Url; -use crate::{semantics, Config}; +use crate::{Config, semantics}; #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Hash)] pub enum Owner { diff --git a/crates/base-db/src/semantics/bib.rs b/crates/base-db/src/semantics/bib.rs index f8928065..d8ac1343 100644 --- a/crates/base-db/src/semantics/bib.rs +++ b/crates/base-db/src/semantics/bib.rs @@ -1,6 +1,6 @@ use bibtex_utils::field::text::TextFieldData; use itertools::Itertools; -use rowan::{ast::AstNode, TextRange}; +use rowan::{TextRange, ast::AstNode}; use rustc_hash::FxHashMap; use syntax::bibtex::{self, HasName, HasType, HasValue}; diff --git a/crates/base-db/src/semantics/tex.rs b/crates/base-db/src/semantics/tex.rs index 86e899bd..c064b75b 100644 --- a/crates/base-db/src/semantics/tex.rs +++ b/crates/base-db/src/semantics/tex.rs @@ -1,4 +1,4 @@ -use rowan::{ast::AstNode, TextRange}; +use rowan::{TextRange, ast::AstNode}; use rustc_hash::FxHashSet; use syntax::latex::{self, HasBrack, HasCurly}; use titlecase::titlecase; diff --git a/crates/base-db/src/util.rs b/crates/base-db/src/util.rs index 789eee9c..33313be4 100644 --- a/crates/base-db/src/util.rs +++ b/crates/base-db/src/util.rs @@ -5,6 +5,6 @@ mod regex_filter; pub use self::{ expand::expand_relative_path, - label::{render_label, FloatKind, RenderedLabel, RenderedObject}, + label::{FloatKind, RenderedLabel, RenderedObject, render_label}, regex_filter::filter_regex_patterns, }; diff --git a/crates/base-db/src/util/label.rs b/crates/base-db/src/util/label.rs index 4381edf3..c6d68d40 100644 --- a/crates/base-db/src/util/label.rs +++ b/crates/base-db/src/util/label.rs @@ -5,9 +5,9 @@ use rowan::TextRange; use self::RenderedObject::*; use crate::{ + Workspace, deps::Project, semantics::tex::{Label, LabelObject}, - Workspace, }; #[derive(Debug, PartialEq, Eq, Clone, Copy)] diff --git a/crates/base-db/src/util/queries.rs b/crates/base-db/src/util/queries.rs index 6ddf2010..693afc9f 100644 --- a/crates/base-db/src/util/queries.rs +++ b/crates/base-db/src/util/queries.rs @@ -4,9 +4,9 @@ use rustc_hash::FxHashMap; use url::Url; use crate::{ + Document, DocumentLocation, Workspace, deps::Project, semantics::{bib, tex}, - Document, DocumentLocation, Workspace, }; #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Hash)] diff --git a/crates/base-db/src/workspace.rs b/crates/base-db/src/workspace.rs index 0d9273e1..6257d6cf 100644 --- a/crates/base-db/src/workspace.rs +++ b/crates/base-db/src/workspace.rs @@ -9,7 +9,7 @@ use rowan::{TextLen, TextRange}; use rustc_hash::{FxHashMap, FxHashSet}; use url::Url; -use crate::{deps, Config, Document, DocumentParams, Owner}; +use crate::{Config, Document, DocumentParams, Owner, deps}; #[derive(Debug, Default)] pub struct Workspace { diff --git a/crates/bibfmt/src/lib.rs b/crates/bibfmt/src/lib.rs index 8840daa1..3bf5df6e 100644 --- a/crates/bibfmt/src/lib.rs +++ b/crates/bibfmt/src/lib.rs @@ -1,5 +1,5 @@ use line_index::LineIndex; -use rowan::{ast::AstNode, NodeOrToken}; +use rowan::{NodeOrToken, ast::AstNode}; use syntax::bibtex::{self, HasName, HasType, HasValue}; pub struct Options { diff --git a/crates/bibfmt/src/tests.rs b/crates/bibfmt/src/tests.rs index c081a15e..8705e3a9 100644 --- a/crates/bibfmt/src/tests.rs +++ b/crates/bibfmt/src/tests.rs @@ -1,4 +1,4 @@ -use expect_test::{expect, Expect}; +use expect_test::{Expect, expect}; use line_index::LineIndex; use syntax::bibtex; diff --git a/crates/bibtex-utils/src/field/author.rs b/crates/bibtex-utils/src/field/author.rs index 4be999ef..e3ab754c 100644 --- a/crates/bibtex-utils/src/field/author.rs +++ b/crates/bibtex-utils/src/field/author.rs @@ -4,7 +4,7 @@ use human_name::Name; use itertools::Itertools; use syntax::bibtex::Value; -use super::{text::TextFieldData, FieldParseCache}; +use super::{FieldParseCache, text::TextFieldData}; #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Hash)] pub enum AuthorField { diff --git a/crates/bibtex-utils/src/field/date.rs b/crates/bibtex-utils/src/field/date.rs index 4e3dfd19..6f2664d0 100644 --- a/crates/bibtex-utils/src/field/date.rs +++ b/crates/bibtex-utils/src/field/date.rs @@ -3,7 +3,7 @@ use std::{fmt, ops::Add, str::FromStr}; use chrono::{Datelike, Month, NaiveDate}; use syntax::bibtex::Value; -use super::{text::TextFieldData, FieldParseCache}; +use super::{FieldParseCache, text::TextFieldData}; #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Hash)] pub enum DateField { diff --git a/crates/bibtex-utils/src/field/number.rs b/crates/bibtex-utils/src/field/number.rs index 34240bcf..bdd0436e 100644 --- a/crates/bibtex-utils/src/field/number.rs +++ b/crates/bibtex-utils/src/field/number.rs @@ -2,7 +2,7 @@ use std::fmt; use syntax::bibtex::Value; -use super::{text::TextFieldData, FieldParseCache}; +use super::{FieldParseCache, text::TextFieldData}; #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Hash)] pub enum NumberField { diff --git a/crates/bibtex-utils/src/field/text.rs b/crates/bibtex-utils/src/field/text.rs index 89f7b569..facff169 100644 --- a/crates/bibtex-utils/src/field/text.rs +++ b/crates/bibtex-utils/src/field/text.rs @@ -1,4 +1,4 @@ -use rowan::{ast::AstNode, NodeOrToken}; +use rowan::{NodeOrToken, ast::AstNode}; use syntax::bibtex::{ Accent, Command, CurlyGroup, HasAccentName, HasCommandName, HasName, HasWord, Join, Literal, diff --git a/crates/citeproc/src/entry.rs b/crates/citeproc/src/entry.rs index b44c48b6..7ef86b8e 100644 --- a/crates/citeproc/src/entry.rs +++ b/crates/citeproc/src/entry.rs @@ -1,10 +1,10 @@ use base_db::semantics::bib::Semantics; use bibtex_utils::field::{ + FieldParseCache, author::{AuthorField, AuthorFieldData}, date::{DateField, DateFieldData}, number::{NumberField, NumberFieldData}, text::{TextField, TextFieldData}, - FieldParseCache, }; use rustc_hash::FxHashMap; use syntax::bibtex::{Entry, Field, HasName, HasType, HasValue, Value}; diff --git a/crates/citeproc/src/tests.rs b/crates/citeproc/src/tests.rs index b5838b52..d8790071 100644 --- a/crates/citeproc/src/tests.rs +++ b/crates/citeproc/src/tests.rs @@ -1,5 +1,5 @@ use base_db::semantics::bib::Semantics; -use expect_test::{expect, Expect}; +use expect_test::{Expect, expect}; use parser::parse_bibtex; use rowan::ast::AstNode; use syntax::bibtex; diff --git a/crates/commands/src/build.rs b/crates/commands/src/build.rs index 84665f9e..86ac9236 100644 --- a/crates/commands/src/build.rs +++ b/crates/commands/src/build.rs @@ -7,8 +7,8 @@ use std::{ use anyhow::Result; use base_db::{ - deps::{self, ProjectRoot}, Workspace, + deps::{self, ProjectRoot}, }; use bstr::io::BufReadExt; use crossbeam_channel::Sender; diff --git a/crates/commands/src/change_env.rs b/crates/commands/src/change_env.rs index 2b1c1afc..156c6ec1 100644 --- a/crates/commands/src/change_env.rs +++ b/crates/commands/src/change_env.rs @@ -1,5 +1,5 @@ use base_db::Document; -use rowan::{ast::AstNode, TextRange, TextSize}; +use rowan::{TextRange, TextSize, ast::AstNode}; use syntax::latex; #[derive(Debug)] diff --git a/crates/commands/src/clean.rs b/crates/commands/src/clean.rs index e429d1af..7169b2eb 100644 --- a/crates/commands/src/clean.rs +++ b/crates/commands/src/clean.rs @@ -1,7 +1,7 @@ use std::process::Stdio; use anyhow::Result; -use base_db::{deps::ProjectRoot, Document, Workspace}; +use base_db::{Document, Workspace, deps::ProjectRoot}; #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Hash)] pub enum CleanTarget { diff --git a/crates/commands/src/dep_graph.rs b/crates/commands/src/dep_graph.rs index aa3c50e7..0202ee39 100644 --- a/crates/commands/src/dep_graph.rs +++ b/crates/commands/src/dep_graph.rs @@ -1,7 +1,7 @@ use std::io::Write; use anyhow::Result; -use base_db::{deps::Edge, Workspace}; +use base_db::{Workspace, deps::Edge}; use itertools::Itertools; use rustc_hash::FxHashMap; diff --git a/crates/commands/src/find_envs.rs b/crates/commands/src/find_envs.rs index 1ea88657..f689e3dc 100644 --- a/crates/commands/src/find_envs.rs +++ b/crates/commands/src/find_envs.rs @@ -1,5 +1,5 @@ -use base_db::{semantics::Span, Document, DocumentData}; -use rowan::{ast::AstNode, TextRange, TextSize}; +use base_db::{Document, DocumentData, semantics::Span}; +use rowan::{TextRange, TextSize, ast::AstNode}; use syntax::latex; #[derive(Debug, PartialEq, Eq, Clone)] @@ -43,7 +43,7 @@ pub fn find_environments(document: &Document, offset: TextSize) -> Vec( diff --git a/crates/completion/src/providers/citations.rs b/crates/completion/src/providers/citations.rs index 631a8992..d4243c54 100644 --- a/crates/completion/src/providers/citations.rs +++ b/crates/completion/src/providers/citations.rs @@ -4,8 +4,8 @@ use rowan::ast::AstNode; use syntax::latex; use crate::{ - util::{find_curly_group_word_list, CompletionBuilder}, CitationData, CompletionItem, CompletionItemData, CompletionParams, + util::{CompletionBuilder, find_curly_group_word_list}, }; pub fn complete_citations<'a>( diff --git a/crates/completion/src/providers/color.rs b/crates/completion/src/providers/color.rs index 8be1b505..a7eebf0c 100644 --- a/crates/completion/src/providers/color.rs +++ b/crates/completion/src/providers/color.rs @@ -2,8 +2,8 @@ use rowan::ast::AstNode; use syntax::latex; use crate::{ - util::{find_curly_group_word, CompletionBuilder}, CompletionItem, CompletionItemData, CompletionParams, + util::{CompletionBuilder, find_curly_group_word}, }; pub fn complete_colors<'a>( diff --git a/crates/completion/src/providers/color_model.rs b/crates/completion/src/providers/color_model.rs index 80970b19..7d2a7f1a 100644 --- a/crates/completion/src/providers/color_model.rs +++ b/crates/completion/src/providers/color_model.rs @@ -3,8 +3,8 @@ use rowan::ast::AstNode; use syntax::latex; use crate::{ - util::{find_curly_group_word, find_curly_group_word_list, CompletionBuilder}, CompletionItem, CompletionItemData, CompletionParams, + util::{CompletionBuilder, find_curly_group_word, find_curly_group_word_list}, }; pub fn complete_color_models<'a>( diff --git a/crates/completion/src/providers/command.rs b/crates/completion/src/providers/command.rs index e3334757..67207cd3 100644 --- a/crates/completion/src/providers/command.rs +++ b/crates/completion/src/providers/command.rs @@ -1,11 +1,11 @@ -use base_db::{semantics::Span, DocumentData}; +use base_db::{DocumentData, semantics::Span}; use completion_data::included_packages; use rowan::{TextRange, TextSize}; use syntax::{bibtex, latex}; use crate::{ - util::{CompletionBuilder, ProviderContext}, CommandData, CompletionItem, CompletionItemData, CompletionParams, + util::{CompletionBuilder, ProviderContext}, }; static DELIMITERS: &[(&str, &str)] = &[("(", ")"), ("[", "]"), ("{", "\\}")]; diff --git a/crates/completion/src/providers/entry_type.rs b/crates/completion/src/providers/entry_type.rs index ce8bffa5..7f70dc4b 100644 --- a/crates/completion/src/providers/entry_type.rs +++ b/crates/completion/src/providers/entry_type.rs @@ -2,7 +2,7 @@ use base_db::semantics::Span; use syntax::bibtex; use crate::{ - util::CompletionBuilder, CompletionItem, CompletionItemData, CompletionParams, EntryTypeData, + CompletionItem, CompletionItemData, CompletionParams, EntryTypeData, util::CompletionBuilder, }; pub fn complete_entry_types<'a>( diff --git a/crates/completion/src/providers/environment.rs b/crates/completion/src/providers/environment.rs index 33cdef38..bb553f5e 100644 --- a/crates/completion/src/providers/environment.rs +++ b/crates/completion/src/providers/environment.rs @@ -4,8 +4,8 @@ use rowan::ast::AstNode; use syntax::latex; use crate::{ - util::{find_curly_group_word, CompletionBuilder, ProviderContext}, CompletionItem, CompletionItemData, CompletionParams, EnvironmentData, + util::{CompletionBuilder, ProviderContext, find_curly_group_word}, }; pub fn complete_environments<'a>( diff --git a/crates/completion/src/providers/field.rs b/crates/completion/src/providers/field.rs index 2dcd7fd2..66584477 100644 --- a/crates/completion/src/providers/field.rs +++ b/crates/completion/src/providers/field.rs @@ -1,9 +1,9 @@ use base_db::semantics::Span; -use rowan::{ast::AstNode, TokenAtOffset}; +use rowan::{TokenAtOffset, ast::AstNode}; use syntax::bibtex::{self, HasName}; use crate::{ - util::CompletionBuilder, CompletionItem, CompletionItemData, CompletionParams, FieldTypeData, + CompletionItem, CompletionItemData, CompletionParams, FieldTypeData, util::CompletionBuilder, }; pub fn complete_fields<'a>( diff --git a/crates/completion/src/providers/glossary.rs b/crates/completion/src/providers/glossary.rs index d01d62a5..08957e8e 100644 --- a/crates/completion/src/providers/glossary.rs +++ b/crates/completion/src/providers/glossary.rs @@ -3,8 +3,8 @@ use rowan::ast::AstNode; use syntax::latex; use crate::{ - util::{find_curly_group_word, CompletionBuilder, ProviderContext}, CompletionItem, CompletionItemData, CompletionParams, GlossaryEntryData, + util::{CompletionBuilder, ProviderContext, find_curly_group_word}, }; pub fn complete_acronyms<'a>( diff --git a/crates/completion/src/providers/import.rs b/crates/completion/src/providers/import.rs index c0f608f9..028d6ee0 100644 --- a/crates/completion/src/providers/import.rs +++ b/crates/completion/src/providers/import.rs @@ -3,8 +3,8 @@ use rustc_hash::FxHashSet; use syntax::latex; use crate::{ - util::{find_curly_group_word_list, CompletionBuilder}, CompletionItem, CompletionItemData, CompletionParams, + util::{CompletionBuilder, find_curly_group_word_list}, }; pub fn complete_imports<'a>( diff --git a/crates/completion/src/providers/include.rs b/crates/completion/src/providers/include.rs index f3deb3a1..d4acb956 100644 --- a/crates/completion/src/providers/include.rs +++ b/crates/completion/src/providers/include.rs @@ -4,15 +4,16 @@ use std::{ }; use base_db::{ + DocumentData, FeatureParams, deps::{self, ProjectRoot}, - util, DocumentData, FeatureParams, + util, }; -use rowan::{ast::AstNode, TextLen, TextRange}; +use rowan::{TextLen, TextRange, ast::AstNode}; use syntax::latex; use crate::{ - util::{find_curly_group_word_list, CompletionBuilder}, CompletionItem, CompletionItemData, CompletionParams, + util::{CompletionBuilder, find_curly_group_word_list}, }; pub fn complete_includes<'a>( diff --git a/crates/completion/src/providers/label_def.rs b/crates/completion/src/providers/label_def.rs index a8966ed6..6ffcaf33 100644 --- a/crates/completion/src/providers/label_def.rs +++ b/crates/completion/src/providers/label_def.rs @@ -1,7 +1,7 @@ use base_db::{ semantics::{ - tex::{Label, LabelKind}, Span, + tex::{Label, LabelKind}, }, util::queries::Object, }; @@ -10,8 +10,8 @@ use rustc_hash::FxHashSet; use syntax::latex; use crate::{ - util::{find_curly_group_word, CompletionBuilder}, CompletionParams, + util::{CompletionBuilder, find_curly_group_word}, }; pub fn complete_label_definitions<'a>( diff --git a/crates/completion/src/providers/label_ref.rs b/crates/completion/src/providers/label_ref.rs index c9dc9d6b..82efae50 100644 --- a/crates/completion/src/providers/label_ref.rs +++ b/crates/completion/src/providers/label_ref.rs @@ -1,14 +1,14 @@ use base_db::{ - semantics::{tex::LabelKind, Span}, - util::{render_label, RenderedObject}, DocumentData, + semantics::{Span, tex::LabelKind}, + util::{RenderedObject, render_label}, }; use rowan::ast::AstNode; use syntax::latex; use crate::{ - util::{find_curly_group_word, find_curly_group_word_list, CompletionBuilder}, CompletionItem, CompletionItemData, CompletionParams, + util::{CompletionBuilder, find_curly_group_word, find_curly_group_word_list}, }; fn trim_prefix<'a>(prefix: Option<&'a str>, text: &'a str) -> &'a str { diff --git a/crates/completion/src/providers/tikz_library.rs b/crates/completion/src/providers/tikz_library.rs index 4c3d7e89..c1656f2f 100644 --- a/crates/completion/src/providers/tikz_library.rs +++ b/crates/completion/src/providers/tikz_library.rs @@ -2,8 +2,8 @@ use rowan::ast::AstNode; use syntax::latex; use crate::{ - util::{find_curly_group_word_list, CompletionBuilder}, CompletionItem, CompletionItemData, CompletionParams, + util::{CompletionBuilder, find_curly_group_word_list}, }; pub fn complete_tikz_libraries<'a>( diff --git a/crates/completion/src/tests.rs b/crates/completion/src/tests.rs index 2d62ee31..7db7a3bd 100644 --- a/crates/completion/src/tests.rs +++ b/crates/completion/src/tests.rs @@ -1,5 +1,5 @@ use base_db::{Config, FeatureParams}; -use expect_test::{expect, Expect}; +use expect_test::{Expect, expect}; use parser::SyntaxConfig; use rowan::TextRange; @@ -2345,7 +2345,9 @@ fn test_custom_label_multiple_prefix_ref() { #[test] fn test_custom_glossary_reference_command() { let mut config = SyntaxConfig::default(); - config.glossary_reference_commands.insert("glsed".to_string()); + config + .glossary_reference_commands + .insert("glsed".to_string()); check_with_syntax_config( config, diff --git a/crates/completion/src/util/patterns.rs b/crates/completion/src/util/patterns.rs index efbd4f5a..4fdaef2d 100644 --- a/crates/completion/src/util/patterns.rs +++ b/crates/completion/src/util/patterns.rs @@ -1,5 +1,5 @@ use base_db::semantics::Span; -use rowan::{ast::AstNode, TextRange, TextSize}; +use rowan::{TextRange, TextSize, ast::AstNode}; use syntax::latex; use crate::CompletionParams; diff --git a/crates/definition/src/command.rs b/crates/definition/src/command.rs index 68edab24..a59c267d 100644 --- a/crates/definition/src/command.rs +++ b/crates/definition/src/command.rs @@ -1,5 +1,5 @@ use base_db::DocumentData; -use rowan::{ast::AstNode, TextRange}; +use rowan::{TextRange, ast::AstNode}; use syntax::latex; use crate::DefinitionContext; diff --git a/crates/diagnostics/src/build_log.rs b/crates/diagnostics/src/build_log.rs index f4180f39..4259a838 100644 --- a/crates/diagnostics/src/build_log.rs +++ b/crates/diagnostics/src/build_log.rs @@ -1,4 +1,4 @@ -use base_db::{deps, Document, Workspace}; +use base_db::{Document, Workspace, deps}; use line_index::LineCol; use multimap::MultiMap; use rowan::{TextLen, TextRange, TextSize}; diff --git a/crates/diagnostics/src/chktex.rs b/crates/diagnostics/src/chktex.rs index b7cd80d6..2790e594 100644 --- a/crates/diagnostics/src/chktex.rs +++ b/crates/diagnostics/src/chktex.rs @@ -5,15 +5,15 @@ use std::{ }; use base_db::{ - deps::{self, ProjectRoot}, Document, Workspace, + deps::{self, ProjectRoot}, }; use encoding_rs_io::DecodeReaderBytesBuilder; use line_index::LineCol; use once_cell::sync::Lazy; use regex::Regex; -use crate::{types::Diagnostic, ChktexError, ChktexSeverity}; +use crate::{ChktexError, ChktexSeverity, types::Diagnostic}; #[derive(Debug)] pub struct Command { diff --git a/crates/diagnostics/src/citations.rs b/crates/diagnostics/src/citations.rs index 97d6a610..f22f2e3a 100644 --- a/crates/diagnostics/src/citations.rs +++ b/crates/diagnostics/src/citations.rs @@ -1,8 +1,8 @@ use base_db::{ + Document, Workspace, deps::Project, semantics::{bib::Entry, tex::Citation}, util::queries::{self, Object}, - Document, Workspace, }; use rustc_hash::{FxHashMap, FxHashSet}; use url::Url; diff --git a/crates/diagnostics/src/grammar/bib.rs b/crates/diagnostics/src/grammar/bib.rs index 494cdbe4..163bb43a 100644 --- a/crates/diagnostics/src/grammar/bib.rs +++ b/crates/diagnostics/src/grammar/bib.rs @@ -1,6 +1,6 @@ use base_db::{BibDocumentData, Document}; use multimap::MultiMap; -use rowan::{ast::AstNode, TextRange}; +use rowan::{TextRange, ast::AstNode}; use syntax::bibtex::{self, HasDelims, HasEq, HasName, HasType, HasValue}; use url::Url; diff --git a/crates/diagnostics/src/grammar/tex.rs b/crates/diagnostics/src/grammar/tex.rs index a9565da3..01d43ff4 100644 --- a/crates/diagnostics/src/grammar/tex.rs +++ b/crates/diagnostics/src/grammar/tex.rs @@ -1,6 +1,6 @@ use base_db::{Config, Document, TexDocumentData}; use multimap::MultiMap; -use rowan::{ast::AstNode, NodeOrToken, TextRange}; +use rowan::{NodeOrToken, TextRange, ast::AstNode}; use syntax::latex; use url::Url; diff --git a/crates/diagnostics/src/labels.rs b/crates/diagnostics/src/labels.rs index 15b5aaad..68ae167e 100644 --- a/crates/diagnostics/src/labels.rs +++ b/crates/diagnostics/src/labels.rs @@ -1,7 +1,7 @@ use base_db::{ + DocumentData, Workspace, semantics::tex::{Label, LabelKind}, util::queries, - DocumentData, Workspace, }; use itertools::Itertools; use rustc_hash::{FxHashMap, FxHashSet}; diff --git a/crates/diagnostics/src/manager.rs b/crates/diagnostics/src/manager.rs index c8be0372..3f85e404 100644 --- a/crates/diagnostics/src/manager.rs +++ b/crates/diagnostics/src/manager.rs @@ -1,5 +1,5 @@ use base_db::{ - deps::Project, util::filter_regex_patterns, Document, DocumentData, Owner, Workspace, + Document, DocumentData, Owner, Workspace, deps::Project, util::filter_regex_patterns, }; use multimap::MultiMap; use rowan::TextRange; diff --git a/crates/diagnostics/src/tests.rs b/crates/diagnostics/src/tests.rs index ff5f53ec..6d86b1dd 100644 --- a/crates/diagnostics/src/tests.rs +++ b/crates/diagnostics/src/tests.rs @@ -1,4 +1,4 @@ -use expect_test::{expect, Expect}; +use expect_test::{Expect, expect}; use itertools::Itertools; fn check(input: &str, expect: Expect) { diff --git a/crates/folding/src/lib.rs b/crates/folding/src/lib.rs index c8702101..da3b87ba 100644 --- a/crates/folding/src/lib.rs +++ b/crates/folding/src/lib.rs @@ -1,5 +1,5 @@ use base_db::{Document, DocumentData}; -use rowan::{ast::AstNode, TextRange}; +use rowan::{TextRange, ast::AstNode}; use syntax::{ bibtex::{self, HasDelims, HasName}, latex, diff --git a/crates/folding/src/tests.rs b/crates/folding/src/tests.rs index 1e86b300..dec4519e 100644 --- a/crates/folding/src/tests.rs +++ b/crates/folding/src/tests.rs @@ -1,4 +1,4 @@ -use expect_test::{expect, Expect}; +use expect_test::{Expect, expect}; fn check(input: &str, expect: Expect) { let fixture = test_utils::fixture::Fixture::parse(input); diff --git a/crates/hover/src/citation.rs b/crates/hover/src/citation.rs index a39ea2e5..a00f888a 100644 --- a/crates/hover/src/citation.rs +++ b/crates/hover/src/citation.rs @@ -1,4 +1,4 @@ -use base_db::{util::queries, DocumentData}; +use base_db::{DocumentData, util::queries}; use rowan::ast::AstNode; use syntax::bibtex; diff --git a/crates/hover/src/lib.rs b/crates/hover/src/lib.rs index 22677a70..3d2044fc 100644 --- a/crates/hover/src/lib.rs +++ b/crates/hover/src/lib.rs @@ -7,9 +7,9 @@ mod package; mod string_ref; use base_db::{ + FeatureParams, data::{BibtexEntryType, BibtexFieldType}, util::RenderedLabel, - FeatureParams, }; use rowan::{TextRange, TextSize}; diff --git a/crates/hover/src/tests.rs b/crates/hover/src/tests.rs index 54b705d0..badd4011 100644 --- a/crates/hover/src/tests.rs +++ b/crates/hover/src/tests.rs @@ -1,4 +1,4 @@ -use expect_test::{expect, Expect}; +use expect_test::{Expect, expect}; use crate::HoverParams; diff --git a/crates/inlay-hints/src/label.rs b/crates/inlay-hints/src/label.rs index 6e29c806..3b194f9f 100644 --- a/crates/inlay-hints/src/label.rs +++ b/crates/inlay-hints/src/label.rs @@ -1,7 +1,7 @@ use base_db::{ + FeatureParams, semantics::tex::{Label, LabelKind}, util::{queries::Object, render_label}, - FeatureParams, }; use rustc_hash::FxHashMap; diff --git a/crates/inlay-hints/src/lib.rs b/crates/inlay-hints/src/lib.rs index 946f77c1..7108682b 100644 --- a/crates/inlay-hints/src/lib.rs +++ b/crates/inlay-hints/src/lib.rs @@ -1,6 +1,6 @@ mod label; -use base_db::{util::RenderedLabel, FeatureParams}; +use base_db::{FeatureParams, util::RenderedLabel}; use rowan::{TextRange, TextSize}; pub struct InlayHintParams<'a> { diff --git a/crates/inlay-hints/src/tests.rs b/crates/inlay-hints/src/tests.rs index cbffb84e..b810fadd 100644 --- a/crates/inlay-hints/src/tests.rs +++ b/crates/inlay-hints/src/tests.rs @@ -1,4 +1,4 @@ -use expect_test::{expect, Expect}; +use expect_test::{Expect, expect}; use rowan::{TextLen, TextRange}; fn check(input: &str, expect: Expect) { diff --git a/crates/ipc/src/lib.rs b/crates/ipc/src/lib.rs index 3d6bb403..b47e3aa5 100644 --- a/crates/ipc/src/lib.rs +++ b/crates/ipc/src/lib.rs @@ -3,7 +3,7 @@ use std::{ path::PathBuf, }; -use serde::{de::DeserializeOwned, Serialize}; +use serde::{Serialize, de::DeserializeOwned}; #[cfg(unix)] use std::os::unix::net::{UnixListener, UnixStream}; diff --git a/crates/links/src/include.rs b/crates/links/src/include.rs index 2a049d0b..077fb86f 100644 --- a/crates/links/src/include.rs +++ b/crates/links/src/include.rs @@ -1,6 +1,6 @@ use base_db::{ - deps::{self, EdgeData}, DocumentLocation, FeatureParams, + deps::{self, EdgeData}, }; pub(super) fn find_links<'a>( diff --git a/crates/links/src/tests.rs b/crates/links/src/tests.rs index 6837bc96..8145d2f9 100644 --- a/crates/links/src/tests.rs +++ b/crates/links/src/tests.rs @@ -1,4 +1,4 @@ -use expect_test::{expect, Expect}; +use expect_test::{Expect, expect}; fn check(input: &str, expect: Expect) { let fixture = test_utils::fixture::Fixture::parse(input); diff --git a/crates/parser/src/bibtex/tests.rs b/crates/parser/src/bibtex/tests.rs index f0872b4c..cca9c8ef 100644 --- a/crates/parser/src/bibtex/tests.rs +++ b/crates/parser/src/bibtex/tests.rs @@ -1,4 +1,4 @@ -use expect_test::{expect, Expect}; +use expect_test::{Expect, expect}; use crate::parse_bibtex; diff --git a/crates/parser/src/build_log/tests.rs b/crates/parser/src/build_log/tests.rs index 20d165e0..eeba7e77 100644 --- a/crates/parser/src/build_log/tests.rs +++ b/crates/parser/src/build_log/tests.rs @@ -1,4 +1,4 @@ -use expect_test::{expect, Expect}; +use expect_test::{Expect, expect}; use crate::parse_build_log; diff --git a/crates/parser/src/config.rs b/crates/parser/src/config.rs index 22fa1c77..a41c9407 100644 --- a/crates/parser/src/config.rs +++ b/crates/parser/src/config.rs @@ -243,7 +243,7 @@ static DEFAULT_GLOSSARY_REFERENCE_COMMANDS: &[&str] = &[ "GLSuserv", "glsuservi", "Glsuservi", - "GLSuservi" + "GLSuservi", ]; static DEFAULT_LABEL_DEFINITION_COMMANDS: &[&str] = &["label", "zlabel"]; diff --git a/crates/parser/src/latex.rs b/crates/parser/src/latex.rs index 75173652..58fc8388 100644 --- a/crates/parser/src/latex.rs +++ b/crates/parser/src/latex.rs @@ -6,8 +6,8 @@ use syntax::latex::SyntaxKind::{self, *}; use crate::SyntaxConfig; use self::lexer::{ - types::{CommandName, ParagraphLevel, SectionLevel, Token}, Lexer, + types::{CommandName, ParagraphLevel, SectionLevel, Token}, }; #[derive(Debug, Clone, Copy)] diff --git a/crates/parser/src/latex/lexer/commands.rs b/crates/parser/src/latex/lexer/commands.rs index 3fbe288a..2068fef9 100644 --- a/crates/parser/src/latex/lexer/commands.rs +++ b/crates/parser/src/latex/lexer/commands.rs @@ -26,9 +26,8 @@ pub fn classify(name: &str, config: &SyntaxConfig) -> CommandName { "includesvg" => CommandName::SvgInclude, "includeinkscape" => CommandName::InkscapeInclude, "verbatiminput" | "VerbatimInput" => CommandName::VerbatimInclude, - "import" | "subimport" | "inputfrom" | "subinputfrom" | "includefrom" | "subincludefrom" => { - CommandName::Import - } + "import" | "subimport" | "inputfrom" | "subinputfrom" | "includefrom" + | "subincludefrom" => CommandName::Import, "newlabel" => CommandName::LabelNumber, "def" | "gdef" | "edef" | "xdef" | "let" | "glet" => CommandName::OldCommandDefinition, "newcommand" @@ -91,7 +90,9 @@ pub fn classify(name: &str, config: &SyntaxConfig) -> CommandName { "numberline" => CommandName::TocNumberLine, _ if config.citation_commands.contains(name) => CommandName::Citation, - _ if config.glossary_reference_commands.contains(name) => CommandName::GlossaryEntryReference, + _ if config.glossary_reference_commands.contains(name) => { + CommandName::GlossaryEntryReference + } _ if config.label_definition_commands.contains(name) => CommandName::LabelDefinition, _ if config.label_reference_commands.contains(name) => CommandName::LabelReference, _ if config.label_reference_range_commands.contains(name) => { diff --git a/crates/parser/src/latex/tests.rs b/crates/parser/src/latex/tests.rs index 54a837dd..8abc9cad 100644 --- a/crates/parser/src/latex/tests.rs +++ b/crates/parser/src/latex/tests.rs @@ -1,6 +1,6 @@ -use expect_test::{expect, Expect}; +use expect_test::{Expect, expect}; -use crate::{parse_latex, SyntaxConfig}; +use crate::{SyntaxConfig, parse_latex}; fn check(input: &str, expect: Expect) { let root = syntax::latex::SyntaxNode::new_root(parse_latex(input, &SyntaxConfig::default())); diff --git a/crates/references/src/command.rs b/crates/references/src/command.rs index c0a62c47..5c67b994 100644 --- a/crates/references/src/command.rs +++ b/crates/references/src/command.rs @@ -1,4 +1,4 @@ -use base_db::{semantics::Span, DocumentLocation}; +use base_db::{DocumentLocation, semantics::Span}; use rowan::ast::AstNode; use rustc_hash::FxHashSet; use syntax::latex; diff --git a/crates/references/src/entry.rs b/crates/references/src/entry.rs index 722c96fe..b3a423ae 100644 --- a/crates/references/src/entry.rs +++ b/crates/references/src/entry.rs @@ -1,7 +1,7 @@ use base_db::{ + DocumentData, DocumentLocation, semantics::{bib, tex}, util::queries::{self, Object}, - DocumentData, DocumentLocation, }; use crate::{Reference, ReferenceContext, ReferenceKind}; diff --git a/crates/references/src/label.rs b/crates/references/src/label.rs index 20fc6e0d..8840e33d 100644 --- a/crates/references/src/label.rs +++ b/crates/references/src/label.rs @@ -1,7 +1,7 @@ use base_db::{ + DocumentLocation, semantics::tex, util::queries::{self, Object}, - DocumentLocation, }; use crate::{Reference, ReferenceContext, ReferenceKind}; diff --git a/crates/rename/src/command.rs b/crates/rename/src/command.rs index 037e09e4..5c3181f1 100644 --- a/crates/rename/src/command.rs +++ b/crates/rename/src/command.rs @@ -1,4 +1,4 @@ -use base_db::{semantics::Span, DocumentData}; +use base_db::{DocumentData, semantics::Span}; use rowan::{TextRange, TextSize}; use syntax::latex; diff --git a/crates/rename/src/entry.rs b/crates/rename/src/entry.rs index d35d9e9e..c2170fa4 100644 --- a/crates/rename/src/entry.rs +++ b/crates/rename/src/entry.rs @@ -1,7 +1,7 @@ use base_db::{ - semantics::{bib, tex, Span}, - util::queries::{self}, DocumentData, + semantics::{Span, bib, tex}, + util::queries::{self}, }; use crate::{RenameBuilder, RenameParams}; diff --git a/crates/rename/src/label.rs b/crates/rename/src/label.rs index 1d82f5e2..7a6f68d7 100644 --- a/crates/rename/src/label.rs +++ b/crates/rename/src/label.rs @@ -1,5 +1,5 @@ use base_db::{ - semantics::{tex, Span}, + semantics::{Span, tex}, util::queries::{self, Object}, }; diff --git a/crates/symbols/src/document.rs b/crates/symbols/src/document.rs index 611a7e03..fb129f68 100644 --- a/crates/symbols/src/document.rs +++ b/crates/symbols/src/document.rs @@ -1,7 +1,7 @@ mod bib; mod tex; -use base_db::{deps::Project, util, Document, DocumentData, SymbolConfig, Workspace}; +use base_db::{Document, DocumentData, SymbolConfig, Workspace, deps::Project, util}; use crate::Symbol; diff --git a/crates/symbols/src/workspace.rs b/crates/symbols/src/workspace.rs index a637bf8f..8109af0f 100644 --- a/crates/symbols/src/workspace.rs +++ b/crates/symbols/src/workspace.rs @@ -4,7 +4,7 @@ use std::cmp::Reverse; use base_db::Workspace; -use crate::{document_symbols, types::SymbolLocation, SymbolKind}; +use crate::{SymbolKind, document_symbols, types::SymbolLocation}; use self::sort::ProjectOrdering; diff --git a/crates/symbols/src/workspace/tests.rs b/crates/symbols/src/workspace/tests.rs index 55d624c3..2e70eb25 100644 --- a/crates/symbols/src/workspace/tests.rs +++ b/crates/symbols/src/workspace/tests.rs @@ -1,4 +1,4 @@ -use expect_test::{expect, Expect}; +use expect_test::{Expect, expect}; use test_utils::fixture::Fixture; use crate::workspace_symbols; diff --git a/crates/syntax/src/bibtex/cst.rs b/crates/syntax/src/bibtex/cst.rs index 52d49688..833374d2 100644 --- a/crates/syntax/src/bibtex/cst.rs +++ b/crates/syntax/src/bibtex/cst.rs @@ -1,4 +1,4 @@ -use rowan::{ast::AstNode, NodeOrToken}; +use rowan::{NodeOrToken, ast::AstNode}; use super::{ BibtexLanguage, diff --git a/crates/syntax/src/latex/cst.rs b/crates/syntax/src/latex/cst.rs index ca3e5a0b..8ca10718 100644 --- a/crates/syntax/src/latex/cst.rs +++ b/crates/syntax/src/latex/cst.rs @@ -1,5 +1,5 @@ use itertools::{EitherOrBoth, Itertools}; -use rowan::{ast::AstNode, TextRange}; +use rowan::{TextRange, ast::AstNode}; use super::{ LatexLanguage, diff --git a/crates/texlab/benches/bench_main.rs b/crates/texlab/benches/bench_main.rs index daeb5409..466cc319 100644 --- a/crates/texlab/benches/bench_main.rs +++ b/crates/texlab/benches/bench_main.rs @@ -1,5 +1,5 @@ -use criterion::{black_box, criterion_group, criterion_main, Criterion}; -use parser::{parse_latex, SyntaxConfig}; +use criterion::{Criterion, black_box, criterion_group, criterion_main}; +use parser::{SyntaxConfig, parse_latex}; const CODE: &str = include_str!("../../../texlab.tex"); diff --git a/crates/texlab/src/client.rs b/crates/texlab/src/client.rs index b79f8764..bcdaf690 100644 --- a/crates/texlab/src/client.rs +++ b/crates/texlab/src/client.rs @@ -1,15 +1,15 @@ use std::sync::{ - atomic::{AtomicI32, Ordering}, Arc, + atomic::{AtomicI32, Ordering}, }; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use crossbeam_channel::Sender; use lsp_server::{ErrorCode, Message, Request, RequestId, Response}; -use lsp_types::{notification::ShowMessage, MessageType, ShowMessageParams}; +use lsp_types::{MessageType, ShowMessageParams, notification::ShowMessage}; use parking_lot::Mutex; use rustc_hash::FxHashMap; -use serde::{de::DeserializeOwned, Serialize}; +use serde::{Serialize, de::DeserializeOwned}; use crate::server::options::Options; diff --git a/crates/texlab/src/features/definition.rs b/crates/texlab/src/features/definition.rs index 38883d26..2f56584c 100644 --- a/crates/texlab/src/features/definition.rs +++ b/crates/texlab/src/features/definition.rs @@ -1,6 +1,6 @@ use base_db::{DocumentLocation, Workspace}; -use crate::util::{from_proto, to_proto, ClientFlags}; +use crate::util::{ClientFlags, from_proto, to_proto}; pub fn goto_definition( workspace: &Workspace, diff --git a/crates/texlab/src/features/folding.rs b/crates/texlab/src/features/folding.rs index 36690212..0d72bf83 100644 --- a/crates/texlab/src/features/folding.rs +++ b/crates/texlab/src/features/folding.rs @@ -1,6 +1,6 @@ use base_db::Workspace; -use crate::util::{from_proto, to_proto, ClientFlags}; +use crate::util::{ClientFlags, from_proto, to_proto}; pub fn find_all( workspace: &Workspace, diff --git a/crates/texlab/src/features/formatting/latexindent.rs b/crates/texlab/src/features/formatting/latexindent.rs index eac87060..109ecd24 100644 --- a/crates/texlab/src/features/formatting/latexindent.rs +++ b/crates/texlab/src/features/formatting/latexindent.rs @@ -3,7 +3,7 @@ use std::{ process::{Command, Stdio}, }; -use base_db::{deps::ProjectRoot, Document, LatexIndentConfig, Workspace}; +use base_db::{Document, LatexIndentConfig, Workspace, deps::ProjectRoot}; use distro::Language; use rowan::TextLen; use tempfile::tempdir; diff --git a/crates/texlab/src/features/symbols.rs b/crates/texlab/src/features/symbols.rs index 8e29eb9a..6208abb9 100644 --- a/crates/texlab/src/features/symbols.rs +++ b/crates/texlab/src/features/symbols.rs @@ -1,6 +1,6 @@ use base_db::Workspace; -use crate::util::{from_proto, to_proto, ClientFlags}; +use crate::util::{ClientFlags, from_proto, to_proto}; pub fn document_symbols( workspace: &Workspace,