]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoFix format highlighting with `concat!`
Jonas Schievink [Fri, 1 Oct 2021 11:28:05 +0000 (13:28 +0200)]
Fix format highlighting with `concat!`

2 years agoMerge #10412
bors[bot] [Fri, 1 Oct 2021 10:35:15 +0000 (10:35 +0000)]
Merge #10412

10412: feat: highlight `asm!` as format string r=jonas-schievink a=jonas-schievink

![screenshot-2021-10-01-12:34:31](https://user-images.githubusercontent.com/1786438/135606261-a1cb6caf-0a7f-45f7-9dde-0275370b0889.png)

part of https://github.com/rust-analyzer/rust-analyzer/issues/10394

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2 years agoExpand `asm!` to `format_args!`
Jonas Schievink [Fri, 1 Oct 2021 10:33:18 +0000 (12:33 +0200)]
Expand `asm!` to `format_args!`

2 years agoMerge #10411
bors[bot] [Fri, 1 Oct 2021 10:20:06 +0000 (10:20 +0000)]
Merge #10411

10411: fix: Parenthesize expressions in `if_to_bool_then` assist where required r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoParenthesize expressions in if_to_bool_then assist where required
Lukas Wirth [Fri, 1 Oct 2021 10:19:01 +0000 (12:19 +0200)]
Parenthesize expressions in if_to_bool_then assist where required

2 years agoMerge #10406
bors[bot] [Thu, 30 Sep 2021 19:46:57 +0000 (19:46 +0000)]
Merge #10406

10406: internal: Restructure syntax element highlighting into node and token branches r=Veykril a=Veykril

Gets rid of all the unseemly unwraps
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoRestructure syntax element highlighting
Lukas Wirth [Thu, 30 Sep 2021 19:36:20 +0000 (21:36 +0200)]
Restructure syntax element highlighting

2 years agoMerge #10404
bors[bot] [Thu, 30 Sep 2021 18:38:39 +0000 (18:38 +0000)]
Merge #10404

10404: minor: Simplify r=Veykril a=Veykril

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/10405
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoFix add missing semantic token modifier in SUPPORTED_MODIFIERS
Lukas Wirth [Thu, 30 Sep 2021 18:38:05 +0000 (20:38 +0200)]
Fix add missing semantic token modifier in SUPPORTED_MODIFIERS

2 years agoSimplify
Lukas Wirth [Thu, 30 Sep 2021 17:12:37 +0000 (19:12 +0200)]
Simplify

2 years agoMerge #10402
bors[bot] [Thu, 30 Sep 2021 16:18:09 +0000 (16:18 +0000)]
Merge #10402

10402: fix: Don't show flyimport completions in use renames r=Veykril a=Veykril

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/10367
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoDon't show flyimport completions in use renames
Lukas Wirth [Thu, 30 Sep 2021 16:15:55 +0000 (18:15 +0200)]
Don't show flyimport completions in use renames

2 years agoMerge #10398
bors[bot] [Thu, 30 Sep 2021 16:10:23 +0000 (16:10 +0000)]
Merge #10398

10398: Give defaultLibrary semantic token modifier to items from standard library r=Veykril a=lhvy

Fixes #8999, fixes #2155

`builtInCrates` could be an alternate name to `defaultLibrary`, which one is better?

> P.S. I'm participating in [Hacktoberfest 2021](https://hacktoberfest.digitalocean.com/). If this PR is up to standard and merged, I'd appreciate if the `hacktoberfest-accepted` label could be added. Thanks!

Co-authored-by: lhvy <me@lhvy.dev>
Co-authored-by: Lucas <me@lhvy.dev>
2 years agoFix builtin_crates return type change
lhvy [Thu, 30 Sep 2021 16:05:00 +0000 (02:05 +1000)]
Fix builtin_crates return type change

2 years agoMerge #10401
bors[bot] [Thu, 30 Sep 2021 16:03:03 +0000 (16:03 +0000)]
Merge #10401

10401: minor: Test runnables check for test prefix and suffix in attributes only r=Veykril a=Veykril

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/10393
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoTest runnables check for test prefix and suffix in attributes only
Lukas Wirth [Thu, 30 Sep 2021 16:01:47 +0000 (18:01 +0200)]
Test runnables check for test prefix and suffix in attributes only

2 years agoAdd comment
lhvy [Thu, 30 Sep 2021 15:58:09 +0000 (01:58 +1000)]
Add comment

2 years agoReduce allocation in builtin_crates
Lucas [Thu, 30 Sep 2021 15:56:30 +0000 (01:56 +1000)]
Reduce allocation in builtin_crates

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoRemove unneeded semantic token definition
lhvy [Thu, 30 Sep 2021 15:55:29 +0000 (01:55 +1000)]
Remove unneeded semantic token definition

2 years agoMerge #10400
bors[bot] [Thu, 30 Sep 2021 15:33:07 +0000 (15:33 +0000)]
Merge #10400

10400: fix: fix format string highlighting for `todo!` and `unimplemented!` r=jonas-schievink a=jonas-schievink

Part of https://github.com/rust-analyzer/rust-analyzer/issues/10394

These macros require us to see through the `const_format_args!` invocation the panic macros generate, for that we have to add it to our supported built-in macros.

I've also made the macros in the test `#[macro_export]` (turns out they didn't all resolve correctly before this), which changes the output slightly.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2 years agoWork around tidy check
Jonas Schievink [Thu, 30 Sep 2021 15:27:09 +0000 (17:27 +0200)]
Work around tidy check

2 years agoGive defaultLibrary semantic token modifier to items from standard library
lhvy [Thu, 30 Sep 2021 13:40:17 +0000 (23:40 +1000)]
Give defaultLibrary semantic token modifier to items from standard library

2 years agoMerge #10399
bors[bot] [Thu, 30 Sep 2021 15:17:12 +0000 (15:17 +0000)]
Merge #10399

10399: minor: don't drop binders when doing autoderef r=lnicola a=iDawer

This fixes #10396 panic introduced in #10373

Co-authored-by: Dawer <7803845+iDawer@users.noreply.github.com>
2 years agoAdd `const_format_args!` builtin macro, fix highlighting
Jonas Schievink [Thu, 30 Sep 2021 15:16:39 +0000 (17:16 +0200)]
Add `const_format_args!` builtin macro, fix highlighting

2 years agominor: don't drop binders when doing autoderef
Dawer [Thu, 30 Sep 2021 14:57:15 +0000 (19:57 +0500)]
minor: don't drop binders when doing autoderef

2 years agoMerge #10397
bors[bot] [Thu, 30 Sep 2021 14:37:43 +0000 (14:37 +0000)]
Merge #10397

10397: fix: fix format string highlighting for `panic!` and `assert!` r=jonas-schievink a=jonas-schievink

part of https://github.com/rust-analyzer/rust-analyzer/issues/10394

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2 years agoUse itertools
Jonas Schievink [Thu, 30 Sep 2021 14:37:12 +0000 (16:37 +0200)]
Use itertools

2 years agoLess hacky `assert!` expansion
Jonas Schievink [Thu, 30 Sep 2021 14:26:41 +0000 (16:26 +0200)]
Less hacky `assert!` expansion

2 years agoFix format string highlighting in `panic!`
Jonas Schievink [Thu, 30 Sep 2021 13:53:47 +0000 (15:53 +0200)]
Fix format string highlighting in `panic!`

2 years agoMerge #10395
bors[bot] [Thu, 30 Sep 2021 06:07:50 +0000 (06:07 +0000)]
Merge #10395

10395: Add pub(super) along with pub(crate) and pub as a completion keyword r=lnicola a=azdavis

I've gotten used to typing `pc` in front of items to get `pub(crate)`, but recently I needed `pub(super)`. So I tried typing `ps` and it didn't work. Now it should!

Co-authored-by: Ariel Davis <ariel.z.davis@icloud.com>
2 years agoAdd pub(super) along with pub(crate) and pub as a completion keyword
Ariel Davis [Thu, 30 Sep 2021 04:55:15 +0000 (21:55 -0700)]
Add pub(super) along with pub(crate) and pub as a completion keyword

2 years agoMerge #10389
bors[bot] [Wed, 29 Sep 2021 19:20:12 +0000 (19:20 +0000)]
Merge #10389

10389: fix: use the right `HirFileId` when expanding macros in fn parameters r=Veykril a=SkiFire13

Fixes #10388

Co-authored-by: Giacomo Stevanato <giaco.stevanato@gmail.com>
2 years agoAdd regression test
Giacomo Stevanato [Wed, 29 Sep 2021 19:06:44 +0000 (21:06 +0200)]
Add regression test

2 years agoUse the right HirFileId for LowerCtx when expanding macros in fn parameter types
Giacomo Stevanato [Wed, 29 Sep 2021 19:06:37 +0000 (21:06 +0200)]
Use the right HirFileId for LowerCtx when expanding macros in fn parameter types

2 years agoMerge #10384
bors[bot] [Wed, 29 Sep 2021 17:21:56 +0000 (17:21 +0000)]
Merge #10384

10384: Add vscode native onEnterRules r=matklad,lnicola a=HKalbasi

This PR copy onEnterRules configurations [from vscode-rust](https://github.com/rust-lang/vscode-rust/blob/master/src/extension.ts#L287) based on discussion in #6254

I understand that the ideal way is to use parser data for this, and probably all other things that language-config do. But since it can't be enabled (or at least it isn't enabled) by default in vscode, I think this is needed (until onEnter becomes official LSP and get vscode support).

People can still configure shortcut and use the parser based onEnter, so it wouldn't harm anyone.

Co-authored-by: hamidreza kalbasi <hamidrezakalbasi@protonmail.com>
2 years agoMerge #10181
bors[bot] [Wed, 29 Sep 2021 13:13:03 +0000 (13:13 +0000)]
Merge #10181

10181: Begining of lsif r=HKalbasi a=HKalbasi

This PR adds a `lsif` command to cli, which can be used as `rust-analyzer lsif /path/to/project > dump.lsif`. It now generates a valid, but pretty useless lsif (only supports folding ranges). The propose of this PR is to discussing about the structure of lsif generator, before starting anything serious.

cc `@matklad` #8696 #3098

Co-authored-by: hamidreza kalbasi <hamidrezakalbasi@protonmail.com>
2 years agoremove glob import and cancellables
hamidreza kalbasi [Wed, 29 Sep 2021 12:41:58 +0000 (16:11 +0330)]
remove glob import and cancellables

2 years agoMerge #10385
bors[bot] [Tue, 28 Sep 2021 19:48:03 +0000 (19:48 +0000)]
Merge #10385

10385: Make `extern crate test;` work r=jonas-schievink a=jonas-schievink

This implements support for dependencies that are not added to the extern prelude of a crate, and add the `test` crate from the sysroot as such a dependency.

This does mean we now index `test` on startup, but I didn't notice much of a difference (and also, r-a can be used while it is still indexing).

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/6714

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2 years agoImplicitly depend on `test`
Jonas Schievink [Tue, 28 Sep 2021 19:39:41 +0000 (21:39 +0200)]
Implicitly depend on `test`

2 years agoMerge #10373
bors[bot] [Tue, 28 Sep 2021 19:38:59 +0000 (19:38 +0000)]
Merge #10373

10373: fix: `into_iterator` not completed on `Vec<{unknown}>` r=iDawer a=iDawer

Fixes  #10297

Co-authored-by: Dawer <7803845+iDawer@users.noreply.github.com>
2 years agofix: replace errors in a type when doing autoderef
Dawer [Tue, 28 Sep 2021 19:26:58 +0000 (00:26 +0500)]
fix: replace errors in a type when doing autoderef

2 years agosupport non-extern-prelude dependencies
Jonas Schievink [Tue, 28 Sep 2021 19:23:46 +0000 (21:23 +0200)]
support non-extern-prelude dependencies

2 years agoMerge #10382
bors[bot] [Tue, 28 Sep 2021 17:23:11 +0000 (17:23 +0000)]
Merge #10382

10382: fix: Fix inline_call breaking RecordExprField shorthands r=Veykril a=Veykril

Fixes #10349
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoFix inline_call breaking RecordExprField shorthands
Lukas Wirth [Tue, 28 Sep 2021 13:31:55 +0000 (15:31 +0200)]
Fix inline_call breaking RecordExprField shorthands

2 years agoadd vscode native onEnterRules
hamidreza kalbasi [Tue, 28 Sep 2021 16:53:25 +0000 (20:23 +0330)]
add vscode native onEnterRules

2 years agoMerge #10305
bors[bot] [Tue, 28 Sep 2021 16:30:07 +0000 (16:30 +0000)]
Merge #10305

10305: Move `GenericParams`'s handling of `impl Trait` into `fn_data_query` r=flodiebold a=SkiFire13

Fixes #10286

Co-authored-by: Giacomo Stevanato <giaco.stevanato@gmail.com>
2 years agoMerge #10362
bors[bot] [Tue, 28 Sep 2021 10:24:44 +0000 (10:24 +0000)]
Merge #10362

10362: feat: Convert a/mod.rs into a.rs r=Veykril a=longfangsong

This is the reverse operation of #10211.

![demo](https://user-images.githubusercontent.com/13777628/134837717-074c23e9-1ca2-4207-b780-8443b2241272.gif)

Close #10143.

Co-authored-by: longfangsong <longfangsong@icloud.com>
Co-authored-by: 龙方淞 <longfangsong@icloud.com>
2 years agoAddress comments
longfangsong [Tue, 28 Sep 2021 02:20:35 +0000 (10:20 +0800)]
Address comments

2 years agoUpdate crates/vfs/src/vfs_path.rs
龙方淞 [Tue, 28 Sep 2021 02:20:35 +0000 (10:20 +0800)]
Update crates/vfs/src/vfs_path.rs

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoUpdate crates/ide_assists/src/handlers/move_from_mod_rs.rs
龙方淞 [Tue, 28 Sep 2021 02:20:35 +0000 (10:20 +0800)]
Update crates/ide_assists/src/handlers/move_from_mod_rs.rs

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoinitial commit
longfangsong [Tue, 28 Sep 2021 02:20:29 +0000 (10:20 +0800)]
initial commit

2 years agoMerge #10378
bors[bot] [Mon, 27 Sep 2021 18:00:08 +0000 (18:00 +0000)]
Merge #10378

10378: fix: Implement most proc_macro span handling methods r=jonas-schievink a=jonas-schievink

This closes https://github.com/rust-analyzer/rust-analyzer/issues/10368 – some APIs are still missing, but they are either for unstable features or require https://github.com/rust-analyzer/rust-analyzer/issues/9403

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2 years agoImplement most proc_macro span handling methods
Jonas Schievink [Mon, 27 Sep 2021 17:58:07 +0000 (19:58 +0200)]
Implement most proc_macro span handling methods

2 years agoMerge #10377
bors[bot] [Mon, 27 Sep 2021 17:43:32 +0000 (17:43 +0000)]
Merge #10377

10377: fix: fix proc macro crash on nightly r=jonas-schievink a=jonas-schievink

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/10235

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2 years agoImplement `save_span` / `recover_proc_macro_span`
Jonas Schievink [Mon, 27 Sep 2021 17:42:39 +0000 (19:42 +0200)]
Implement `save_span` / `recover_proc_macro_span`

2 years agoMerge #10375
bors[bot] [Mon, 27 Sep 2021 17:19:55 +0000 (17:19 +0000)]
Merge #10375

10375: minor: Use SmallVec<[_; 1]> in `descend_into_macros_impl` r=Veykril a=Veykril

A lot of descends don't actually descend in which case we don't wanna allocate
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoUse SmallVec<[_; 1]> in `descend_into_macros_impl`
Lukas Wirth [Mon, 27 Sep 2021 17:18:26 +0000 (19:18 +0200)]
Use SmallVec<[_; 1]> in `descend_into_macros_impl`

2 years agoMerge #10374
bors[bot] [Mon, 27 Sep 2021 17:05:39 +0000 (17:05 +0000)]
Merge #10374

10374: fix: Make `stringify!` insert/collapse whitespace when needed r=jonas-schievink a=jonas-schievink

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/10365

Unlike rustc, we don't insert newlines, but that should be fine.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2 years agoMake `stringify!` prettify its input
Jonas Schievink [Mon, 27 Sep 2021 17:02:03 +0000 (19:02 +0200)]
Make `stringify!` prettify its input

This will insert whitespace if the invocation is inside another macro

2 years agofix: replace errors in receiver type when iterating method candidates
Dawer [Mon, 27 Sep 2021 16:44:27 +0000 (21:44 +0500)]
fix: replace errors in receiver type when iterating method candidates

2 years agoMerge #10372
bors[bot] [Mon, 27 Sep 2021 16:45:40 +0000 (16:45 +0000)]
Merge #10372

10372: minor: Cleanup descend_into_macros_impl r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoCleanup descend_into_macros_impl
Lukas Wirth [Mon, 27 Sep 2021 16:44:40 +0000 (18:44 +0200)]
Cleanup descend_into_macros_impl

2 years agoMerge #10366
bors[bot] [Mon, 27 Sep 2021 15:12:44 +0000 (15:12 +0000)]
Merge #10366

10366: feat: Enable attribute proc macros by default r=lnicola a=lnicola

Closes #9868

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoEnable attribute proc macros by default
Laurențiu Nicola [Mon, 27 Sep 2021 15:11:31 +0000 (18:11 +0300)]
Enable attribute proc macros by default

2 years agoUpdate failing test
Giacomo Stevanato [Tue, 21 Sep 2021 13:37:47 +0000 (15:37 +0200)]
Update failing test

2 years agoAdd regression test
Giacomo Stevanato [Tue, 21 Sep 2021 13:03:34 +0000 (15:03 +0200)]
Add regression test

2 years agoMove `GenericParams`'s handling of `impl Trait` into `GenericParams::generic_params_q...
Giacomo Stevanato [Tue, 21 Sep 2021 13:36:52 +0000 (15:36 +0200)]
Move `GenericParams`'s handling of `impl Trait` into `GenericParams::generic_params_query`

2 years agoMerge #10353
bors[bot] [Mon, 27 Sep 2021 13:34:52 +0000 (13:34 +0000)]
Merge #10353

10353: Remove `GenericParams::new` r=SkiFire13 a=SkiFire13

Helps with #10305

I made the implementations of `HasChildSource<_>` and `ChildBySource` for `GenericDefId` use their own logic instead of relying on `GenericParams::new`. This in turn means that `GenericParams::new` is unused and can be removed. `SourceMap` becomes also unused because all the rest of the code does is insert into it, so it can be removed too.

This also helps avoid creating a completly new `GenericParams` when `GenericDefId::child_source` and `GenericDefId::child_by_source_to` are called, and also creating a `SourceMap` in `item_tree::lower::Ctx::lower_generic_params`.

Co-authored-by: Giacomo Stevanato <giaco.stevanato@gmail.com>
2 years agoRemove SourceMap
Giacomo Stevanato [Sat, 25 Sep 2021 17:06:04 +0000 (19:06 +0200)]
Remove SourceMap

2 years agoRemove GenericParams::new
Giacomo Stevanato [Sat, 25 Sep 2021 16:57:57 +0000 (18:57 +0200)]
Remove GenericParams::new

2 years agoMake impls of `HasChildSource` and `ChildBySource` for `GenericDefId` not use `Generi...
Giacomo Stevanato [Sat, 25 Sep 2021 16:57:11 +0000 (18:57 +0200)]
Make impls of `HasChildSource` and `ChildBySource` for `GenericDefId` not use `GenericParams::new`

2 years agoMerge #10364
bors[bot] [Mon, 27 Sep 2021 10:55:36 +0000 (10:55 +0000)]
Merge #10364

10364: internal: Rename `Dyn*` nodes to `Any*` nodes r=Veykril a=Veykril

cc https://github.com/rust-analyzer/rust-analyzer/pull/10304#issuecomment-927263396
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoRename `*Owner` traits to `Has*`
Lukas Wirth [Mon, 27 Sep 2021 10:54:24 +0000 (12:54 +0200)]
Rename `*Owner` traits to `Has*`

2 years agoRename `Dyn*` nodes to `Any*` nodes
Lukas Wirth [Mon, 27 Sep 2021 10:45:36 +0000 (12:45 +0200)]
Rename `Dyn*` nodes to `Any*` nodes

2 years agoMerge #10360
bors[bot] [Sun, 26 Sep 2021 16:19:05 +0000 (16:19 +0000)]
Merge #10360

10360: headsup: matklad rewrites blocks grammar again :) r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agointernal: more reasonable grammar for blocks
Aleksey Kladov [Sun, 26 Sep 2021 09:12:57 +0000 (12:12 +0300)]
internal: more reasonable grammar for blocks

Consider these expples

        { 92 }
  async { 92 }
    'a: { 92 }
   #[a] { 92 }

Previously the tree for them were

  BLOCK_EXPR
    { ... }

  EFFECT_EXPR
    async
    BLOCK_EXPR
      { ... }

  EFFECT_EXPR
    'a:
    BLOCK_EXPR
      { ... }

  BLOCK_EXPR
    #[a]
    { ... }

As you see, it gets progressively worse :) The last two items are
especially odd. The last one even violates the balanced curleys
invariant we have (#10357) The new approach is to say that the stuff in
`{}` is stmt_list, and the block is stmt_list + optional modifiers

  BLOCK_EXPR
    STMT_LIST
      { ... }

  BLOCK_EXPR
    async
    STMT_LIST
      { ... }

  BLOCK_EXPR
    'a:
    STMT_LIST
      { ... }

  BLOCK_EXPR
    #[a]
    STMT_LIST
      { ... }

2 years agoMerge #10358
bors[bot] [Sun, 26 Sep 2021 14:49:25 +0000 (14:49 +0000)]
Merge #10358

10358: internal: Remove inherent methods from ast nodes that do non-syntactic complex tasks  r=Veykril a=Veykril

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoRemove inherent methods from ast node that carry semantic meaning
Lukas Wirth [Sun, 26 Sep 2021 14:29:42 +0000 (16:29 +0200)]
Remove inherent methods from ast node that carry semantic meaning

2 years agoMerge #10352
bors[bot] [Sun, 26 Sep 2021 14:02:25 +0000 (14:02 +0000)]
Merge #10352

10352: feat: Implement inline callers assist r=Veykril a=Veykril

Fixes #7242

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoRemove imports when inlining all calls in a file
Lukas Wirth [Sun, 26 Sep 2021 14:01:54 +0000 (16:01 +0200)]
Remove imports when inlining all calls in a file

2 years agoSimplify
Lukas Wirth [Sun, 26 Sep 2021 12:56:43 +0000 (14:56 +0200)]
Simplify

2 years agoReject recursive calls in inline_call
Lukas Wirth [Sun, 26 Sep 2021 12:38:58 +0000 (14:38 +0200)]
Reject recursive calls in inline_call

2 years agoMerge #10357
bors[bot] [Sun, 26 Sep 2021 12:54:12 +0000 (12:54 +0000)]
Merge #10357

10357: internal: fix and force-disable block validation ;-( r=matklad a=matklad

Originally we tried to maintain the invariant that `{}` always match.
That is, that in the parse tree the pair of corresponding `{}` is always
first and last tokens of some nodes.

We had the code to validate that, but apparently it's been broken for
**years** since we introduced tokens/nodes split. Fixing it now makes
some tests fail.

It's unclear if we want to keep this invariant: there's a strong
motivation for breaking it in the following case:

```
use std::{ // unclosed paren

fn main() {

}

} // don't actually want to pair up this with the one from `use`
```

So let's fix the code, but disable it for the time being

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agointernal: fix and force-disable block validation ;-(
Aleksey Kladov [Sun, 26 Sep 2021 12:49:23 +0000 (15:49 +0300)]
internal: fix and force-disable block validation ;-(

Originally we tried to maintain the invariant that `{}` always match.
That is, that in the parse tree the pair of corresponding `{}` is always
first and last tokens of some nodes.

We had the code to validate that, but apparently it's been broken for
**years** since we introduced tokens/nodes split. Fixing it now makes
some tests fail.

It's unclear if we want to keep this invariant: there's a strong
motivation for breaking it in the following case:

```
use std::{ // unclosed paren

fn main() {

}

} // don't actually want to pair up this with the one from `use`
```

So let's fix the code, but disable it for the time being

2 years agoadd some tests
hamidreza kalbasi [Sun, 26 Sep 2021 09:17:57 +0000 (12:47 +0330)]
add some tests

2 years agoMerge #10354
bors[bot] [Sun, 26 Sep 2021 08:23:29 +0000 (08:23 +0000)]
Merge #10354

10354: internal: overhaul expression attribute parsing r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agouse crates io version
hamidreza kalbasi [Sun, 26 Sep 2021 07:09:23 +0000 (10:39 +0330)]
use crates io version

2 years agosupport goto definition and find references
hamidreza kalbasi [Thu, 23 Sep 2021 12:58:21 +0000 (16:28 +0330)]
support goto definition and find references

2 years agoreuse hover results with resultset
hamidreza kalbasi [Sat, 18 Sep 2021 17:44:47 +0000 (22:14 +0430)]
reuse hover results with resultset

2 years agomove lsif types to lsp types crate
hamidreza kalbasi [Sat, 18 Sep 2021 14:49:24 +0000 (19:19 +0430)]
move lsif types to lsp types crate

2 years agoadd hover
hamidreza kalbasi [Fri, 10 Sep 2021 15:30:53 +0000 (20:00 +0430)]
add hover

2 years agocfg unix for tests with unix path
hamidreza kalbasi [Thu, 9 Sep 2021 13:27:46 +0000 (17:57 +0430)]
cfg unix for tests with unix path

2 years agouse utf16 instead of utf8
hamidreza kalbasi [Wed, 8 Sep 2021 15:56:06 +0000 (20:26 +0430)]
use utf16 instead of utf8

2 years agoBegining of lsif
hamidreza kalbasi [Wed, 8 Sep 2021 11:35:28 +0000 (16:05 +0430)]
Begining of lsif

2 years agofeat: allow attributes on all expressions
Aleksey Kladov [Sat, 25 Sep 2021 16:51:54 +0000 (19:51 +0300)]
feat: allow attributes on all expressions

Attrs are syntactically valid on any expression, even if they are not
allowed semantically everywhere yet.

2 years agofix: correct extend_to logic in parser
Aleksey Kladov [Sat, 25 Sep 2021 16:11:45 +0000 (19:11 +0300)]
fix: correct extend_to logic in parser

Previously we swapped to events in the buffer, but that might be wrong
if there aer `forward_parent` links pointing to the swapped-out node.

Let's do the same via parent links instead, keeping the nodes in place

2 years agofeat: Implement inline callers assist
Lukas Wirth [Sat, 25 Sep 2021 16:39:43 +0000 (18:39 +0200)]
feat: Implement inline callers assist

2 years agoMerge #10211
bors[bot] [Sat, 25 Sep 2021 15:32:00 +0000 (15:32 +0000)]
Merge #10211

10211: assists: Promote module to folder r=jonas-schievink a=longfangsong

Close part of #10143.

This PR adds a assist to promote module to directory, which means make a .rs file module into a directory style module with the same name.

![未命名(1)](https://user-images.githubusercontent.com/13777628/132958377-14555d6f-a64a-4b9b-9154-90a3b86fd685.gif)

Co-authored-by: longfangsong <longfangsong@icloud.com>
2 years agoMerge #10350
bors[bot] [Sat, 25 Sep 2021 15:09:34 +0000 (15:09 +0000)]
Merge #10350

10350: simplify attribute parsing r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agosimplify attribute parsing
Aleksey Kladov [Sat, 25 Sep 2021 15:07:51 +0000 (18:07 +0300)]
simplify attribute parsing