8560: Escape characters in doc comments in macros correctly r=jonas-schievink a=ChayimFriedman2
Previously they were escaped twice, both by `.escape_default()` and the debug view of strings (`{:?}`). This leads to things like newlines or tabs in documentation comments being `\\n`, but we unescape literals only once, ending up with `\n`.
This was hard to spot because CMark unescaped them (at least for `'` and `"`), but it did not do so in code blocks.
This also was the root cause of #7781. This issue was solved by using `.escape_debug()` instead of `.escape_default()`, but the real issue remained.
We can bring the `.escape_default()` back by now, however I didn't do it because it is probably slower than `.escape_debug()` (more work to do), and also in order to change the code the least.
Example (the keyword and primitive docs are `include!()`d at https://doc.rust-lang.org/src/std/lib.rs.html#570-578, and thus originate from macro):
Before:
![image](https://user-images.githubusercontent.com/24700207/115130096-40544300-9ff5-11eb-847b-969e7034e8a4.png)
After:
![image](https://user-images.githubusercontent.com/24700207/115130143-9cb76280-9ff5-11eb-9281-323746089440.png)
Co-authored-by: Chayim Refael Friedman <chayimfr@gmail.com>
Previously they were escaped twice, both by `.escape_default()` and the debug view of strings (`{:?}`). This leads to things like newlines or tabs in documentation comments being `\\n`, but we unescape literals only once, ending up with `\n`.
This was hard to spot because CMark unescaped them (at least for `'` and `"`), but it did not do so in code blocks.
This also was the root cause of #7781. This issue was solved by using `.escape_debug()` instead of `.escape_default()`, but the real issue remained.
We can bring the `.escape_default()` back by now, however I didn't do it because it is probably slower than `.escape_debug()` (more work to do), and also in order to change the code the least.
8559: Add some more error messages to fixture failure cases r=Veykril a=Veykril
Follow up for #8557
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
8557: Add an error message to fixture errors r=Veykril a=yoshuawuyts
Improve the error message when folks forget to add an `$0` in one of the fixtures. Figuring this one out was 20 minutes down the drain for me, so figured I might as well make sure nobody else has to go through the same thing in the future. Thanks!
Co-authored-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
8551: nail rowan version down r=lnicola a=drahnr
The different pre versions include breaking changes, which cause build failures for the users.
Co-authored-by: Bernhard Schuster <bernhard@ahoi.io>
8549: Fix `TestDB::module_at_position` with submodules r=jonas-schievink a=jonas-schievink
Found while looking into https://github.com/rust-analyzer/rust-analyzer/issues/8519
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
8510: Move cursor position when using item movers r=jonas-schievink a=jonas-schievink
This updates the cursor position when moving items around to stay in the same location within the moved node.
I changed the `moveItem` response to `SnippetTextEdit[]`, since that made more sense to me (the file was ignored by the client anyways, since the edits always apply to the current document). It also matches `onEnter`, which seems logical to me, but please let me know if this doesn't make sense.
There's still a bug in the client-side snippet code that will cause the cursor position to be slightly off when moving parameters in the same line (presumably we don't track the column correctly after deleting `$0`). Not really sure how to fix that immediately, but this PR should already be an improvement despite that bug.
8533: Fix typo in style guide r=jonas-schievink a=jonas-schievink
Fixes bold text rendering
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
8526: fix: Do not show flyimports in trait or impl declarations r=SomeoneToIgnore a=SomeoneToIgnore
Part of https://github.com/rust-analyzer/rust-analyzer/issues/8518
Removes autoimport suggestions for the case:
> inside trait definitions / impls (trait Trait {$0} / impl Foo {$0}), nothing except the fn, type and const keywords (and the full item completions for trait impls) should appear (currently many types and autoimport suggestions)
Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
8514: Add more profiling spans into type inference r=matklad a=SomeoneToIgnore
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/8503
I've added a minimal set of spans to remove `???` and showcase the underlying issue:
<img width="1552" alt="image" src="https://user-images.githubusercontent.com/2690773/114722983-f2181900-9d42-11eb-821d-9e93ded5f81f.png">
`db.trait_solve` reliably produces the same timings for the same input in the same place for me, despite supposedly being cached by Salsa.
In my perception, this is a bit odd, so I've decided to stop at this point and discuss it with people with better knowledge on the topic.
Co-authored-by: Kirill Bulatov <mail4score@gmail.com>