]>
git.lizzy.rs Git - rust.git/log
csmoe [Sun, 30 Dec 2018 13:51:40 +0000 (21:51 +0800)]
parse minus before number literal
bors[bot] [Thu, 27 Dec 2018 12:19:19 +0000 (12:19 +0000)]
Merge #325
325: implement translate_offset_with_edit r=matklad a=vemoo
- Implement `translate_offset_with_edit` to resolve #105
- Add proptest impls for text, offsets and edits and use them in tests for `translate_offset_with_edit` and `LineIndex`
- Added benchmark for `translate_offset_with_edit`
Co-authored-by: Bernardo <berublan@gmail.com>
bors[bot] [Thu, 27 Dec 2018 12:12:14 +0000 (12:12 +0000)]
Merge #339
339: Fix assertion error for literals with suffixes r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Thu, 27 Dec 2018 12:10:30 +0000 (15:10 +0300)]
fix suffix ranges
Aleksey Kladov [Thu, 27 Dec 2018 12:07:51 +0000 (15:07 +0300)]
dump validation errors
Aleksey Kladov [Thu, 27 Dec 2018 12:03:18 +0000 (15:03 +0300)]
support literal suffixes
Aleksey Kladov [Thu, 27 Dec 2018 11:42:46 +0000 (14:42 +0300)]
dedupe literal parsers
bors[bot] [Thu, 27 Dec 2018 10:39:59 +0000 (10:39 +0000)]
Merge #337
337: check edits in diagnostics r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Thu, 27 Dec 2018 10:35:08 +0000 (13:35 +0300)]
check edits in diagnostics
bors[bot] [Thu, 27 Dec 2018 10:08:34 +0000 (10:08 +0000)]
Merge #332
332: Struct types r=matklad a=flodiebold
Infer types for struct fields, and add basic field completions. There's also some code for enums, but I focused on getting structs working.
There's still ways to go before this becomes useful: There's no autoderef (or even reference types) and no inference for `self`, for example.
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
bors[bot] [Thu, 27 Dec 2018 10:04:36 +0000 (10:04 +0000)]
Merge #336
336: add cancelation module & cancelation backtraces r=matklad a=matklad
This is primaraly to debug semengly spurious canceled requests
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Thu, 27 Dec 2018 09:59:30 +0000 (12:59 +0300)]
add cancelation module & cancelation backtraces
Aleksey Kladov [Thu, 27 Dec 2018 09:54:59 +0000 (12:54 +0300)]
fix the test
Aleksey Kladov [Thu, 27 Dec 2018 09:35:40 +0000 (12:35 +0300)]
expose make_pub_crate action
bors[bot] [Thu, 27 Dec 2018 09:10:17 +0000 (09:10 +0000)]
Merge #334
334: use a::b::{self} should be fixed as use a::b instead of use a::b::self r=matklad a=gfreezy
Co-authored-by: gfreezy <gfreezy@gmail.com>
gfreezy [Wed, 26 Dec 2018 16:51:27 +0000 (00:51 +0800)]
fix use std::{self}
bors[bot] [Wed, 26 Dec 2018 16:10:39 +0000 (16:10 +0000)]
Merge #333
333: Fix unnecessary braces r=matklad a=gfreezy
![image](https://user-images.githubusercontent.com/510012/
50425015 -
c8086780 -08a9-11e9-995f-
d107d6880fa3 .png)
don't know why the underscore line is not covering the whole braces.
fix #324
Co-authored-by: gfreezy <gfreezy@gmail.com>
Florian Diebold [Tue, 25 Dec 2018 20:40:33 +0000 (21:40 +0100)]
Resolve field types lazily
I.e. not already when getting the HIR for the struct.
Bernardo [Tue, 25 Dec 2018 20:26:36 +0000 (21:26 +0100)]
test code and dependency cleanup
Florian Diebold [Tue, 25 Dec 2018 20:14:13 +0000 (21:14 +0100)]
Add a hir::TypeRef as an intermediate between ast::TypeRef and ty::Ty
Bernardo [Tue, 25 Dec 2018 19:49:18 +0000 (20:49 +0100)]
change to `TextEdit` to avoid allocation and sort
rename newline to step where applicable
Florian Diebold [Tue, 25 Dec 2018 16:17:39 +0000 (17:17 +0100)]
Implement reference / pointer types
- parse them
- infer types of & and * expressions
Bernardo [Mon, 24 Dec 2018 16:01:25 +0000 (17:01 +0100)]
remove benchmark and simplify tests
Bernardo [Sun, 23 Dec 2018 14:49:14 +0000 (15:49 +0100)]
use new translate_offset_with_edit for TryConvWith
doc comments
Bernardo [Sun, 23 Dec 2018 13:01:36 +0000 (14:01 +0100)]
add line_index proptest
Bernardo [Sat, 22 Dec 2018 21:11:10 +0000 (22:11 +0100)]
make criterion args work, small simplification
Bernardo [Sat, 22 Dec 2018 19:52:43 +0000 (20:52 +0100)]
fix arbitrary offset generation, col translation working
Bernardo [Sat, 22 Dec 2018 14:44:27 +0000 (15:44 +0100)]
column translation implemented but not quite working yet
Bernardo [Sat, 22 Dec 2018 11:59:48 +0000 (12:59 +0100)]
iterate over `Step`s which are either, newlines or multibyte chars
Bernardo [Fri, 21 Dec 2018 19:11:27 +0000 (20:11 +0100)]
simplify newline check with macro
Bernardo [Fri, 21 Dec 2018 17:51:31 +0000 (18:51 +0100)]
remove slower impl, add benchmarks
Bernardo [Fri, 21 Dec 2018 17:38:28 +0000 (18:38 +0100)]
final iteration, faster a bit simpler
the main thing is we iterate over inserted newlines at once for each edit
Bernardo [Wed, 19 Dec 2018 18:25:42 +0000 (19:25 +0100)]
simplified version
Bernardo [Tue, 18 Dec 2018 17:46:54 +0000 (18:46 +0100)]
move translate_offset_with_edit to ra_editor
Bernardo [Mon, 17 Dec 2018 19:13:54 +0000 (20:13 +0100)]
initial newline translation working
todo:
cleanup, simplify
handle columns
Bernardo [Fri, 14 Dec 2018 17:00:35 +0000 (18:00 +0100)]
test translate_offset_with_edit against simple impl for single edits
Bernardo [Wed, 12 Dec 2018 18:25:50 +0000 (19:25 +0100)]
simplify and reduce number of values explored
Bernardo [Wed, 12 Dec 2018 17:51:43 +0000 (18:51 +0100)]
proptest strategies for TextUnit and AtomTextEdit
gfreezy [Tue, 25 Dec 2018 17:00:27 +0000 (01:00 +0800)]
fix tests
Florian Diebold [Tue, 25 Dec 2018 16:55:50 +0000 (17:55 +0100)]
Handle structs/enums with missing names a bit better
gfreezy [Tue, 25 Dec 2018 16:45:13 +0000 (00:45 +0800)]
add fix for removing unnecessary braces in use statements
Florian Diebold [Tue, 25 Dec 2018 16:43:58 +0000 (17:43 +0100)]
Determine receiver for completion in a more robust way
Also rename a parameter.
Florian Diebold [Tue, 25 Dec 2018 14:44:10 +0000 (15:44 +0100)]
Cleanup
Florian Diebold [Tue, 25 Dec 2018 14:20:37 +0000 (15:20 +0100)]
Add . to trigger characters
Florian Diebold [Tue, 25 Dec 2018 14:15:40 +0000 (15:15 +0100)]
Implement basic completion for fields
Florian Diebold [Tue, 25 Dec 2018 13:48:54 +0000 (14:48 +0100)]
Improve parsing of incomplete field accesses in preparation for field completion
We need to be able to get the receiver even if there is no field name yet, and
currently "a." wouldn't get parsed as a field name at all. This seems to help.
Florian Diebold [Tue, 25 Dec 2018 12:54:38 +0000 (13:54 +0100)]
Type field accesses
Florian Diebold [Tue, 25 Dec 2018 12:31:30 +0000 (13:31 +0100)]
Collect field data for structs/enum variants
Florian Diebold [Tue, 25 Dec 2018 12:01:47 +0000 (13:01 +0100)]
Add AST definitions for struct/variant fields etc.
Fixes #117
Florian Diebold [Mon, 24 Dec 2018 20:00:14 +0000 (21:00 +0100)]
Infer result of struct literals, and recurse into their child expressions
Florian Diebold [Mon, 24 Dec 2018 19:32:39 +0000 (20:32 +0100)]
Do name resolution by namespace (types/values)
Florian Diebold [Mon, 24 Dec 2018 18:07:48 +0000 (19:07 +0100)]
Add basic HIR and types for structs/enums
bors[bot] [Tue, 25 Dec 2018 10:40:42 +0000 (10:40 +0000)]
Merge #331
331: Cancelled is not Copy r=matklad a=matklad
I'd love to have a backtrace in `Cancelled` to be able to debug "completion is always cancelled" problem. So it probably is a good idea to make `Cancelled` non Copy type, even if it is a ZST in prod.
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Tue, 25 Dec 2018 10:36:39 +0000 (13:36 +0300)]
cancelled is not Copy
bors[bot] [Mon, 24 Dec 2018 23:18:10 +0000 (23:18 +0000)]
Merge #328
328: fix warning conversion r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Mon, 24 Dec 2018 23:07:30 +0000 (02:07 +0300)]
fix warning conversion
bors[bot] [Mon, 24 Dec 2018 18:39:31 +0000 (18:39 +0000)]
Merge #326
326: resolved #324: remove unnecessary braces in use statement. r=matklad a=gfreezy
Add inspection for unnecessary braces in use statement
Co-authored-by: gfreezy <gfreezy@gmail.com>
gfreezy [Mon, 24 Dec 2018 15:01:16 +0000 (23:01 +0800)]
fix tests
gfreezy [Mon, 24 Dec 2018 15:00:18 +0000 (23:00 +0800)]
remove option from Diagnostic
gfreezy [Mon, 24 Dec 2018 14:48:46 +0000 (22:48 +0800)]
keep severity to Error & WeakWarning
bors[bot] [Mon, 24 Dec 2018 14:40:11 +0000 (14:40 +0000)]
Merge #327
327: Beginnings of type inference r=flodiebold a=flodiebold
I was a bit bored, so I thought I'd try to start implementing the type system and see how far I come :wink: This is obviously still extremely WIP, only very basic stuff working, but I thought I'd post this now to get some feedback as to whether this approach makes sense at all.
There's no user-visible effect yet, but the type inference has tests similar to the ones for the parser. My next step will probably be to implement struct types, after which this could probably be used to complete fields.
I realize this may all get thrown away when/if the compiler query system gets usable, but I feel like there are lots of IDE features that could be implemented with somewhat working type inference in the meantime :smile:
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
Florian Diebold [Mon, 24 Dec 2018 14:36:54 +0000 (15:36 +0100)]
Change inference tests to have one per file
Florian Diebold [Mon, 24 Dec 2018 14:19:49 +0000 (15:19 +0100)]
Rename a variable for consistency
Florian Diebold [Mon, 24 Dec 2018 14:17:34 +0000 (15:17 +0100)]
Clean up Ty a bit
Removing irrelevant comments copied from rustc etc.
bors[bot] [Mon, 24 Dec 2018 13:51:27 +0000 (13:51 +0000)]
Merge #278
278: Add make_pub_crate code action to ra_editor r=matklad a=h-michael
implement #170
Co-authored-by: Hirokazu Hata <h.hata.ai.t@gmail.com>
bors[bot] [Mon, 24 Dec 2018 13:47:27 +0000 (13:47 +0000)]
Merge #302
302: WIP: Support tracing lsp requests. r=DJMcNab a=DJMcNab
EDIT: We need to work out a better way to handle settings before this can be merged. Help wanted
TODO: Debug why decorations are sent even when highlightingOn is disabled
This makes the log volume so high its impossible to work with anyway.
(Continuation of #84 [#99 only disabled using it, not making sure we don't send it]).
These logs can be used in https://microsoft.github.io/language-server-protocol/inspector/
Co-authored-by: DJMcNab <36049421+djmcnab@users.noreply.github.com>
DJMcNab [Mon, 24 Dec 2018 13:43:08 +0000 (13:43 +0000)]
Add a very hacky workaround to not trace decorations requests
Hirokazu Hata [Sun, 16 Dec 2018 09:17:33 +0000 (18:17 +0900)]
Add make_pub_crate code action to ra_editor
Florian Diebold [Sun, 23 Dec 2018 16:33:02 +0000 (17:33 +0100)]
Prepare Ty::new for resolution
gfreezy [Sun, 23 Dec 2018 16:40:36 +0000 (00:40 +0800)]
remove unnecessary braces in use statments
gfreezy [Sun, 23 Dec 2018 16:39:33 +0000 (00:39 +0800)]
add serverity to vscode diagnostics
Florian Diebold [Sun, 23 Dec 2018 16:16:47 +0000 (17:16 +0100)]
Type the return values of call expressions
Florian Diebold [Sun, 23 Dec 2018 16:13:11 +0000 (17:13 +0100)]
Resolve paths to defs (functions currently) during type inference
gfreezy [Sun, 23 Dec 2018 15:50:11 +0000 (23:50 +0800)]
resolved #324: remove unnecessary braces in use statement.
Florian Diebold [Sun, 23 Dec 2018 12:22:29 +0000 (13:22 +0100)]
Make let statements kind of work
Florian Diebold [Sun, 23 Dec 2018 11:59:38 +0000 (12:59 +0100)]
Remove unwraps
Florian Diebold [Sun, 23 Dec 2018 11:54:53 +0000 (12:54 +0100)]
Get rid of the terrible nesting in PathExpr inference
Florian Diebold [Sun, 23 Dec 2018 11:15:46 +0000 (12:15 +0100)]
Cleanup
Florian Diebold [Sun, 23 Dec 2018 11:05:54 +0000 (12:05 +0100)]
Add testing infrastructure for type inference
- move dir_tests to test_utils for that.
Florian Diebold [Sat, 22 Dec 2018 21:17:55 +0000 (22:17 +0100)]
Parse integer / float types
Florian Diebold [Thu, 20 Dec 2018 20:56:28 +0000 (21:56 +0100)]
Add beginnings of type infrastructure
DJMcNab [Sun, 23 Dec 2018 11:10:12 +0000 (11:10 +0000)]
Improve comment
bors[bot] [Sat, 22 Dec 2018 14:48:18 +0000 (14:48 +0000)]
Merge #310
310: When constructing a crate graph, detect and forbid cycles. r=matklad a=gfreezy
fixed #300
Co-authored-by: gfreezy <gfreezy@gmail.com>
gfreezy [Sat, 22 Dec 2018 14:40:41 +0000 (22:40 +0800)]
mark as visited on entry instead of left
bors[bot] [Sat, 22 Dec 2018 13:47:27 +0000 (13:47 +0000)]
Merge #323
323: workaround salsa/parking-log bug r=matklad a=matklad
https://github.com/salsa-rs/salsa/issues/99
https://github.com/Amanieu/parking_lot/issues/101
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sat, 22 Dec 2018 13:45:57 +0000 (16:45 +0300)]
workaround salsa/parking-log bug
https://github.com/salsa-rs/salsa/issues/99
https://github.com/Amanieu/parking_lot/issues/101
bors[bot] [Sat, 22 Dec 2018 13:34:04 +0000 (13:34 +0000)]
Merge #322
322: Fix analyzer extension fail when there are enabled any VIM extension r=matklad a=max-frai
`type` command is allowed only once to be registered and it was built specially for vim mode.
So if user has vim extension enabled, rust-analyzer initialization failes on trying to register own `type` handler.
Unfortunatelly, there are no nice ways to check if command is already registered so the way is to wrap everything with try/catch and notify user about conflict.
Co-authored-by: frai <me@maxfrai.com>
frai [Sat, 22 Dec 2018 13:26:18 +0000 (15:26 +0200)]
Fix analyzer extension fail when there are enabled any VIM extension.
Aleksey Kladov [Sat, 22 Dec 2018 12:09:08 +0000 (15:09 +0300)]
less chatty logging
bors[bot] [Sat, 22 Dec 2018 09:47:54 +0000 (09:47 +0000)]
Merge #321
321: More useful logging r=matklad a=matklad
Try not to log *huge* messages, to make logging more useful.
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sat, 22 Dec 2018 09:13:20 +0000 (12:13 +0300)]
less verbose debug
Aleksey Kladov [Sat, 22 Dec 2018 08:57:42 +0000 (11:57 +0300)]
less verbose debug for library data
Aleksey Kladov [Sat, 22 Dec 2018 08:48:49 +0000 (11:48 +0300)]
log times
bors[bot] [Sat, 22 Dec 2018 08:01:49 +0000 (08:01 +0000)]
Merge #320
320: completion uses hir scopes r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sat, 22 Dec 2018 08:01:03 +0000 (11:01 +0300)]
completion uses hir scopes
gfreezy [Sat, 22 Dec 2018 07:30:58 +0000 (15:30 +0800)]
not visit the same crateId only once
bors[bot] [Fri, 21 Dec 2018 23:28:47 +0000 (23:28 +0000)]
Merge #319
319: Completion icons r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Fri, 21 Dec 2018 23:28:09 +0000 (02:28 +0300)]
fix snippet icon
Aleksey Kladov [Fri, 21 Dec 2018 23:24:59 +0000 (02:24 +0300)]
binding icon
Aleksey Kladov [Fri, 21 Dec 2018 23:23:25 +0000 (02:23 +0300)]
debug pring