Commit graph

183 commits

Author SHA1 Message Date
Aleksey Kladov
353f7ce2ec Mention rust-src 2020-02-17 10:55:08 +01:00
Veetaha
2d7fe230f5 docs: Fix grammar mistakes 2020-02-16 23:52:41 +02:00
Veetaha
884e382fb8
Fix typo
Co-Authored-By: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-02-16 23:47:12 +02:00
Veetaha
5bf7e9a455
Remove ptrace note
Co-Authored-By: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-02-16 23:43:13 +02:00
Veetaha
bb9844e195
Add more verbose description
Co-Authored-By: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-02-16 23:42:48 +02:00
Veetaha
7050697871
Add the article
Co-Authored-By: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-02-16 23:42:10 +02:00
Veetaha
3db91db421
Reworded abit
Co-Authored-By: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-02-16 23:40:31 +02:00
Veetaha
329a1b665d
Add an article
Co-Authored-By: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-02-16 23:38:25 +02:00
Veetaha
dc90507dbe
Migrate from 'npm i' to 'npm install'
Co-Authored-By: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-02-16 23:36:16 +02:00
Veetaha
1a96d4c15c
Make Rust Great Again
Co-Authored-By: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-02-16 23:35:41 +02:00
Veetaha
79625e2dc2
Apply better wording as per lnicola
Co-Authored-By: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-02-16 23:35:10 +02:00
Veetaha
351cc9021e
Add the article
Co-Authored-By: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-02-16 23:33:23 +02:00
Veetaha
200a2475a2 docs: fix typo 2020-02-16 23:21:11 +02:00
Veetaha
64112b0b61 docs: update debugging.md with the freshest VSCode debugging information 2020-02-16 23:00:10 +02:00
Veetaha
43a41819cb docs: remove obsolescence notice in debugging.md 2020-02-16 21:03:24 +02:00
Veetaha
325eba58a2 vscode: updated user docs vscode updates section 2020-02-16 03:56:54 +02:00
Veetaha
4aa538f9a8
Typo
typo
2020-02-14 22:02:08 +02:00
Aleksey Kladov
81904421ac Ensure that the manual is self-improving 2020-02-14 19:15:32 +01:00
Aleksey Kladov
082dd87b32 Start manual 2020-02-14 18:31:56 +01:00
dvermd
7fb0311ac8 Move build prerequisites into build section 2020-02-10 06:55:10 +01:00
Veetaha
843d00ec9d docs: quick fix inner link in docs 2020-02-09 21:40:39 +02:00
Veetaha
3ebbeb46d4 docs: more documentation on prebuilt binaries all-editors-wise 2020-02-09 21:25:24 +02:00
Veetaha
e18661f62b docs: Freshen docs for prebuilt binaries and raLspServer setting 2020-02-09 20:19:23 +02:00
bors[bot]
360890fcec
Merge #3053
3053: Feature: downloading lsp server from GitHub r=matklad a=Veetaha

This is currently very WIP, I may need to change this and that, add "download language server command", logging stuff (for future bug reports), etc., but it already works.
Also didn't test this on windows yet and mac (don't have the latter)

The quirks:
* Downloaded binary doesn't have executable permissions by default, that's why we ~~`chmod 111`~~ (**[UPD]** `chmod 755` as per @lnicola [suggestion](https://github.com/rust-analyzer/rust-analyzer/pull/3053#discussion_r376694456)) for it.
* To remove installed binary run `rm /${HOME}/.config/Code/User/globalStorage/matklad.rust-analyzer/ra_lsp_server-linux`, ~~note that `-f` flag is necessary, because of `111` permissions (I think this should be changed)~~ (**[UPD]** --force is no longer needed due to 755 permissions).

I also tried to keep things simple and not to use too many dependencies, all the ones added have 0 dependencies, (`ts-not-nil` is my personal npm package, that imitates `unwrap()` in TypeScript)

**[UPD]** I reduced throttle latency of progress indicator to 200ms for smoother UX


// TODO:
- [x] ~~Add `Rust Analyzer: Download latest language server` vscode command.~~ **[UPD]**: having reviewed the code and estimated available options I concluded that this feature requires too many code changes, I'd like to extract this into a separate PR after we merge this one.
- [x] Add some logging for future debugging
- [x] ~~Gracefully handle the case when language server is not available (e.g. no internet connection, user explicitly rejected the download, etc.)~~ **[UPD]** Decided to postpone better implementation of graceful degradation logic as per [conversation](https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/Deployment.20and.20installation/near/187758550).

Demo (**[UPD]** this is a bit outdated, but still mainly reflects the feature):
![ra-github-release-download-mvp](https://user-images.githubusercontent.com/36276403/74077961-4f248a80-4a2d-11ea-962f-27c650fd6c4c.gif)

Related issue: #2988 #3007 

Co-authored-by: Veetaha <gerzoh1@gmail.com>
Co-authored-by: Veetaha <veetaha2@gmail.com>
2020-02-09 15:21:12 +00:00
Veetaha
dfb81a8cd4 docs: fix spelling untill -> until
Co-Authored-By: Jonas Platte <jplatte@users.noreply.github.com>
2020-02-09 17:04:33 +02:00
Veetaha
be244ab2fb docs: minor fixes in wordings and punctuation 2020-02-09 15:54:54 +02:00
Veetaha
6a367886ec vscode: updated docs on prebuilt binaries 2020-02-09 15:51:28 +02:00
bors[bot]
27964cc9e7
Merge #3052
3052: Rename add import assist r=matklad a=SomeoneToIgnore

Based on the https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/2.20assists.20with.20the.20same.20action.20name/near/187655643 and the related discussion.

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2020-02-09 08:51:56 +00:00
Florian Diebold
134cc70097 Docs cleanups 2020-02-08 16:15:58 +01:00
Kirill Bulatov
740a26b7d2 Rename add import assist 2020-02-07 23:53:08 +02:00
Aleksey Kladov
755077e372 Doctest autoimport 2020-02-06 18:14:44 +01:00
Gian D
0ef96f982c
Further fix docs/user/README.md
Co-Authored-By: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-02-05 11:09:08 +01:00
Gian D
13211ed701
Fix unneeded . in docs/user/README.md 2020-02-05 10:38:53 +01:00
Jan
53fd24a6d3 updating nvim_lsp usage for rust_analyzer 2020-01-29 20:11:32 +01:00
Aleksey Kladov
84dfbfbd1d Freshen Architecture.md document 2020-01-29 15:08:31 +01:00
Aleksey Kladov
1065c2bf1d Freshen dev docs a tiny bits 2020-01-29 14:45:32 +01:00
bors[bot]
87e1baf242
Merge #2910
2910: Use package script r=kjeremy a=kjeremy



Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2020-01-27 13:50:04 +00:00
Jeremy Kolb
1b5b30f2ac
Update docs/user/README.md
Co-Authored-By: Veetaha <veetaha2@gmail.com>
2020-01-27 08:49:34 -05:00
Kirill Bulatov
316795e074 Initial auto import action implementation 2020-01-27 00:16:29 +02:00
Jeremy Kolb
141dc7b81a
Use package script 2020-01-26 12:57:54 -05:00
Aleksey Kladov
fd69f62976 Add syntax guide 2020-01-22 11:13:11 +01:00
Aleksey Kladov
875352b2b6 Rename Emacs "extension" 2020-01-13 12:56:33 +01:00
Aleksey Kladov
bd7aa5db14 Rename VS Code extension to rust-analyzer 2020-01-13 11:13:18 +01:00
Aleksey Kladov
cf5bdf464c
Merge pull request #2732 from detrumi/cargo-toml-not-found-message-toggle
Flag to hide cargo.toml not found error
2020-01-09 15:16:39 +01:00
Jeremy Kolb
895155de6d
Update lsp-features.md 2020-01-08 11:45:14 -05:00
Gus Wynn
218d211f48 add note in vscode instructions for vim plugin users 2020-01-05 07:37:58 -08:00
Wilco Kusee
e7bb82c3a4
Allow disabling Cargo.toml not found error 2020-01-03 15:04:54 +01:00
Aleksey Kladov
ffa928c3d5 Add example of color customization 2019-12-31 14:51:23 +01:00
bors[bot]
232785251b
Merge #2061
2061: Theme loading and "editor.tokenColorCustomizations" support. r=matklad a=seivan

Fixes: [Issue#1294](https://github.com/rust-analyzer/rust-analyzer/issues/1294#issuecomment-497450325)

TODO: 
- [x] Load themes
- [x] Load existing `ralsp`-prefixed overrides from `"workbench.colorCustomizations"`.
- [x] Load overrides from `"editor.tokenColorCustomizations.textMateRules"`.
- [x] Use RA tags to load `vscode.DecorationRenderOptions` (colors) from theme & overrides.
- [x] Map RA tags to common TextMate scopes before loading colors.
- [x] Add default scope mappings in extension.
- [x] Cache mappings between settings updates. 
- [x] Add scope mapping configuration manifest in `package.json`
- [x] Load configurable scope mappings from settings.
- [x] Load JSON Scheme for text mate scope rules in settings.
- [x] Update [Readme](https://github.com/seivan/rust-analyzer/blob/feature/themes/docs/user/README.md#settings).

Borrowed the theme loading (`scopes.ts`) from `Tree Sitter` with some modifications to reading `"editor.tokenColorCustomizations"` for merging with loaded themes and had to remove the async portions to be able to load it from settings updates. 

~Just a PoC and an idea I toyed around with a lot of room for improvement.~
For starters, certain keywords aren't part of the standard TextMate grammar, so it still reads colors from the `ralsp` prefixed values in `"workbench.colorCustomizations"`. 

But I think there's more value making the extension work with existing themes by maping some of the decoration tags to existing key or keys. 

<img width="453" alt="Screenshot 2019-11-09 at 17 43 18" src="https://user-images.githubusercontent.com/55424/68531968-71b4e380-0318-11ea-924e-cdbb8d5eae06.png">
<img width="780" alt="Screenshot 2019-11-09 at 17 41 45" src="https://user-images.githubusercontent.com/55424/68531950-4b8f4380-0318-11ea-8f85-24a84efaf23b.png">
<img width="468" alt="Screenshot 2019-11-09 at 17 40 29" src="https://user-images.githubusercontent.com/55424/68531952-51852480-0318-11ea-800a-6ae9215f5368.png">


These will merge with the default ones coming with the extension, so you don't have to implement all of them and works well with overrides defined in settings. 

```jsonc
    "editor.tokenColorCustomizations": {
        "textMateRules": [
            {
                "scope": "keyword",
                "settings": {
                    "fontStyle": "bold",
                }
            },
        ]
    },
```


Edit: The idea is to work with 90% of the themes out there by working within existing scopes available that are generally styled. It's not to say I want to erase the custom Rust scopes - those should still remain and eventually worked into a custom grammar bundle for Rust specific themes that target those, I just want to make it work with generic themes offered on the market place for now. 

A custom grammar bundle and themes for Rust specific scopes is out of... scope for this PR. 
We'll make another round to tackle those issues. 


Current fallbacks implemented

```typescript
    [
        'comment',
        [
            'comment',
            'comment.block',
            'comment.line',
            'comment.block.documentation'
        ]
    ],
    ['string', ['string']],
    ['keyword', ['keyword']],
    ['keyword.control', ['keyword.control', 'keyword', 'keyword.other']],
    [
        'keyword.unsafe',
        ['storage.modifier', 'keyword.other', 'keyword.control', 'keyword']
    ],
    ['function', ['entity.name.function']],
    ['parameter', ['variable.parameter']],
    ['constant', ['constant', 'variable']],
    ['type', ['entity.name.type']],
    ['builtin', ['variable.language', 'support.type', 'support.type']],
    ['text', ['string', 'string.quoted', 'string.regexp']],
    ['attribute', ['keyword']],
    ['literal', ['string', 'string.quoted', 'string.regexp']],
    ['macro', ['support.other']],
    ['variable', ['variable']],
    ['variable.mut', ['variable', 'storage.modifier']],
    [
        'field',
        [
            'variable.object.property',
            'meta.field.declaration',
            'meta.definition.property',
            'variable.other'
        ]
    ],
    ['module', ['entity.name.section', 'entity.other']]
```


Co-authored-by: Seivan Heidari <seivan.heidari@icloud.com>
2019-12-29 16:49:40 +00:00
Florian Diebold
c39352fa43 Fill in type params in 'add missing impl members' assist 2019-12-24 17:29:27 +01:00