Commit Graph

7387 Commits

Author SHA1 Message Date
Veetaha
420462421d vscode extension cleanup: migrate to prefer-const tslint rule 2020-02-02 21:12:59 +02:00
bors[bot]
d06e02dd13
Merge #2985
2985: Avoid premature pessimization r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-02-02 17:57:40 +00:00
Aleksey Kladov
24ad1cce2c Avoid premature pessimization
The extra allocation for message should not matter here at all, but
using a static string is just as ergonomic, if not more, and there's
no reason to write deliberately slow code
2020-02-02 18:56:37 +01:00
bors[bot]
856e4ba126
Merge #2979
2979: vscode: now we are actually using tslib r=matklad a=Veetaha

We had an incorrect setup where `tslib` was in `devDependencies`.
FYI:
tslib is a runtime dependency, it contains functions that are used by transpiled JavaScript in order not to inline them in each file.
For example:
```ts
// foo.ts (source code)
import * as foo from "foo";
// ---------------------------
// foo.js (compiled output)
"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
    result["default"] = mod;
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const foo = __importStar(require("foo"));
```
As you see, `tsc` generated that `__importStar` helper function in compiled output. And it generates it per each file if you don't enable `"importHelpers": true`. Now with `importHelpers` enabled we get the following picture:
```ts
// foo.ts (source code)
import * as foo from "foo";
// ---------------------------
// foo.js (compiled output)
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const foo = tslib_1.__importStar(require("foo"));
```
It saves some bundle size, but I am not entirely sure wheter we want that. Discussions are welcome!

Co-authored-by: Veetaha <gerzoh1@gmail.com>
2020-02-02 14:05:23 +00:00
bors[bot]
9006cec492
Merge #2983
2983: Fix repo link in package.json r=matklad a=Veetaha

Fix repo link

Co-authored-by: Veetaha <gerzoh1@gmail.com>
2020-02-02 13:57:17 +00:00
bors[bot]
e24829909a
Merge #2982
2982: Merge imports when auto importing r=flodiebold a=SomeoneToIgnore



Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2020-02-02 13:06:14 +00:00
zombiefungus
f4f71e361e include requested changes 2020-02-02 08:04:24 -05:00
zombiefungus
7d52715945 add new ImportAlias enum to differentiate no alias from an _ alias 2020-02-02 08:04:24 -05:00
Kirill Bulatov
2ee94e3e24
Remove obsolete rustdoc 2020-02-02 14:59:07 +02:00
Kirill Bulatov
c669b2f489 Code review fixes 2020-02-02 14:27:52 +02:00
Kirill Bulatov
6dae5cbb11 Require ModPath for importing 2020-02-02 14:06:51 +02:00
bors[bot]
dce7dc44be
Merge #2978
2978: Auto import functions r=flodiebold a=SomeoneToIgnore

A follow up for https://github.com/rust-analyzer/rust-analyzer/pull/2887#issuecomment-577832601

I've used the logic for conversion from the https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_hir_def/src/item_scope.rs#L169 method.

I'm not fond of how the conversion is implemented and for my needs, I can simply replace the `hir_def::item_scope::ItemInNs::Types(item.into())` with `hir_def::item_scope::ItemInNs::Values(item.into())` and it will work, so I can use this approach instead, if you find it a better one.

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2020-02-02 10:38:03 +00:00
Veetaha
3d6d0819cc fix repo link in package.json 2020-02-02 12:16:41 +02:00
Kirill Bulatov
a9669a5505 Merge imports when auto importing 2020-02-02 10:28:16 +02:00
Veetaha
f08297983f vscode: moved tslib to runtime dependencies and added \"importHelpers\": true 2020-02-01 23:11:39 +02:00
Kirill Bulatov
d3188769e4 Auto import functions 2020-02-01 22:13:02 +02:00
bors[bot]
96bd4f5704
Merge #2975
2975: Update regex r=kjeremy a=kjeremy



Co-authored-by: kjeremy <kjeremy@gmail.com>
2020-02-01 17:20:39 +00:00
kjeremy
0772f76ad0 Update regex 2020-02-01 12:19:02 -05:00
bors[bot]
3f499489f7
Merge #2964
2964: Improve responsiveness of the cargo check status label r=matklad a=lnicola

This is still not ideal because the label displays the crate that was just checked, not the one that's currently being checked. But it should give the impression of being faster.

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2020-02-01 15:41:55 +00:00
bors[bot]
eba599d986
Merge #2972
2972: Prevent child cargo process from messing with our stdin r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-02-01 15:28:48 +00:00
Aleksey Kladov
5559d6b8a8 Prevent child cargo process from messing with our stdin
By default, `spawn` inherits stderr/stdout/stderr of the parent
process, and so, if child, for example does fcntl(O_NONBLOCK), weird
stuff happens to us.

Closes https://github.com/rust-analyzer/lsp-server/pull/10
2020-02-01 16:25:44 +01:00
bors[bot]
a878f39b5e
Merge #2963 #2967
2963: Emacs fixes r=matklad a=flodiebold

 - use provided environment for runnables (finally set `RUST_BACKTRACE`)
 - implement `selectAndApplySourceChange` so auto-import works 🙂 

cc @brotzeit 

2967: Disable optimizations for some build-time crates r=matklad a=lnicola

This speeds up a release build on my laptop from 4m 13s to 3m 33s. It's a bit disappointing, but we don't get perfect parallelism during the build. The non-RA dependencies finish building around 72s as opposed to 112s.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2020-02-01 14:41:39 +00:00
bors[bot]
8e0ad99832
Merge #2970
2970: [VSCode] Fix syntax highlighting r=matklad a=bjorn3

Fixes #2969
Fixes #2971

Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com>
2020-02-01 14:34:04 +00:00
bjorn3
c84897bfb7 Tsfmt 2020-02-01 13:41:11 +01:00
bjorn3
5c39311f96 Fix seedrandom in packaged extension
Fixes #2971
2020-02-01 13:39:04 +01:00
bjorn3
f4431d2acc [VSCode] Fix syntax highlighting
Fixes #2969
2020-02-01 13:12:39 +01:00
bors[bot]
fc0a8c14dc
Merge #2965
2965: Improve auto import message r=kiljacken a=lnicola



Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2020-02-01 11:10:50 +00:00
Florian Diebold
2586cf9279 Implement support for selectAndApplySourceChange (auto import) in Emacs 2020-01-31 22:24:05 +01:00
Laurențiu Nicola
0fdca457df Improve auto import message 2020-01-31 22:12:18 +02:00
bors[bot]
12ac379c6c
Merge #2966
2966: Fix extra parentheses warnings r=kjeremy a=lnicola



Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2020-01-31 19:50:27 +00:00
Laurențiu Nicola
f83154d4bf Disable optimizations for some build-time crates 2020-01-31 21:49:44 +02:00
Laurențiu Nicola
0829e26354 Fix extra parentheses warnings 2020-01-31 21:07:21 +02:00
Laurențiu Nicola
d4d72e8b9b Improve responsiveness of the cargo check status label 2020-01-31 20:55:10 +02:00
Florian Diebold
ba45c60611 Fix env in emacs runnables support 2020-01-31 16:06:31 +01:00
bors[bot]
dc713ea21b
Merge #2960
2960: Small cleanup r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-01-31 12:35:15 +00:00
Aleksey Kladov
9d5a5211a4 Small cleanup 2020-01-31 13:34:44 +01:00
bors[bot]
e48033d066
Merge #2946
2946: updating nvim_lsp usage for rust_analyzer r=matklad a=matu3ba

The other option is invalid and a working version depends on [PR](https://github.com/neovim/nvim-lsp/pull/107)

Co-authored-by: Jan <jan.hafer@rwth-aachen.de>
2020-01-30 17:25:44 +00:00
bors[bot]
90b18a3f97
Merge #2955
2955: ⬆️ rust r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-01-30 17:14:42 +00:00
Aleksey Kladov
21950adc94 Switch Cargo.lock to the new format 2020-01-30 18:14:20 +01:00
Aleksey Kladov
5d7614197d ⬆️ rust 2020-01-30 18:03:24 +01:00
bors[bot]
bc29b7c0e5
Merge #2954
2954: Add a FIXME note r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-01-30 17:02:12 +00:00
Aleksey Kladov
c2e3dba8cb Add a FIXME note 2020-01-30 18:01:38 +01:00
bors[bot]
c7e0baf1a8
Merge #2920
2920: Better handle illformed node id from metadata r=matklad a=edwin0cheng

In some rare cases, deps node-id from cargo-metadata do not match its version-id, which cause a panic in `cargo-workspace.rs`. This PR try to ignore these ill-formed node id from `cargo-metadata`. An alternative is return  `Err` in these cases but I think make it resilience is a better choice here.

Related #2767

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2020-01-30 16:48:35 +00:00
bors[bot]
5f0b17b52d
Merge #2953
2953: Update crates r=kjeremy a=kjeremy



Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2020-01-30 13:10:53 +00:00
Jeremy Kolb
a37ee9c8a4 Update crates 2020-01-30 08:07:42 -05:00
bors[bot]
0c2e7032b1
Merge #2952
2952: Simplify fixture parsing r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-01-30 12:18:32 +00:00
Aleksey Kladov
c445c72eb3 Simplify fixture parsing 2020-01-30 13:17:56 +01:00
bors[bot]
5dcd9fdf5e
Merge #2895
2895: Rewrite ra_prof's profile printing r=michalt a=michalt

This changes the way we print things to first construct a mapping from
events to the children and uses that mapping to actually print things.
It should not change the actual output that we produce.

The new approach two benefits:

 * It avoids a potential quadratic behavior of the previous approach.
   For instance, for a vector of N elements:
   ```
   [Message{level: (N - 1)}, ..., Message{level: 1}, Message{level: 0}]
   ```
   we would first do a linear scan to find entry with level 0, then
   another scan to find one with level 1, etc.

 * It makes it much easier to improve the output in the future, because
   we now pre-compute the children for each entry and can easily take
   that into account when printing.

Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>

Co-authored-by: Michal Terepeta <michal.terepeta@gmail.com>
2020-01-29 20:09:49 +00:00
Michal Terepeta
644c383f65 A couple of small improvements to ra_prof printing
Based on suggestions from @matklad.

Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>
2020-01-29 20:55:35 +01:00
Jan
53fd24a6d3 updating nvim_lsp usage for rust_analyzer 2020-01-29 20:11:32 +01:00