Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MACRO&RES: initial version of include macro support #3935

Merged
merged 5 commits into from
Jun 10, 2019

Conversation

Undin
Copy link
Member

@Undin Undin commented Jun 1, 2019

Add initial support of include! macro. It brings all common code insight features (like name resolution, code completion, etc.) in both including and included files. Also, it should fix false positive editor notification for included files.

2019-06-03 12 47 16

Restrictions:

  • only string literals are supported as arguments
  • include macro call should be located only in a module. At this moment, if include macro is called in a function, it won't be indexed and as a result, won't be found via the corresponding index. So the current implementation works only with instances of RsMod

Fixes #3563
Fixes problems described in #771 and #1078 in certain cases
The initial step of #1908

@Undin Undin added the feature label Jun 1, 2019
@Undin Undin force-pushed the include-macro-first-attempt branch from 1c7e5e0 to 592c479 Compare June 2, 2019 21:53
@Undin Undin marked this pull request as ready for review June 2, 2019 21:54
@Undin Undin changed the title RES: initial version of include macro support MACRO&RES: initial version of include macro support Jun 3, 2019
@Undin Undin force-pushed the include-macro-first-attempt branch from 592c479 to 3a2fa58 Compare June 3, 2019 07:26
@vlad20012
Copy link
Member

👍 👍 👍
bors r+

bors bot added a commit that referenced this pull request Jun 10, 2019
3935: MACRO&RES: initial version of include macro support r=vlad20012 a=Undin

Add initial support of `include!` macro. It brings all common code insight features (like name resolution, code completion, etc.) in both including and included files. Also, it should fix false positive editor notification for included files.

![2019-06-03 12 47 16](https://user-images.githubusercontent.com/2539310/58792898-bcaa2c80-85fd-11e9-9e4e-1064fe61b146.gif)

Restrictions:
* only string literals are supported as arguments
* `include` macro call should be located only in a module. At this moment, if `include` macro is called in a function, it won't be indexed and as a result, won't be found via the corresponding index. So the current implementation works only with instances of `RsMod`

Fixes #3563
Fixes problems described in #771 and #1078 in certain cases
The initial step of #1908

3993:  COMP & RES: Resolve const generics r=vlad20012 a=mchernyavsky

Relates to #3985. Depends on #3990.


Co-authored-by: Arseniy Pendryak <a.pendryak@yandex.ru>
Co-authored-by: mchernyavsky <chemike47@gmail.com>
@bors
Copy link
Contributor

bors bot commented Jun 10, 2019

Timed out (retrying...)

bors bot added a commit that referenced this pull request Jun 10, 2019
3935: MACRO&RES: initial version of include macro support r=vlad20012 a=Undin

Add initial support of `include!` macro. It brings all common code insight features (like name resolution, code completion, etc.) in both including and included files. Also, it should fix false positive editor notification for included files.

![2019-06-03 12 47 16](https://user-images.githubusercontent.com/2539310/58792898-bcaa2c80-85fd-11e9-9e4e-1064fe61b146.gif)

Restrictions:
* only string literals are supported as arguments
* `include` macro call should be located only in a module. At this moment, if `include` macro is called in a function, it won't be indexed and as a result, won't be found via the corresponding index. So the current implementation works only with instances of `RsMod`

Fixes #3563
Fixes problems described in #771 and #1078 in certain cases
The initial step of #1908

Co-authored-by: Arseniy Pendryak <a.pendryak@yandex.ru>
@bors
Copy link
Contributor

bors bot commented Jun 10, 2019

@bors bors bot merged commit 4a45020 into master Jun 10, 2019
@bors bors bot deleted the include-macro-first-attempt branch June 10, 2019 19:10
bors bot added a commit that referenced this pull request Jun 17, 2019
4038: Fix IndexNotReadyException when typing in the dumb mode r=vlad20012 a=vlad20012

Fixes #4036

The bug was introduced in #3935 - not it's forbidden to access `PsiElement.context` in the dumb mode

Co-authored-by: vlad20012 <beskvlad@yandex.ru>
@mchernyavsky mchernyavsky added this to the v100 milestone Jun 20, 2019
@vlad20012 vlad20012 mentioned this pull request Jul 3, 2019
23 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot find declaration (large project: Servo)
3 participants