Commit Graph

67 Commits

Author SHA1 Message Date
Kirill Bulatov
dbf70cd015 Properly handle mod.rs imports 2020-09-10 01:42:20 +03:00
Kirill Bulatov
9fb83211f9 Complete semicolon when needed 2020-09-10 01:42:20 +03:00
Kirill Bulatov
57a260f579 Properly reacto to keywords 2020-09-10 01:42:20 +03:00
Kirill Bulatov
cc43abcde8 Less false positive completion candidates 2020-09-10 01:42:20 +03:00
Kirill Bulatov
3fd6f45141 Properly handle nested submodules in the same file 2020-09-10 01:42:20 +03:00
Kirill Bulatov
f9c14ac720 Move most of the logic into the completion module 2020-09-10 01:42:20 +03:00
Kirill Bulatov
6ba479cd05 Finally cretae the mod completion module 2020-09-10 01:42:20 +03:00
Kirill Bulatov
b2bcc5278d Properly handle special cases (binaries, mod.rs) 2020-09-10 01:42:20 +03:00
Kirill Bulatov
486c5c3285 Exclude special files 2020-09-10 01:42:20 +03:00
Kirill Bulatov
8aa740dab4 Happy path implemented 2020-09-10 01:42:20 +03:00
Kirill Bulatov
17870a3e2c Better API 2020-09-10 01:42:20 +03:00
Kirill Bulatov
4bed588001 First steps for mod<|> completion 2020-09-10 01:42:20 +03:00
Aramis Razzaghipour
321108673d Document VS Code setting needed for on-typing assists 2020-09-01 23:40:53 +10:00
Aleksey Kladov
c692b5d76d ⬆️ expect-test 2020-08-28 14:47:14 +02:00
Aleksey Kladov
4d0cfc07fd Minor 2020-08-27 15:02:56 +02:00
Aleksey Kladov
f8a59adf5e Tease apart orthogonal concerns in markdown link rewriting
`hir` should know nothing about URLs, markdown and html. It should
only be able to:

* resolve stringy path from documentation
* generate canonical stringy path for a def

In contrast, link rewriting should not care about semantics of paths
and names resolution, and should be concern only with text mangling
bits.
2020-08-26 20:24:00 +02:00
Aleksey Kladov
1c0ac2b9b4 Cleanup hover links tests 2020-08-26 18:36:16 +02:00
León Orell Valerian Liehr
63caef372a Improve support for code block attributes 2020-08-26 15:55:06 +02:00
Aleksey Kladov
18b667cfcb Complete pub in fields 2020-08-25 17:22:23 +02:00
Aleksey Kladov
b45dd9ef54 Use the same abstraction for attrs and docs
Doc comments *are* attributes, so there's no reason to have two crates
here.
2020-08-25 12:13:31 +02:00
Zac Pullar-Strecker
b835f06cec Merge remote-tracking branch 'upstream/master' into 503-hover-doc-links 2020-08-25 16:44:36 +12:00
bors[bot]
31cb13dde8
Merge #4776
4776: Do a weekly minor publish to crates.io r=matklad a=pksunkara

This is the same system I set up on Chalk repo.

Every week it creates a new minor version, pushes it to github and then deploys it to crates.io.

Co-authored-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
2020-08-24 11:14:45 +00:00
Pavan Kumar Sunkara
335add49db Add description for crates that will be published 2020-08-24 13:07:22 +02:00
Zac Pullar-Strecker
5452368fad Renames, comments, and dead code removal 2020-08-24 21:50:30 +12:00
Zac Pullar-Strecker
7bbca7a1b3 Merge remote-tracking branch 'upstream/master' into 503-hover-doc-links 2020-08-24 21:20:13 +12:00
Pavan Kumar Sunkara
a8fa5cd42e Add version to deps in cargo.toml 2020-08-24 11:10:41 +02:00
Kirill Bulatov
cdd75a699a Omit lenses for not runnable doctests 2020-08-22 22:03:02 +03:00
bors[bot]
e65d48d1fb
Merge #5823
5823: Don't underline function definition if self is &mut r=Nashenas88 a=matklad

The self is right there, and is already underlined, so it makes little
sense to emit even more underlines.

before:
![before](https://user-images.githubusercontent.com/1711539/90672843-0d379500-e257-11ea-840f-b0caed4410f1.png)
after:
![after](https://user-images.githubusercontent.com/1711539/90672840-0c9efe80-e257-11ea-9739-23af433841c6.png)



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-08-22 14:41:17 +00:00
Aleksey Kladov
863b1fb731 ⬆️ ungrammar 2020-08-21 19:14:05 +02:00
Aleksey Kladov
b0fd3faf36 Switch to expect_test from crates.io 2020-08-21 13:19:31 +02:00
Aleksey Kladov
8000d1d30d Don't underline function definition if self is &mut
The self is right there, and is already underlined, so it makes little
sense to emit even more underlines.
2020-08-19 20:02:33 +02:00
Aleksey Kladov
eb7bb2cba0 Remove dead code 2020-08-19 19:54:00 +02:00
Aleksey Kladov
81b0976187 Future proof find-usages API
We might want to provide more efficient impls for check if usages
exist, limiting the search, filtering and cancellation, so let's
violate YAGNI a bit here.
2020-08-19 18:58:48 +02:00
Aleksey Kladov
b56e020077 Apply couple of rule of thumbs to simplify highlighting code
Main one: instead of adding a parameter to function to handle special
case, make the caller handle it.

Second main one: make sure that function does a reasonable thing.
`highlight_def` picks  a color for def, *regardless* of the context
the def is use. Feeding an info from the call-site muddies the
responsibilities here.

Minor smells, flagging the function as having space for improvement in
the first place:

* many parameters, some of which are set as constants on most
call-sites (introduce severalfunction instad)
* boolean param (add two functions instead)
2020-08-19 17:53:41 +02:00
Aleksey Kladov
11a1bb1c3e Inline trivial function 2020-08-19 17:41:56 +02:00
Aleksey Kladov
a9778c6d73 Simplify 2020-08-19 17:37:19 +02:00
Aleksey Kladov
0b62b990ba Minor 2020-08-19 17:33:25 +02:00
Aleksey Kladov
422ac441c2 Minor cleanups 2020-08-19 17:31:26 +02:00
Aleksey Kladov
5da1dc9a8b Better name 2020-08-19 17:30:43 +02:00
Aleksey Kladov
61754678fb Better API factoring around self access modes 2020-08-19 17:02:50 +02:00
Aleksey Kladov
b9b4693ce3 Add SelfParam to code_model 2020-08-19 15:16:24 +02:00
bors[bot]
63ac896655
Merge #5811
5811: Minor
 r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-08-19 11:34:29 +00:00
Aleksey Kladov
80ea7f3c81 Minor 2020-08-19 13:33:51 +02:00
bors[bot]
529ca7e5e0
Merge #5643
5643: Add new consuming modifier, apply consuming and mutable to methods r=matklad a=Nashenas88

This adds a new `consuming` semantic modifier for syntax highlighters.

This also emits `mutable` and `consuming` in two cases:

- When a method takes `&mut self`, then it now has `function.mutable` emitted.
- When a method takes `self`, and the type of `Self` is not `Copy`, then `function.consuming` is emitted.

CC @flodiebold 

Co-authored-by: Paul Daniel Faria <Nashenas88@users.noreply.github.com>
2020-08-19 11:27:02 +00:00
Aleksey Kladov
27ccc95c60 Cleanup feature generation 2020-08-18 19:36:27 +02:00
bors[bot]
f18f9da7d8
Merge #5695
5695: Added completion for unstable features r=matklad a=Fihtangolz

Added xtask for downloading list of unstable features from the unstable book and codegen for it. Also included small changes from linter.

Co-authored-by: Dmitry <mamhigtt@gmail.com>
Co-authored-by: Dmitry Opokin <mamhigtt@gmail.com>
2020-08-18 16:49:06 +00:00
bors[bot]
aa2def023e
Merge #5804
5804: Add type safety to diagnostic codes
 r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-08-18 16:40:12 +00:00
Aleksey Kladov
8146669542 Add type safety to diagnostic codes 2020-08-18 18:39:43 +02:00
Aleksey Kladov
aa1a7a5414 Introduce Label 2020-08-18 16:50:07 +02:00
Aleksey Kladov
eb81731600 Minor 2020-08-18 16:22:01 +02:00