-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Documentation: write_fmt is unclear #15830
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The docs are not up to date. I think this should work for you:
*Updated to not ignore the return value. |
That works, thanks! Shall I leave the issue open as a reminder to update the docs? |
Errors from the formatter should be propagated upstream instead of being ignored.
|
@pornel yes, please leave it open, i will tag it 'docs' |
I just opened a PR to remove that faulty paragraph. |
The docs are up-to-date, it's just |
…on-extension-to-call-rust-analyzer, r=davidbarsky code: expose workspaces to other extensions; remove `addProject` command This (mostly red) PR does three things: - Exposes two methods to companion extensions (`setWorkspaces` and `notifyRustAnalyzer`). - `setWorkspaces` is needed to update `linkedProjects` _without_ writing workspace/global configuration. - `notifyRustAnalyzer` to get the server to pull the new configuration. - Makes `Ctx` implement `RustAnalyzerExtensionApi` to prevent accidental regressions. - Remove `rust-analyzer.addProject`, as that will live in a buck2 companion extension. No need for that to be in rust-analyzer! I can see the utility of combining `notifyRustAnalyzer` and `setWorkspaces` into a single method (`updateWorkspacesAndNotify()`?), but I don't feel strongly about this. My feeling is that this API could be easily changed in the future.
I'm trying to upgrade code that worked in 0.10/0.11-pre (implementation of
fmt::Show
):I've found a
write_fmt
method that sounds like what I need, but it's undocumented:http://doc.rust-lang.org/core/fmt/struct.Formatter.html#method.write_fmt
Linked Arguments documentation suggests usnig
format_args!()
:http://doc.rust-lang.org/core/fmt/struct.Arguments.html
but the usage I'd expect:
fails with "format argument must be a string literal.", which left me lost. If really supports only literals as arguments then it's totally useless, but if I'm doing something wrong, then the docs/compiler don't help me figure this out.
The text was updated successfully, but these errors were encountered: