rust-analyzer/editors/code
bors[bot] aca3c3086e
Merge #3629
3629: Alternative aproach to plugin auto update r=matklad a=matklad

This is very much WIP (as in, I haven't run this once), but I like the result so far.

cc @Veetaha 

The primary focus here on simplification:

* local simplification of data structures and control-flow: using union of strings instead of an enum, using unwrapped GitHub API responses
* global simplification of control flow: all logic is now in `main.ts`, implemented as linear functions without abstractions. This is stateful side-effective code, so arguments from [Carmack](http://number-none.com/blow/john_carmack_on_inlined_code.html) very much apply. We need all user interractions, all mutations, and all network requests to happen in a single file. 
* as a side-effect of condensing everything to functions, we can get rid of various enums. The enums were basically a reified control flow:

```
enum E { A, B }

fn foo() -> E {
    if cond { E::A } else { E::B }
}

fn bar(e: E) {
    match e {
        E::A => do_a(),
        E::B => do_b(),
    }
}

==>>

fn all() {
    if cond { do_a() } else { do_b() }
}
```

* simplification of model: we don't need to reinstall on settings update, we can just ask the user to reload, we don't need to handle nightly=>stable fallback, we can ask the user to reinstall extension, (todo) we don't need to parse out the date from the version, we can use build id for nightly and for stable we can write the info directly into package.json.

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-03-19 08:06:48 +00:00
..
src Rewrite auto-update 2020-03-19 09:04:59 +01:00
.eslintrc.js vscode: remove type assertion 2020-02-24 21:23:56 +02:00
.gitignore add rollup bundler for vscode extension 2019-09-23 23:25:16 +02:00
.vscodeignore Actually include readme into .vsix 2020-03-03 18:40:27 +01:00
icon.png Extension icon 2020-01-15 16:07:39 +01:00
package-lock.json Update deps; regen lock file; fix minimist CVE 2020-03-18 10:36:11 -06:00
package.json Merge #3629 2020-03-19 08:06:48 +00:00
README.md Minimal viable meta 2020-03-02 14:27:26 +01:00
rollup.config.js Disable rollup warning 2020-02-16 05:04:51 +08:00
tsconfig.json vscode: amended config to use binary from globalStoragePath, added ui for downloading 2020-02-08 04:34:11 +02:00

rust-analyzer

Provides support for rust-analyzer: novel LSP server for the Rust programming language.

See https://rust-analyzer.github.io/ for more information.