flutter-intellij icon indicating copy to clipboard operation
flutter-intellij copied to clipboard

"Jump to definition" on identifiers defined in C++ doesn't jump to the definition

Open Hixie opened this issue 7 years ago • 6 comments

It would be great if we could hook up jump to definition to keep going all the way down into the C++ code.

Hixie avatar Jun 22 '18 18:06 Hixie

I added that to the list in #2243. Assuming this is for Android Studio. @devoncarew @DanTup for consideration in VS Code.

stevemessick avatar Jun 22 '18 21:06 stevemessick

Could the navigation data be exposed via the analyzer (or a plugin of)? Is this for end users or devs of Flutter itself? And where does the C++ code live (are we talking about code in flutter/engine?).

DanTup avatar Jun 23 '18 08:06 DanTup

This is for end users of Flutter. Yes, we're talking about the code in flutter/engine. Maybe even the code in skia and dart if you want to continue all the way down. :-)

Hixie avatar Jun 23 '18 08:06 Hixie

Could the navigation data be exposed via the analyzer (or a plugin of)?

Yes, that's where it should be done.

Is there a way to tell, by looking at the Dart code, where the C++ code lives, or would this require parsing and indexing all of the C++ code in flutter/engine?

bwilkerson avatar Jun 23 '18 15:06 bwilkerson

Another option might be to make the Dart and Flutter plugins work in CLion. We'd probably have to do something to cause source directories under flutter/engine to be indexed, but once that's done everything should "just work".

The question is whether there are enough people who want it to make it happen. This option would require less engineering than teaching C++ to the analyzer, but would require using CLion, which is not free for commercial use. CLion might not support Java or Kotlin, either.

@alexander-doroshko for sanity checking

stevemessick avatar Jun 16 '20 17:06 stevemessick

If we were to support this in the future, the solution should be built to work with dart:ffi as that is the way Dart interop with C++ should be done going forward. If/when the flutter engine uses FFI, that could be a good point to reconsider this issue. Given the need to understand Dart code to work with FFI, the integration would definitely need to use the analyzer rather than be integrated into plugins.

jacob314 avatar May 17 '22 21:05 jacob314