Commit graph

746 commits

Author SHA1 Message Date
Terry Sun 04e1d72354 Fix title of User Manual page
Asciidoc uses the first line of a doc as the title, so you can't put
comments before the heading.
2021-09-22 21:39:21 -07:00
Wilfred Hughes e543fe855b
Fix typescript syntax errors
Remove unwanted `:` and fix the naming of the boolean type.
2021-09-15 17:53:36 -07:00
Laurențiu Nicola b66e506cc2 Don't spam the manual with warnings 2021-09-13 10:56:14 +03:00
Dezhi Wu eb8508ae80
docs: fix unknown configuration setting 2021-09-06 19:57:17 +08:00
Dorian Peake a2bc57c28f
Update manual.adoc 2021-09-05 16:59:38 +01:00
Dorian Peake aae1e97590
Add rust-project.json + cargo check info to docs
Add information about how to configure compilation errors/checks when using rust-project.json.
2021-09-05 16:32:05 +01:00
Aleksey Kladov cff88a819f no need to reed the docs, feel free to charge ahead!
But knowing where the docs are is useful ;)
2021-09-04 20:34:17 +03:00
Aleksey Kladov b535804e1b docs: make dev docs more discoverable
I *think* people might try to debug ra by using only the troubleshooting
section. Might make sense to point them to dev docs then!
2021-09-04 20:17:28 +03:00
Aleksey Kladov 2d2c4e7c22 internal: deduplicate 2021-09-04 16:56:23 +03:00
Dezhi Wu b8ef2acadb docs(logging): use tracing for logging 2021-09-03 17:07:38 +08:00
Aleksey Kladov 9e0203bd69 internal: make scheduling control flow more obvious
There should be only one place where we need to check if we want to
start background activities.
2021-08-30 19:39:08 +03:00
bors[bot] 49c02b93b3
Merge #9993
9993: feat: join lines merges assignments r=matklad a=unexge

Closes https://github.com/rust-analyzer/rust-analyzer/issues/9967.
![Peek 2021-08-22 21-46](https://user-images.githubusercontent.com/16212576/130366571-3ebb1753-f8d5-4884-be8f-222cda71a2a7.gif)


Co-authored-by: unexge <unexge@gmail.com>
2021-08-24 12:14:25 +00:00
Aleksey Kladov 1660820e51 internal: use idiomatic form of assertions
Ideally, we should just return an InvalidParameter dialog here, but that
shows error message to the end user, and we generally avoid that
2021-08-24 14:09:34 +03:00
unexge 3a9ba0e506 feat: join lines merges assignments 2021-08-22 21:28:39 +03:00
Ole Christian Eidheim 06da68303d
Update manual.adoc: added juCi++ section 2021-08-14 12:47:58 +02:00
Aleksey Kladov 629c68e80d internal: document that ascription is preferred to a turbo fish 2021-08-11 14:16:15 +03:00
Aleksey Kladov fc48def916 minor: reword a bit 2021-08-10 14:56:55 +03:00
Aleksey Kladov 967c088e01 internal: document codebase stance on using functional combinators 2021-08-10 14:34:05 +03:00
Aleksey Kladov 2f9273633b feat: filter out duplicate macro completions
closes #9303
2021-08-03 17:36:06 +03:00
bors[bot] 314e2e75c0
Merge #9752
9752: feature: Declare proc-macro dependent crates in `rust-project.json` r=matklad a=tobywf

This adds the `is_proc_macro` flag in `rust-project.json`. By default, this is `false` and not required, so existing projects won't break/have the same behavior as before this change. If the flag is true, a dependency to the `proc_macro` sysroot crate is added (if it exists), so that rust-analyzer can resolve those imports.

This fixes #9726 .

I've also added some tests in the second commit. The first is a smoke test for a basic, minimal `rust-project.json` file. The second is a more targeted test for the flag. Both tests depend on the fake sysroot (a bunch of directories in the correct layout with empty `lib.rs` files), and also on `env!("CARGO_MANIFEST_DIR")` being an absolute path. I'm not sure if the later assumption is valid on all platforms. I wanted to at least try and add tests, but I'm happy to rework them or remove them if you don't think that's the way to go.

(You can license/relicense my contribution in any way you wish without contacting me.)

Co-authored-by: Toby Fleming <sourcecode@tobywf.com>
2021-08-02 13:14:22 +00:00
Aleksey Kladov 12d7f5b56e internal: explain that we don't ref in style.md 2021-08-02 15:59:28 +03:00
Toby Fleming cb13e4a2ca
Rust project supports proc-macro dependent crates 2021-08-01 14:43:10 -07:00
Gunnlaugur Thor Briem 4930e5d74d
Link “DST” to its definition
Being new to Rust I wasn't familiar with this acronym and found it hard to guess (the context of syntax trees biased me to reading it as a D-something Syntax Tree and trying to guess what the D was), hard to google (in retrospect googling "rust dst" does the job, but I thought it was an abstract structure thing, not Rust-specific), and hard to Github-search, because `dst` is commonly short for “destination” in code.

Alternatively `<abbr title="dynamically sized type">DST</abbr>` would be about as helpful.
2021-08-01 14:37:16 +00:00
Aleksey Kladov 2229cfcf48 internal: cleanup lsp-extensions docs 2021-07-30 19:50:39 +03:00
Aleksey Kladov be84f85c1d feat: gate custom clint-side commands behind capabilities
Some features of rust-analyzer requires support for custom commands on
the client side. Specifically, hover & code lens need this.

Stock LSP doesn't have a way for the server to know which client-side
commands are available. For that reason, we historically were just
sending the commands, not worrying whether the client supports then or
not.

That's not really great though, so in this PR we add infrastructure for
the client to explicitly opt-into custom commands, via `extensions`
field of the ClientCapabilities.

To preserve backwards compatability, if the client doesn't set the
field, we assume that it does support all custom commands. In the
future, we'll start treating that case as if the client doesn't support
commands.

So, if you maintain a rust-analyzer client and implement
`rust-analyzer/runSingle` and such, please also advertise this via a
capability.
2021-07-30 19:16:33 +03:00
Aleksey Kladov 68836c0dbe minor: drop impl-specific stuff from lsp docs
The lc. prefix is a copy-paste from our typescript code, it doesn't make
sense in the impl-agnostic docs.
2021-07-30 16:37:41 +03:00
Alexander Gonzalez 41943f2328 refactor: Apply PR suggestions 2021-07-27 18:31:21 -04:00
Alexander Gonzalez c6fab1993a test: Update lsp_ext.rs hash 2021-07-27 18:31:21 -04:00
Alexander Gonzalez ca85185bc6 docs: Update the lsp-extensions.md with the Hover Range capability 2021-07-27 18:31:21 -04:00
bors[bot] 2c638a467e
Merge #9709
9709: fix: add capability for "open cargo.toml" lsp extension r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-07-27 16:41:02 +00:00
Aleksey Kladov 7d6c4142b2 fix: add capability for "open cargo.toml" lsp extension 2021-07-27 19:40:19 +03:00
Alexander Gonzalez c865b56744 docs: Fix several typos and grammar mistakes 2021-07-26 18:15:40 -04:00
bors[bot] bf8a55a2df
Merge #9692
9692: Use same cancelled spelling in doc and code. r=matklad a=mattiasgronlund

Right thing might be to update the spelling in the code to
follow American instead of English spelling, that is
using only canceled. But they should at least be aligned.

Co-authored-by: Mattias Grönlund <mattias@gronlund.se>
2021-07-26 10:29:24 +00:00
Jonas Platte c0107d2ea6
Fix some grammar / spelling mistakes 2021-07-26 10:12:41 +02:00
Mattias Grönlund 9e99a9b860 Use same cancelled spelling in doc and code.
Right thing might be to update the spelling in the code to
follow American instead of English spelling, that is
using only canceled. But they should at least be aligned.
2021-07-25 23:18:59 +02:00
Kevin DeLorey 7797c59f18 Updated docs. 2021-07-22 19:35:47 -06:00
bors[bot] 2fbecccc71
Merge #9634
9634: minor update to excludeDirs doc r=lnicola a=dae

I saw reference to globs in #7755, but it doesn't look like they're
actually supported, and I had to dig through the source to discover
that the folders are relative to the workspace root. Further digging
was required to get VS Code from hanging for long periods trying to
watch giant Bazel folders that had already been excluded from Rust
Analyzer. Hopefully this tweak will save others the confusion :-)

Co-authored-by: Damien Elmes <gpg@ankiweb.net>
Co-authored-by: Damien Elmes <dae@users.noreply.github.com>
2021-07-22 11:43:05 +00:00
Damien Elmes d22b830ed1 mention files.watcherExclude
Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
2021-07-22 21:25:23 +10:00
Jesse Jackson a9f4527fd3
docs: fix typo
tree -> three
2021-07-21 04:06:19 -05:00
Aleksey Kladov efa4a36a50 docs: publish Explaining Rust Analyzer series 2021-07-19 23:41:15 +03:00
Aleksey Kladov 1dc337645a minor: typo 2021-07-19 19:18:39 +03:00
Aleksey Kladov 6a0f7f0852 internal: explain why we avoid serializing everything 2021-07-19 17:47:56 +03:00
Damien Elmes 106ea7ad85 minor update to excludeDirs doc
I saw reference to globs in #7755, but it doesn't look like they're
actually supported, and I had to dig through the source to discover
that the folders are relative to the workspace root. Further digging
was required to get VS Code from hanging for long periods trying to
watch giant Bazel folders that had already been excluded from Rust
Analyzer. Hopefully this tweak will save others the confusion :-)
2021-07-19 23:30:00 +10:00
Alexander Gonzalez 60be683d5e
fix: Typo in architecture.md 2021-07-18 22:17:45 -04:00
Daniel Hofstetter 8470c020bc
Remove outdated "(not yet released)" hint
Neovim 0.5 has been released recently (see http://neovim.io/news/2021/07), hence the "(not yet released)" hint is no longer needed.
2021-07-17 16:56:26 +02:00
Aleksey Kladov a9d0d1414a internal: remove erroneous default impl 2021-07-12 20:18:07 +03:00
Aleksey Kladov 706bd1c35d minor: one more usless type 2021-07-08 17:18:44 +03:00
Aleksey Kladov 0db4f3f6a4 internal: ensure consistent passing for config params
We pass "context" parametes first, so configs should be on the left.
"Bigger" context wins, so configs goes after db.
2021-07-06 00:00:39 +03:00
Aleksey Kladov b8a6ea5ab5 feat: make join lines behavior configurable
closes #9492
2021-07-05 23:47:20 +03:00
Aleksey Kladov f34762abb7 internal: better factoring for to_proto::completion
One source completion can produce up to two lsp completions.
Additionally, `preselct` and `sort_text` are global properties of the
whole set of completions, so the right granularity here is to convert
many completions.

As a side-benefit, we no loger allocate intermediate vec.
2021-07-04 14:08:33 +03:00