sirgl opened Issue #2286:
Usually I explore new API by completion and quick documentation in IDE. For the instructions emission methods (the core API of cranelift) this functionality is absent.
Now instructions code is generated in
cranelift-codegen
in during build and then it get inserted into library using include.
This allows to have always fresh version of instruction code, but at the same time breaks experience with IDE.
Both IntelliJ and rust-analyser can't index code that created during build and can't provide completion/navigation/reliable refactorings.Feature / Implementation
Insert generated code for instructions right into library. It will allow IDE index it and provide all information for completion/hover and so on.
Benefit
Cranelifts' newcomers will be able to explore and understand API quickly.
Alternatives
Leave everything as is. For newcomers API will still be a bigger problem.
sirgl edited Issue #2286:
Usually I explore new API by completion and quick documentation in IDE (and AFAIK most of the people do so). For the instructions emission methods (the core API of cranelift) this functionality is absent. You have to go to online documentation first and then write code.
Here I would expect to see
return_
, but there is nothing in completion list.
![2020-10-11_22-54](https://user-images.githubusercontent.com/11944514/95690071-6ac3de80-0c15-11eb-9a34-acd1352e2214.png)Now instructions code is generated in
cranelift-codegen
in during build and then it get inserted into library using include.
This allows to have always fresh version of instruction code, but at the same time breaks experience with IDE.
Both IntelliJ and rust-analyser can't index code that created during build and can't provide completion/navigation/reliable refactorings. Also it is bad for validation of parameter types.Feature / Implementation
Insert generated code for instructions right into library. It will allow IDE index it and provide all information for completion/hover and so on.
Benefit
Cranelifts' newcomers will be able to explore and understand API quickly.
Alternatives
Leave everything as is. For newcomers API will still be a bigger problem.
sirgl edited Issue #2286:
Usually I explore new API by completion and quick documentation in IDE (and AFAIK most of the people do so). For the instructions emission methods (the core API of cranelift) this functionality is absent. You have to go to online documentation first and then write code.
Here I would expect to see
return_
, but there is nothing in completion list.
![2020-10-11_22-54](https://user-images.githubusercontent.com/11944514/95690071-6ac3de80-0c15-11eb-9a34-acd1352e2214.png)Now instructions code is generated in
cranelift-codegen
during build and then it get inserted into library using include.
This allows to have always fresh version of instruction code, but at the same time breaks experience with IDE.
Both IntelliJ and rust-analyser can't index code that created during build and can't provide completion/navigation/reliable refactorings. Also it is bad for validation of parameter types.Feature / Implementation
Insert generated code for instructions right into library. It will allow IDE index it and provide all information for completion/hover and so on.
Benefit
Cranelifts' newcomers will be able to explore and understand API quickly, IDE will be able to provide inline documentation, refactorings, parameter hints, errors.
Alternatives
Leave everything as is. For newcomers API will still be a bigger problem.
sirgl edited Issue #2286:
Usually I explore new API by completion and quick documentation in IDE (and AFAIK most of the people do so). For the instructions emission methods (the core API of cranelift) this functionality is not working in IntelliJ and rust-analyser. You have to go to online documentation first and then write code.
Here I would expect to see
return_
, but there is nothing in completion list.
![2020-10-11_22-54](https://user-images.githubusercontent.com/11944514/95690071-6ac3de80-0c15-11eb-9a34-acd1352e2214.png)Now instructions code is generated in
cranelift-codegen
during build and then it get inserted into library using include.
This allows to have always fresh version of instruction code, but at the same time breaks experience with IDE.
Both IntelliJ and rust-analyser can't index code that created during build and can't provide completion/navigation/reliable refactorings. Also it is bad for validation of parameter types.Feature / Implementation
Insert generated code for instructions right into library. It will allow IDE index it and provide all information for completion/hover and so on.
Benefit
Cranelifts' newcomers will be able to explore and understand API quickly, IDE will be able to provide inline documentation, refactorings, parameter hints, errors.
Alternatives
Leave everything as is. For newcomers API will still be a bigger problem.
bjorn3 commented on Issue #2286:
You can enable support for build script generated code in rust-analyzer using:
{ "rust-analyzer.cargo.loadOutDirsFromCheck": true, }
sirgl commented on Issue #2286:
Thank you, then, probably, you should add it to readme to dev instructions.
abrown commented on Issue #2286:
@sirgl, do you mind creating a PR with that setup information? (And I wonder if there is a way to add OUT dirs to IntelliJ scanning...).
sirgl commented on Issue #2286:
Seems that in IntelliJ you can enable
org.rust.cargo.evaluate.build.scripts
in Experimental Features. Sure, I'll make PR.
bjorn3 commented on Issue #2286:
Should this be closed?
abrown commented on Issue #2286:
I'm think so; there's a way to do this with IDEs using rust-analyzer (e.g. VS Code).
abrown closed Issue #2286:
Usually I explore new API by completion and quick documentation in IDE (and AFAIK most of the people do so). For the instructions emission methods (the core API of cranelift) this functionality is not working in IntelliJ and rust-analyser. You have to go to online documentation first and then write code.
Here I would expect to see
return_
, but there is nothing in completion list.
![2020-10-11_22-54](https://user-images.githubusercontent.com/11944514/95690071-6ac3de80-0c15-11eb-9a34-acd1352e2214.png)Now instructions code is generated in
cranelift-codegen
during build and then it get inserted into library using include.
This allows to have always fresh version of instruction code, but at the same time breaks experience with IDE.
Both IntelliJ and rust-analyser can't index code that created during build and can't provide completion/navigation/reliable refactorings. Also it is bad for validation of parameter types.Feature / Implementation
Insert generated code for instructions right into library. It will allow IDE index it and provide all information for completion/hover and so on.
Benefit
Cranelifts' newcomers will be able to explore and understand API quickly, IDE will be able to provide inline documentation, refactorings, parameter hints, errors.
Alternatives
Leave everything as is. For newcomers API will still be a bigger problem.
Last updated: Dec 23 2024 at 12:05 UTC