Closed playest closed 4 years ago
Currently the code completion does not work. As you already figurer out, this is due to the use of proc macros
. When creating the library I split the key functionality in traits to be as compatible as possible to the ev3dev
specification and to reduce the code size. Until now I didn't know that this causes problems with code completion.
Apart from waiting for the rust-analyzer
project to support proc marcos
(PR) it is possible to lift the functional traits (TachoMotor
, Sensor
, Findable
) to classic macros. This will fix this issue for rust-analyzer
. I will try to restructure the mentioned traits to solve this within the next few days.
I created a branch feature/improve-lsp-support that removes most of the proc macros
and some traits. With rust-analyzer
the completion seems to work but for generated functions no inline doc is visible (it is generated for docs.rs but rust-analyzer
and clion
do not recognize this).
Changes with this branch:
Findable
, Sensor
, Motor
, DcMotor
, ServoMotor
,
TachoMotor
color_sensor::MODE_COL_REFLECT
-> ColorSensor::MODE_COL_REFLECT
) prelude
module cause it is no longer necessaryYou can try it locally and check if it brings improvements for you. I will do some test and try to fix the inline doc problem before merging.
rust-analyser
now supports inline documentation for macro-generated functions. So I think this issue can now be marked as solved.
Hello,
I tried to use completion with this library and I had a rough time (here is a summary what I tried to do).
Did you manage to use completion with the library without macro expansion?
Thanks.