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

Navigation from PatternField in IntelliJ #51797

Closed
scheglov opened this issue Mar 20, 2023 · 3 comments
Closed

Navigation from PatternField in IntelliJ #51797

scheglov opened this issue Mar 20, 2023 · 3 comments
Labels
area-intellij Tracking issues for the Dart IntelliJ plugin. P1 A high priority bug; for example, a single project is unusable or has many test failures

Comments

@scheglov
Copy link
Contributor

scheglov commented Mar 20, 2023

class A {
  int get foo => 0;
}

void f(Object? x) {
  if (x case A(foo: var a)) {}
}

DAS produces the navigation region, see {"offset"::68,"length"::4,"targets"::[1]}] below:

1679348233072:Noti:{"event"::"analysis.highlights","params"::{"file"::"/Users/scheglov/dart/test/bin/test.dart","regions"::[{"type"::"KEYWORD","offset"::0,"length"::5},{"type"::"CLASS","offset"::6,"length"::1},{"type"::"BUILT_IN","offset"::16,"length"::3},{"type"::"INSTANCE_GETTER_DECLARATION","offset"::20,"length"::3},{"type"::"CLASS","offset"::12,"length"::3},{"type"::"LITERAL_INTEGER","offset"::27,"length"::1},{"type"::"TOP_LEVEL_FUNCTION_DECLARATION","offset"::38,"length"::1},{"type"::"KEYWORD","offset"::33,"length"::4},{"type"::"PARAMETER_DECLARATION","offset"::48,"length"::1},{"type"::"CLASS","offset"::40,"length"::6},{"type"::"KEYWORD","offset"::55,"length"::2},{"type"::"PARAMETER_REFERENCE","offset"::59,"length"::1},{"type"::"KEYWORD","offset"::61,"length"::4},{"type"::"CLASS","offset"::66,"length"::1},{"type"::"INSTANCE_GETTER_REFERENCE","offset"::68,"length"::3},{"type"::"KEYWORD","offset"::73,"length"::3},{"type"::"LOCAL_VARIABLE_DECLARATION","offset"::77,"length"::1}]}}
1679348233073:Noti:{"event"::"analysis.navigation","params"::{"file"::"/Users/scheglov/dart/test/bin/test.dart","regions"::[{"offset"::6,"length"::1,"targets"::[0]},{"offset"::12,"length"::3,"targets"::[2]},{"offset"::20,"length"::3,"targets"::[1]},{"offset"::38,"length"::1,"targets"::[3]},{"offset"::40,"length"::6,"targets"::[5]},{"offset"::48,"length"::1,"targets"::[4]},{"offset"::59,"length"::1,"targets"::[4]},{"offset"::66,"length"::1,"targets"::[0]},{"offset"::68,"length"::4,"targets"::[1]}],"targets"::[{"kind"::"CLASS","fileIndex"::0,"offset"::6,"length"::1,"startLine"::1,"startColumn"::7},{"kind"::"GETTER","fileIndex"::0,"offset"::20,"length"::3,"startLine"::2,"startColumn"::11},{"kind"::"CLASS","fileIndex"::1,"offset"::1286,"length"::3,"startLine"::28,"startColumn"::22},{"kind"::"FUNCTION","fileIndex"::0,"offset"::38,"length"::1,"startLine"::5,"startColumn"::6},{"kind"::"PARAMETER","fileIndex"::0,"offset"::48,"length"::1,"startLine"::5,"startColumn"::16},{"kind"::"CLASS","fileIndex"::2,"offset"::867,"length"::6,"startLine"::18,"startColumn"::7}],"files"::["/Users/scheglov/dart/test/bin/test.dart","/Users/scheglov/Source/Dart/sdk.git/sdk/xcodebuild/ReleaseARM64/dart-sdk/lib/core/int.dart","/Users/scheglov/Source/Dart/sdk.git/sdk/xcodebuild/ReleaseARM64/dart-sdk/lib/core/object.dart"]}}

But in IntelliJ it navigates back to foo: instead of the get foo declaration.

This requires https://dart-review.googlesource.com/c/sdk/+/289921 to be landed.

@scheglov scheglov added P1 A high priority bug; for example, a single project is unusable or has many test failures area-intellij Tracking issues for the Dart IntelliJ plugin. labels Mar 20, 2023
copybara-service bot pushed a commit that referenced this issue Mar 21, 2023
See also #51797

Change-Id: I22b122a35b77ce40a73cc7d4bc8f295a5b9e4dc6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289921
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
@scheglov
Copy link
Contributor Author

@jwren

intellij-monorepo-bot pushed a commit to JetBrains/intellij-plugins that referenced this issue Mar 23, 2023
…PatternField.

dart-lang/sdk#51797

GitOrigin-RevId: 8464a5a87168accacba2fecdcb3ddaa39fd5ca44
copybara-service bot pushed a commit that referenced this issue Mar 23, 2023
…ment.

Unfortunately, IntelliJ cannot easily support `foo:`, only `foo`.
So, I update it to navigate from `foo`, explicit or variable.

Bug: #51797
Change-Id: If4cbf553beedf2998cd6ad3fbd7528865b523420
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290904
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
intellij-monorepo-bot pushed a commit to JetBrains/intellij-plugins that referenced this issue Apr 4, 2023
…PatternField.

dart-lang/sdk#51797
(cherry picked from commit 8464a5a87168accacba2fecdcb3ddaa39fd5ca44)

IJ-CR-105827

GitOrigin-RevId: 4cab81ae8d218dbc6b8c96ab9d10c5e35c3dc287
intellij-monorepo-bot pushed a commit to JetBrains/intellij-plugins that referenced this issue Apr 5, 2023
…PatternField.

dart-lang/sdk#51797
(cherry picked from commit 8464a5a87168accacba2fecdcb3ddaa39fd5ca44)

IJ-CR-105827

GitOrigin-RevId: 68443204d7d2fd1011e92efedce56dd1e3a87d1c
intellij-monorepo-bot pushed a commit to JetBrains/intellij-plugins that referenced this issue Apr 5, 2023
…PatternField.

dart-lang/sdk#51797
(cherry picked from commit 8464a5a87168accacba2fecdcb3ddaa39fd5ca44)

IJ-CR-105827

GitOrigin-RevId: 0329b37f112ebd87d3ecae16d0a89fccfa806954
intellij-monorepo-bot pushed a commit to JetBrains/intellij-plugins that referenced this issue Apr 5, 2023
…PatternField.

dart-lang/sdk#51797
(cherry picked from commit 8464a5a87168accacba2fecdcb3ddaa39fd5ca44)

IJ-CR-105827

GitOrigin-RevId: 304a1db1ab8e7aa18d18f5ba20ced03214c3e408
@jacob314
Copy link
Member

@scheglov can you verify that the issue has now been fixed?

@scheglov
Copy link
Contributor Author

Yes, I can navigate from foo: to get foo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-intellij Tracking issues for the Dart IntelliJ plugin. P1 A high priority bug; for example, a single project is unusable or has many test failures
Projects
None yet
Development

No branches or pull requests

2 participants