Aleksey Kladov
109a7f3717
itroduce FunctionDescriptor
2018-11-27 22:58:09 +03:00
Aleksey Kladov
f4d0cb64fc
rename descriptorsdb -> hirdb
2018-11-27 21:58:44 +03:00
Aleksey Kladov
d659b7a2f0
start descriptors -> hir rename
2018-11-27 21:45:42 +03:00
Aleksey Kladov
192e2bbb0e
resolve_path works with DefIds
2018-11-27 19:56:03 +03:00
Aleksey Kladov
aa7fd563a4
use ctry
2018-11-27 18:45:16 +03:00
Aleksey Kladov
f4860870da
scope-based resolve path
2018-11-27 18:25:35 +03:00
Aleksey Kladov
68f66e0f44
add db to resolve_path
2018-11-27 18:25:35 +03:00
Aleksey Kladov
5b0e347f89
Make resolve_path cancelable
2018-11-27 18:25:35 +03:00
Aleksey Kladov
6bb06addf8
don't use volatile queries
...
"volatile" means "changes every time". That is, all transitive
rev-deps of volatile queries will be executed every time. We actually
need "dependencies".
2018-11-27 17:39:58 +03:00
Aleksey Kladov
10f4d4b74c
Make nameresolution resilient to reparsing
...
We now store item id's instead of local syntax ptrs, and item ids
don't change if you type inside a single function.
2018-11-27 15:02:06 +03:00
Aleksey Kladov
4d87799a4a
implement file_items
2018-11-27 15:01:52 +03:00
Aleksey Kladov
16cdd126b6
add file items query
2018-11-27 15:01:52 +03:00
bors[bot]
8e37208040
Merge #244
...
244: Switch to id-arena r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2018-11-27 11:23:29 +00:00
Aleksey Kladov
ed023929d5
Switch to id-arena
2018-11-27 14:23:06 +03:00
Aleksey Kladov
6b1f30ade9
hack around nested libraries
2018-11-27 00:12:43 +03:00
Aleksey Kladov
b6fcd46278
Codify Arena pattern
2018-11-25 19:02:14 +03:00
Aleksey Kladov
ebc4e75253
switch back to the latest beta
2018-11-24 21:52:49 +03:00
Aleksey Kladov
955d2eea45
add test loggin API to db
2018-11-21 20:44:05 +03:00
Aleksey Kladov
e8c50f0915
Use :
as a trigger character for completion
...
Note that VSCode asks for completion after *first* `:` as well:
use crate:
we use hacks to protect against that, and to give completions only
after the second `:`.
2018-11-21 19:06:48 +03:00
Aleksey Kladov
edeec6a414
Complete paths after ::
2018-11-21 18:34:20 +03:00
Aleksey Kladov
7ffc7d3308
Move path completion to descriptors
2018-11-21 18:20:44 +03:00
Aleksey Kladov
11f19b7849
name res uses paths
2018-11-21 17:51:02 +03:00
Aleksey Kladov
5a87a24f82
move Path
2018-11-21 17:18:26 +03:00
Aleksey Kladov
18000ba864
docs
2018-11-21 17:07:44 +03:00
Aleksey Kladov
d47075af52
move path to descriptors
2018-11-21 16:16:54 +03:00
Aleksey Kladov
8954d4dc67
Introduce Import struct
2018-11-21 16:15:15 +03:00
Aleksey Kladov
82c088137a
Remove import_resolutions
...
It's cheaper to re-query this info anyway
2018-11-21 16:02:34 +03:00
Aleksey Kladov
5a61b218f8
Pin to older beta
...
https://github.com/rust-lang/rust/issues/56128
2018-11-21 14:47:19 +03:00
Aleksey Kladov
049f8df93c
switch completion to new scope
2018-11-21 12:57:05 +03:00
Aleksey Kladov
b70b6bce19
Move to top
2018-11-21 11:35:25 +03:00
Aleksey Kladov
ff75ad13a4
Measure time
2018-11-21 11:18:43 +03:00
Aleksey Kladov
02c4f82348
simple test for item map
2018-11-21 11:16:46 +03:00
Aleksey Kladov
36aad85138
add item map query
2018-11-21 00:39:50 +03:00
Aleksey Kladov
9bb11aee44
populate resolve from unresolved imports
2018-11-21 00:31:12 +03:00
Aleksey Kladov
aab71bff8e
move to method
2018-11-20 23:36:53 +03:00
Aleksey Kladov
cc8163439f
populate modules
2018-11-20 21:50:22 +03:00
Aleksey Kladov
1cf92c3e28
remember spans with paths
2018-11-20 21:17:14 +03:00
Aleksey Kladov
c54b51fded
add DefId
2018-11-20 21:12:15 +03:00
Aleksey Kladov
8086107b6a
implement path conversion
2018-11-20 19:40:37 +03:00
Aleksey Kladov
bcdcfa9df2
Some import resolution boilerplate
2018-11-20 19:24:58 +03:00
Aleksey Kladov
5f8068cea8
make mod private
2018-11-20 18:34:10 +03:00
Aleksey Kladov
a2fdb41ace
fix typo
2018-11-20 17:33:27 +03:00
Aleksey Kladov
8fc51501e0
Remove ModId
2018-11-20 17:23:17 +03:00
Aleksey Kladov
1913bedc2e
Make more stuff private
2018-11-20 17:21:00 +03:00
Aleksey Kladov
a300fb68e2
Make most of modules impl private
2018-11-20 17:16:33 +03:00
Aleksey Kladov
0dd26a2f5b
Use OO module API in completion
2018-11-20 17:08:40 +03:00
Aleksey Kladov
21508cfb2f
Use OO API instead of resolve_module
2018-11-20 16:55:35 +03:00
Aleksey Kladov
0ab3c65d98
Use OO API in crate_for
2018-11-20 16:40:15 +03:00
Aleksey Kladov
d475e3b29f
Make LikdId private
2018-11-20 16:24:47 +03:00
Aleksey Kladov
3b8d0c215a
Use more OO API for parent module
2018-11-20 16:21:02 +03:00
Aleksey Kladov
099da13f53
Make some queries private
...
Convention: we prefix private queries with `_` until salsa support
real visibility.
2018-11-20 14:58:01 +03:00
Aleksey Kladov
4e683d7af1
Add ModId
2018-11-20 14:52:10 +03:00
Aleksey Kladov
4e48917c00
use loc2id for FnIds
2018-11-18 16:21:23 +03:00
Aleksey Kladov
cb22a799d6
Add Loc2IdMap
2018-11-18 15:44:24 +03:00
Adolfo Ochagavía
acd51cb361
cargo format
2018-11-16 12:16:20 +01:00
Adolfo Ochagavía
bccbee5ba3
Rename col to col_utf16
2018-11-16 12:15:50 +01:00
Adolfo Ochagavía
136d1864bc
Support UTF-16 chars in LineIndex
2018-11-16 12:15:50 +01:00
Adolfo Ochagavía
c96bfe7e2d
Split string lexing and run rustfmt
2018-11-11 21:00:31 +01:00
Adolfo Ochagavía
30cd4d5acb
Validate byte string literals
2018-11-11 20:41:43 +01:00
Adolfo Ochagavía
c258b4fdb0
Add validator for byte
2018-11-11 20:27:00 +01:00
Adolfo Ochagavía
a4f7d7a7cd
Fix typos
2018-11-11 19:28:55 +01:00
Adolfo Ochagavía
3b4c02c19e
Validate string literals
2018-11-09 14:52:17 +01:00
Aleksey Kladov
8475c962a0
Fix the test
2018-11-08 18:54:19 +03:00
Aleksey Kladov
00e80b24e3
workspace-symbols function for Emacs
2018-11-08 18:43:02 +03:00
Aleksey Kladov
c69ff08dc9
eglot worksapce symbol
2018-11-08 17:40:24 +03:00
Aleksey Kladov
6d253b58da
Complete paths in use trees
2018-11-07 21:38:41 +03:00
Aleksey Kladov
06fbc6e3ed
Do more work in classify
2018-11-07 21:17:18 +03:00
Aleksey Kladov
397c235086
Use cached module scopes for completion
2018-11-07 21:08:11 +03:00
Aleksey Kladov
9b88ec488b
split completion mod
2018-11-07 20:34:16 +03:00
Aleksey Kladov
af17fc9697
reorganize completion
2018-11-07 19:50:17 +03:00
Aleksey Kladov
22949dab26
rename module source
2018-11-07 18:42:36 +03:00
Aleksey Kladov
2ed1514df3
rename ROOT -> SOURCE_FILE
2018-11-07 18:42:36 +03:00
Aleksey Kladov
f8b36bbc3b
Rename File -> SourceFileNode
2018-11-07 18:42:36 +03:00
Jeremy A. Kolb
2119fe2143
Cargo update
2018-11-07 18:42:09 +03:00
Jeremy A. Kolb
c29f158c20
Rustfmt to pass CI
2018-11-07 18:24:55 +03:00
Jeremy A. Kolb
a83ed374d0
Remove unused variable
2018-11-07 18:24:55 +03:00
Jeremy A. Kolb
8ccd26adf3
Show documentation for hover requests
2018-11-07 18:24:55 +03:00
Jeremy A. Kolb
6df71da81f
Add some more DocCommentsOwner
2018-11-07 18:24:55 +03:00
bors[bot]
2e2445444a
Merge #207
...
207: Finish implementing char validation r=aochagavia a=aochagavia
The only thing missing right now are good integration tests (and maybe more descriptive error messages)
Co-authored-by: Adolfo Ochagavía <github@adolfo.ochagavia.xyz>
2018-11-07 11:09:40 +00:00
Adolfo Ochagavía
433a806191
Fix backslash escape
2018-11-07 12:04:26 +01:00
Adolfo Ochagavía
3b2ba59526
Use ArrayString instead of hand rolled data structure
2018-11-07 11:58:34 +01:00
Adolfo Ochagavía
e37ba706cc
cargo format
2018-11-07 11:41:42 +01:00
Adolfo Ochagavía
94796e6447
Add lots of tests
2018-11-07 11:35:33 +01:00
Adolfo Ochagavía
fdb9f06880
Store hex digits in a stack-allocated buffer
2018-11-07 10:40:58 +01:00
Aleksey Kladov
8eaf7952ae
ra_syntax::File is just RootNode
2018-11-06 23:26:26 +03:00
Aleksey Kladov
7f88fe8790
Add a pinch of comments
2018-11-06 22:06:58 +03:00
Aleksey Kladov
a5301e94d5
Generalize Owned nodes
2018-11-06 21:52:00 +03:00
Aleksey Kladov
ec131b6c7b
grammar: fix where clause parsing
...
closes #205
2018-11-06 21:19:32 +03:00
Aleksey Kladov
dafe747dcc
upstream basic tree algorithms to rowan
2018-11-06 20:56:32 +03:00
Adolfo Ochagavía
c56db92d1f
Finish implementing char validation
2018-11-06 17:07:27 +01:00
Jeremy A. Kolb
5a9d471f98
Use closing paren as a trigger character
...
This seems counter-intuitive based on the concept of "trigger character"
but it provides a better function signature experience.
2018-11-05 17:13:56 -05:00
bors[bot]
f605f6e70a
Merge #188
...
188: Introduce `SyntaxErrorKind` and `TextRange` to `SyntaxError` r=matklad a=aochagavia
Co-authored-by: Adolfo Ochagavía <aochagavia92@gmail.com>
Co-authored-by: Adolfo Ochagavía <github@adolfo.ochagavia.xyz>
2018-11-05 21:32:25 +00:00
Adolfo Ochagavía
59405bfe4a
cargo format
2018-11-05 22:29:33 +01:00
Adolfo Ochagavía
fda8ddc5fe
Introduce Location and make SyntaxError fields private
2018-11-05 18:38:34 +01:00
Aleksey Kladov
43665eb166
bring back testutils
2018-11-05 15:56:07 +03:00
Aleksey Kladov
8e8f52e80a
add description
2018-11-05 15:52:22 +03:00
Aleksey Kladov
80e50cae00
Switch ra_syntax to 2015 edition
2018-11-05 15:47:59 +03:00
Aleksey Kladov
420725f256
Introduce var works with tail exprs
2018-11-05 15:44:34 +03:00
Aleksey Kladov
0192c116f7
Use FilePosition everywhere
2018-11-05 14:57:41 +03:00
Aleksey Kladov
1e1c188cbf
rename Position to FilePostion
2018-11-05 14:24:38 +03:00
Aleksey Kladov
8b132354bb
don't send backtraces for canceled requests
2018-11-05 14:22:39 +03:00
Aleksey Kladov
6bbcfca7ae
Fully add inline modules to module tree
2018-11-05 14:10:20 +03:00
Aleksey Kladov
44d8919384
Submodule is enum
2018-11-05 13:23:37 +03:00
Aleksey Kladov
17a88928f4
collect all submodules
2018-11-05 13:08:52 +03:00
Aleksey Kladov
e0b21b9899
submodules works with module sources
2018-11-05 12:36:38 +03:00
Aleksey Kladov
88a15d10d5
use module_for_source
2018-11-05 12:36:38 +03:00
Aleksey Kladov
cd878658d3
Introduce modules_from_source fn
2018-11-05 12:36:38 +03:00
Aleksey Kladov
6502bd2c96
reduce code duplication
2018-11-05 11:39:51 +03:00
Aleksey Kladov
9010cb9839
grammar: for predicates in where
...
closes #191
2018-11-05 11:24:08 +03:00
Adolfo Ochagavía
3b42ddae60
Introduce SyntaxErrorKind and TextRange in SyntaxError
2018-11-04 21:16:38 +01:00
Adolfo Ochagavía
9b5bbab104
Add character literal parsing and validation
2018-11-04 15:17:24 +01:00
Aleksey Kladov
f29b0172fb
Use Default everywhere
2018-11-04 14:09:21 +03:00
Aleksey Kladov
cca5f862de
Don't order import alphabetical
...
alphabetical ordering is no more consistent, and much less useful then
the ordering which arises naturally when you add import.
2018-11-01 16:18:53 +03:00
Aleksey Kladov
c74e86536e
Dead code
2018-11-01 16:00:13 +03:00
Aleksey Kladov
a17b41033a
update salsa
2018-11-01 15:30:07 +03:00
Aleksey Kladov
962a491829
Some docs
2018-11-01 14:31:35 +03:00
Aleksey Kladov
f2b654fd44
Add inline source
2018-11-01 13:51:44 +03:00
Aleksey Kladov
223fd2979c
Introduce ModuleSource
2018-11-01 13:41:58 +03:00
Aleksey Kladov
d685a9b564
Use From to get an owned AST
2018-11-01 13:41:20 +03:00
bors[bot]
3ec9f958b3
Merge #179
...
179: Remove DOC_COMMENT r=matklad a=kjeremy
Closes #166
Co-authored-by: Jeremy A. Kolb <jkolb@ara.com>
2018-11-01 10:16:24 +00:00
Aleksey Kladov
2050812cad
remove SyntaxPtrDatabase
2018-11-01 13:15:11 +03:00
Jeremy A. Kolb
61580f3cb8
Remove DOC_COMMENT
...
Closes #166
2018-10-31 17:38:18 -04:00
Aleksey Kladov
2b210d98b8
Fix test
2018-11-01 00:00:43 +03:00
Aleksey Kladov
fabb804f30
Speedup fmt
2018-10-31 23:58:03 +03:00
Aleksey Kladov
8f1a83b4cb
RemoveDeadCode
2018-10-31 23:50:18 +03:00
Aleksey Kladov
6be50f7d5d
Reformat all
2018-10-31 23:41:43 +03:00
Muhammad Mominul Huque
857c1650ef
Various changes
...
Pin to a specific toolchain version
Format checking functionality
Add a test to check the code formatting.
Remove macro_use attribute
2018-10-31 23:39:21 +03:00
Muhammad Mominul Huque
d14610dab4
initial implementation
2018-10-31 23:39:21 +03:00
Jeremy A. Kolb
9b9fc135d6
Simplify find_all_refs by always resolving a ast::BindPat
2018-10-31 23:38:22 +03:00
Jeremy A. Kolb
406f366ccc
Add DeclarationDescriptor and ReferenceDescriptor
...
Fixes #142
Fixes #146
2018-10-31 23:30:57 +03:00
bors[bot]
55ebe6380a
Merge #167
...
167: Attempt to extract useful comments from function signatures r=matklad a=kjeremy
I'm trying to extract useful function comments for signature info. This will also be useful for hover. This is a WIP (and actually works pretty well!) but I don't think it's the right approach long term so some guidance would be appreciated so that we could also get comments for say types and variable instances etc.
Currently `test_fn_signature_with_simple_doc` fails due to a bug in `extend` but we probably shouldn't use this approach anyway. Maybe comments should be attached to nodes somehow? I'm also thinking that maybe the markdown bits should live in the language server.
Thoughts?
Co-authored-by: Jeremy A. Kolb <jkolb@ara.com>
2018-10-31 19:41:24 +00:00
Aleksey Kladov
dfba29e4fb
Add MockAnalysis to make testing easier
2018-10-31 22:35:01 +03:00
Jeremy A. Kolb
74320945b6
Make extend private again
2018-10-31 15:27:35 -04:00
Jeremy A. Kolb
05eb489ec5
Useful comments from function signatures
2018-10-31 15:23:20 -04:00
Jeremy A. Kolb
d2bcd1a386
ast::DocCommentsOwner
which represents a documentation comment owner
2018-10-31 15:08:37 -04:00
Jeremy A. Kolb
3c2aefc274
Prevent panic by initializing LibrariesQuery
2018-10-31 14:53:09 -04:00
Aleksey Kladov
64ce895ef0
extract fixture parsing
2018-10-31 21:37:40 +03:00
bors[bot]
b58ca6b1a6
Merge #177
...
177: Librariese -> Libraries r=matklad a=kjeremy
Co-authored-by: Jeremy A. Kolb <jkolb@ara.com>
2018-10-31 18:16:58 +00:00
Jeremy A. Kolb
542fbcbaed
Fix typo
2018-10-31 14:05:14 -04:00
bors[bot]
1dc5608d0b
Merge #176
...
176: Move completio to ra_analysis r=matklad a=matklad
While we should handle completion for isolated file, it's better
achieved by using empty Analysis, rather than working only with &File:
we need memoization for type inference even inside a single file.
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2018-10-31 18:05:12 +00:00
Jeremy A. Kolb
e60ef6260f
Fix typos
2018-10-31 21:04:38 +03:00
Aleksey Kladov
c09e14a4ff
remove old completion
2018-10-31 21:03:00 +03:00
Aleksey Kladov
f3fb59d707
Move completion to ra_analysis
...
While we should handle completion for isolated file, it's better
achieved by using empty Analysis, rather than working only with &File:
we need memoization for type inference even inside a single file.
2018-10-31 21:01:51 +03:00
Aleksey Kladov
c02be1502c
move resolve local name
2018-10-31 15:13:49 +03:00
Aleksey Kladov
b67295134b
Move FnDescriptors to analyzer
2018-10-31 10:56:31 +03:00
Aleksey Kladov
3068af79ff
Introduce owned ast nodes
...
ast::FooNode is an owned 'static counterpart to ast::Foo<'a>
2018-10-31 10:29:32 +03:00
bors[bot]
032d15c392
Merge #171
...
171: Query-based module scopes r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2018-10-30 23:10:48 +00:00
Aleksey Kladov
fbbee53722
Add ModuleScope as a query
...
This is a first step towards queryifing completion and resolve.
Some code currently duplicates ra_editor: the plan is to move all
completion from ra_editor, but it'll take more than one commit.
2018-10-31 02:08:54 +03:00
Aleksey Kladov
23cad90fe9
⬆️ salsa
2018-10-31 01:22:47 +03:00
bors[bot]
d10214581e
Merge #168
...
168: Fix param number r=matklad a=kjeremy
Fixes the parameter number if we are not in a method
Co-authored-by: Jeremy A. Kolb <jkolb@ara.com>
2018-10-30 21:50:51 +00:00