about summary refs log tree commit diff
path: root/src/librustdoc/html/highlight/tests.rs
AgeCommit message (Collapse)AuthorLines
2023-08-16Improve code readability by moving fmt args directly into the stringGuillaume Gomez-1/+1
2022-10-31rustdoc: rename syntax highlighting CSS class `attribute` to `attr`Michael Howell-1/+1
Link classes use the abbreviation `attr`, so why shouldn't syntax highlighting?
2022-08-20Extend decoration test to detect regressionsGuillaume Gomez-2/+5
2022-08-09rustdoc: simplify highlight.rsJacob Hoffman-Andrews-6/+5
Split render_with_highlighting, which took many optional parameters, into three functions for specific purposes, which each take a smaller number of mostly required parameters. Remove some plumbing to pass through an "edition" parameter, which was used solely to avoid highlighting some 2021 Edition keywords in non-2021 code.
2021-10-08Change handling of spans in scrape examples, add test for highlight decorationsWill Crichton-1/+16
2021-10-06Change serialized format to use DefPathHash instead of custom StringWill Crichton-1/+1
Move test to rustdoc-ui Fix test writing to wrong directory Formatting Fix test Add FIXME Remove raw multiline strings
2021-10-06Move highlighting logic from JS to RustWill Crichton-3/+3
Continue migrating JS functionality Cleanup Fix compile error Clean up the diff Set toggle font to sans-serif
2021-08-06Add test for union keyword highlightingGuillaume Gomez-0/+10
2021-08-05Fix invalid generation of HTML in highlightGuillaume Gomez-0/+14
2021-08-05Move extra arguments for highlight URL generation into a new ContextInfo ↵Guillaume Gomez-2/+2
struct for better readability
2021-08-05Update rustdoc testsGuillaume Gomez-2/+2
2021-07-08Rework SESSION_GLOBALS API to prevent overwriting itGuillaume Gomez-3/+3
2021-05-05Update highlight testsGuillaume Gomez-11/+16
2021-01-30rustdoc tweakingbors-4/+5
* Reuse memory * simplify `next_def_id`, avoid multiple hashing and unnecessary lookups * remove `all_fake_def_ids`, use the global map instead (probably not a good step toward parallelization, though...) * convert `add_deref_target` to iterative implementation * use `ArrayVec` where we know the max number of elements * minor touchups here and there * avoid building temporary vectors that get appended to other vectors At most places I may or may not be doing the compiler's job is this PR.
2020-12-24rustdoc: Highlight edition-specific keywords correctly in code blocks, ↵ThePuzzlemaker-2/+3
accounting for code block edition modifiers This is a squash of these commits: - Highlight edition-specific keywords correctly in code blocks, accounting for code block edition modifiers - Fix unit tests - Revert changes to rustc_span::symbol to prepare for merge of #80272 - Use new Symbol::is_reserved API from #80272 - Remove unused import added by accident when merging
2020-11-15Add test to ensure that no DOS backline (\r\n) doesn't create extra backline ↵Guillaume Gomez-11/+21
in source rendering
2020-08-31Update expect-test to 1.0Aleksey Kladov-1/+1
The only change is that `expect_file` now uses path relative to the current file (same as `include!`). Before, it used paths relative to the workspace root, which makes no sense.
2020-08-27Add expect test for rustdoc html highlightingAleksey Kladov-61/+20
It's a unit-test in a sense that it only checks syntax highlighting. However, the resulting HTML is written to disk and can be easily inspected in the browser. To update the test, run with `--bless` argument or set `UPDATE_EXPEC=1` env var
2020-08-27Remove dependency on StringReader from rustdoc highlighterAleksey Kladov-20/+4
rustc_lexer is the lossless lexer, which is a better fit for approximate syntax highlighting. As a side-effect, we can now syntax-highlight even broken code.
2020-08-08Eliminate the `SessionGlobals` from `librustc_ast`.Nicholas Nethercote-1/+1
By moving `{known,used}_attrs` from `SessionGlobals` to `Session`. This means they are accessed via the `Session`, rather than via TLS. A few `Attr` methods and `librustc_ast` functions are now methods of `Session`. All of this required passing a `Session` to lots of functions that didn't already have one. Some of these functions also had arguments removed, because those arguments could be accessed directly via the `Session` argument. `contains_feature_attr()` was dead, and is removed. Some functions were moved from `librustc_ast` elsewhere because they now need to access `Session`, which isn't available in that crate. - `entry_point_type()` --> `librustc_builtin_macros` - `global_allocator_spans()` --> `librustc_metadata` - `is_proc_macro_attr()` --> `Session`
2020-07-14rustdoc: glue tokens before highlightingAndy Russell-0/+82
Fixes #72684. This commit also modifies the signature of `Classifier::new` to avoid copying the source being highlighted.