]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoparse minus before number literal
csmoe [Sun, 30 Dec 2018 13:51:40 +0000 (21:51 +0800)]
parse minus before number literal

5 years agoMerge #325
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>
5 years agoMerge #339
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>
5 years agofix suffix ranges
Aleksey Kladov [Thu, 27 Dec 2018 12:10:30 +0000 (15:10 +0300)]
fix suffix ranges

5 years agodump validation errors
Aleksey Kladov [Thu, 27 Dec 2018 12:07:51 +0000 (15:07 +0300)]
dump validation errors

5 years agosupport literal suffixes
Aleksey Kladov [Thu, 27 Dec 2018 12:03:18 +0000 (15:03 +0300)]
support literal suffixes

5 years agodedupe literal parsers
Aleksey Kladov [Thu, 27 Dec 2018 11:42:46 +0000 (14:42 +0300)]
dedupe literal parsers

5 years agoMerge #337
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>
5 years agocheck edits in diagnostics
Aleksey Kladov [Thu, 27 Dec 2018 10:35:08 +0000 (13:35 +0300)]
check edits in diagnostics

5 years agoMerge #332
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>
5 years agoMerge #336
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>
5 years agoadd cancelation module & cancelation backtraces
Aleksey Kladov [Thu, 27 Dec 2018 09:59:30 +0000 (12:59 +0300)]
add cancelation module & cancelation backtraces

5 years agofix the test
Aleksey Kladov [Thu, 27 Dec 2018 09:54:59 +0000 (12:54 +0300)]
fix the test

5 years agoexpose make_pub_crate action
Aleksey Kladov [Thu, 27 Dec 2018 09:35:40 +0000 (12:35 +0300)]
expose make_pub_crate action

5 years agoMerge #334
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>
5 years agofix use std::{self}
gfreezy [Wed, 26 Dec 2018 16:51:27 +0000 (00:51 +0800)]
fix use std::{self}

5 years agoMerge #333
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>
5 years agoResolve field types lazily
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.

5 years agotest code and dependency cleanup
Bernardo [Tue, 25 Dec 2018 20:26:36 +0000 (21:26 +0100)]
test code and dependency cleanup

5 years agoAdd a hir::TypeRef as an intermediate between ast::TypeRef and ty::Ty
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

5 years agochange to `TextEdit` to avoid allocation and sort
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

5 years agoImplement reference / pointer types
Florian Diebold [Tue, 25 Dec 2018 16:17:39 +0000 (17:17 +0100)]
Implement reference / pointer types

 - parse them
 - infer types of & and * expressions

5 years agoremove benchmark and simplify tests
Bernardo [Mon, 24 Dec 2018 16:01:25 +0000 (17:01 +0100)]
remove benchmark and simplify tests

5 years agouse new translate_offset_with_edit for TryConvWith
Bernardo [Sun, 23 Dec 2018 14:49:14 +0000 (15:49 +0100)]
use new translate_offset_with_edit for TryConvWith
doc comments

5 years agoadd line_index proptest
Bernardo [Sun, 23 Dec 2018 13:01:36 +0000 (14:01 +0100)]
add line_index proptest

5 years agomake criterion args work, small simplification
Bernardo [Sat, 22 Dec 2018 21:11:10 +0000 (22:11 +0100)]
make criterion args work, small simplification

5 years agofix arbitrary offset generation, col translation working
Bernardo [Sat, 22 Dec 2018 19:52:43 +0000 (20:52 +0100)]
fix arbitrary offset generation, col translation working

5 years agocolumn translation implemented but not quite working yet
Bernardo [Sat, 22 Dec 2018 14:44:27 +0000 (15:44 +0100)]
column translation implemented but not quite working yet

5 years agoiterate over `Step`s which are either, newlines or multibyte chars
Bernardo [Sat, 22 Dec 2018 11:59:48 +0000 (12:59 +0100)]
iterate over `Step`s which are either, newlines or multibyte chars

5 years agosimplify newline check with macro
Bernardo [Fri, 21 Dec 2018 19:11:27 +0000 (20:11 +0100)]
simplify newline check with macro

5 years agoremove slower impl, add benchmarks
Bernardo [Fri, 21 Dec 2018 17:51:31 +0000 (18:51 +0100)]
remove slower impl, add benchmarks

5 years agofinal iteration, faster a bit simpler
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

5 years agosimplified version
Bernardo [Wed, 19 Dec 2018 18:25:42 +0000 (19:25 +0100)]
simplified version

5 years agomove translate_offset_with_edit to ra_editor
Bernardo [Tue, 18 Dec 2018 17:46:54 +0000 (18:46 +0100)]
move translate_offset_with_edit to ra_editor

5 years agoinitial newline translation working
Bernardo [Mon, 17 Dec 2018 19:13:54 +0000 (20:13 +0100)]
initial newline translation working
todo:
cleanup, simplify
handle columns

5 years agotest translate_offset_with_edit against simple impl for single edits
Bernardo [Fri, 14 Dec 2018 17:00:35 +0000 (18:00 +0100)]
test translate_offset_with_edit against simple impl for single edits

5 years agosimplify and reduce number of values explored
Bernardo [Wed, 12 Dec 2018 18:25:50 +0000 (19:25 +0100)]
simplify and reduce number of values explored

5 years agoproptest strategies for TextUnit and AtomTextEdit
Bernardo [Wed, 12 Dec 2018 17:51:43 +0000 (18:51 +0100)]
proptest strategies for TextUnit and AtomTextEdit

5 years agofix tests
gfreezy [Tue, 25 Dec 2018 17:00:27 +0000 (01:00 +0800)]
fix tests

5 years agoHandle structs/enums with missing names a bit better
Florian Diebold [Tue, 25 Dec 2018 16:55:50 +0000 (17:55 +0100)]
Handle structs/enums with missing names a bit better

5 years agoadd fix for removing unnecessary braces in use statements
gfreezy [Tue, 25 Dec 2018 16:45:13 +0000 (00:45 +0800)]
add fix for removing unnecessary braces in use statements

5 years agoDetermine receiver for completion in a more robust way
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.

5 years agoCleanup
Florian Diebold [Tue, 25 Dec 2018 14:44:10 +0000 (15:44 +0100)]
Cleanup

5 years agoAdd . to trigger characters
Florian Diebold [Tue, 25 Dec 2018 14:20:37 +0000 (15:20 +0100)]
Add . to trigger characters

5 years agoImplement basic completion for fields
Florian Diebold [Tue, 25 Dec 2018 14:15:40 +0000 (15:15 +0100)]
Implement basic completion for fields

5 years agoImprove parsing of incomplete field accesses in preparation for field completion
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.

5 years agoType field accesses
Florian Diebold [Tue, 25 Dec 2018 12:54:38 +0000 (13:54 +0100)]
Type field accesses

5 years agoCollect field data for structs/enum variants
Florian Diebold [Tue, 25 Dec 2018 12:31:30 +0000 (13:31 +0100)]
Collect field data for structs/enum variants

5 years agoAdd AST definitions for struct/variant fields etc.
Florian Diebold [Tue, 25 Dec 2018 12:01:47 +0000 (13:01 +0100)]
Add AST definitions for struct/variant fields etc.

Fixes #117

5 years agoInfer result of struct literals, and recurse into their child expressions
Florian Diebold [Mon, 24 Dec 2018 20:00:14 +0000 (21:00 +0100)]
Infer result of struct literals, and recurse into their child expressions

5 years agoDo name resolution by namespace (types/values)
Florian Diebold [Mon, 24 Dec 2018 19:32:39 +0000 (20:32 +0100)]
Do name resolution by namespace (types/values)

5 years agoAdd basic HIR and types for structs/enums
Florian Diebold [Mon, 24 Dec 2018 18:07:48 +0000 (19:07 +0100)]
Add basic HIR and types for structs/enums

5 years agoMerge #331
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>
5 years agocancelled is not Copy
Aleksey Kladov [Tue, 25 Dec 2018 10:36:39 +0000 (13:36 +0300)]
cancelled is not Copy

5 years agoMerge #328
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>
5 years agofix warning conversion
Aleksey Kladov [Mon, 24 Dec 2018 23:07:30 +0000 (02:07 +0300)]
fix warning conversion

5 years agoMerge #326
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>
5 years agofix tests
gfreezy [Mon, 24 Dec 2018 15:01:16 +0000 (23:01 +0800)]
fix tests

5 years agoremove option from Diagnostic
gfreezy [Mon, 24 Dec 2018 15:00:18 +0000 (23:00 +0800)]
remove option from Diagnostic

5 years agokeep severity to Error & WeakWarning
gfreezy [Mon, 24 Dec 2018 14:48:46 +0000 (22:48 +0800)]
keep severity to Error & WeakWarning

5 years agoMerge #327
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>
5 years agoChange inference tests to have one per file
Florian Diebold [Mon, 24 Dec 2018 14:36:54 +0000 (15:36 +0100)]
Change inference tests to have one per file

5 years agoRename a variable for consistency
Florian Diebold [Mon, 24 Dec 2018 14:19:49 +0000 (15:19 +0100)]
Rename a variable for consistency

5 years agoClean up Ty a bit
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.

5 years agoMerge #278
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>
5 years agoMerge #302
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>
5 years agoAdd a very hacky workaround to not trace decorations requests
DJMcNab [Mon, 24 Dec 2018 13:43:08 +0000 (13:43 +0000)]
Add a very hacky workaround to not trace decorations requests

5 years agoAdd make_pub_crate code action to ra_editor
Hirokazu Hata [Sun, 16 Dec 2018 09:17:33 +0000 (18:17 +0900)]
Add make_pub_crate code action to ra_editor

5 years agoPrepare Ty::new for resolution
Florian Diebold [Sun, 23 Dec 2018 16:33:02 +0000 (17:33 +0100)]
Prepare Ty::new for resolution

5 years agoremove unnecessary braces in use statments
gfreezy [Sun, 23 Dec 2018 16:40:36 +0000 (00:40 +0800)]
remove unnecessary braces in use statments

5 years agoadd serverity to vscode diagnostics
gfreezy [Sun, 23 Dec 2018 16:39:33 +0000 (00:39 +0800)]
add serverity to vscode diagnostics

5 years agoType the return values of call expressions
Florian Diebold [Sun, 23 Dec 2018 16:16:47 +0000 (17:16 +0100)]
Type the return values of call expressions

5 years agoResolve paths to defs (functions currently) during type inference
Florian Diebold [Sun, 23 Dec 2018 16:13:11 +0000 (17:13 +0100)]
Resolve paths to defs (functions currently) during type inference

5 years agoresolved #324: remove unnecessary braces in use statement.
gfreezy [Sun, 23 Dec 2018 15:50:11 +0000 (23:50 +0800)]
resolved #324: remove unnecessary braces in use statement.

5 years agoMake let statements kind of work
Florian Diebold [Sun, 23 Dec 2018 12:22:29 +0000 (13:22 +0100)]
Make let statements kind of work

5 years agoRemove unwraps
Florian Diebold [Sun, 23 Dec 2018 11:59:38 +0000 (12:59 +0100)]
Remove unwraps

5 years agoGet rid of the terrible nesting in PathExpr inference
Florian Diebold [Sun, 23 Dec 2018 11:54:53 +0000 (12:54 +0100)]
Get rid of the terrible nesting in PathExpr inference

5 years agoCleanup
Florian Diebold [Sun, 23 Dec 2018 11:15:46 +0000 (12:15 +0100)]
Cleanup

5 years agoAdd testing infrastructure for type inference
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.

5 years agoParse integer / float types
Florian Diebold [Sat, 22 Dec 2018 21:17:55 +0000 (22:17 +0100)]
Parse integer / float types

5 years agoAdd beginnings of type infrastructure
Florian Diebold [Thu, 20 Dec 2018 20:56:28 +0000 (21:56 +0100)]
Add beginnings of type infrastructure

5 years agoImprove comment
DJMcNab [Sun, 23 Dec 2018 11:10:12 +0000 (11:10 +0000)]
Improve comment

5 years agoMerge #310
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>
5 years agomark as visited on entry instead of left
gfreezy [Sat, 22 Dec 2018 14:40:41 +0000 (22:40 +0800)]
mark as visited on entry instead of left

5 years agoMerge #323
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>
5 years agoworkaround salsa/parking-log bug
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

5 years agoMerge #322
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>
5 years agoFix analyzer extension fail when there are enabled any VIM extension.
frai [Sat, 22 Dec 2018 13:26:18 +0000 (15:26 +0200)]
Fix analyzer extension fail when there are enabled any VIM extension.

5 years agoless chatty logging
Aleksey Kladov [Sat, 22 Dec 2018 12:09:08 +0000 (15:09 +0300)]
less chatty logging

5 years agoMerge #321
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>
5 years agoless verbose debug
Aleksey Kladov [Sat, 22 Dec 2018 09:13:20 +0000 (12:13 +0300)]
less verbose debug

5 years agoless verbose debug for library data
Aleksey Kladov [Sat, 22 Dec 2018 08:57:42 +0000 (11:57 +0300)]
less verbose debug for library data

5 years agolog times
Aleksey Kladov [Sat, 22 Dec 2018 08:48:49 +0000 (11:48 +0300)]
log times

5 years agoMerge #320
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>
5 years agocompletion uses hir scopes
Aleksey Kladov [Sat, 22 Dec 2018 08:01:03 +0000 (11:01 +0300)]
completion uses hir scopes

5 years agonot visit the same crateId only once
gfreezy [Sat, 22 Dec 2018 07:30:58 +0000 (15:30 +0800)]
not visit the same crateId only once

5 years agoMerge #319
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>
5 years agofix snippet icon
Aleksey Kladov [Fri, 21 Dec 2018 23:28:09 +0000 (02:28 +0300)]
fix snippet icon

5 years agobinding icon
Aleksey Kladov [Fri, 21 Dec 2018 23:24:59 +0000 (02:24 +0300)]
binding icon

5 years agodebug pring
Aleksey Kladov [Fri, 21 Dec 2018 23:23:25 +0000 (02:23 +0300)]
debug pring