about summary refs log tree commit diff
path: root/src/librustdoc/html/highlight
AgeCommit message (Collapse)AuthorLines
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/+24
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/+63
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.