Skip to content

I can't navigate (F3) in sources of Dart library #3238

New issue

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

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

Already on GitHub? # to your account

Closed
stevemessick opened this issue May 25, 2012 · 7 comments
Closed

I can't navigate (F3) in sources of Dart library #3238

stevemessick opened this issue May 25, 2012 · 7 comments
Assignees
Labels
P1 A high priority bug; for example, a single project is unusable or has many test failures
Milestone

Comments

@stevemessick
Copy link
Contributor

I can't navigate (F3) in sources of Dart library.
////////////////////////////////////////////////////////////////////////////////////
Editor Version: 7905

@danrubel
Copy link

[from: scheglov@google.com]

com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities.resolveUnit(CompilationUnit, Collection<DartCompilationError>)
  This method prepares "suppliedSources" with CompilationUnit content from unsaved editor and calls
com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities.ResolverRunnable.ResolverRunnable(LibrarySource, URI, Map<URI, String>, Map<URI, DartUnit>, boolean, Collection<DartCompilationError>)
  ...which creates librarySource=LibraryWithSuppliedSources

  However in
  com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities.secureAnalyzeLibrary(LibrarySource, Map<URI, DartUnit>, CompilerConfiguration, DartArtifactProvider, DartCompilerListener)
  ...this "librarySource" is not used as is, instead only library URI is extracted, so "suppliedSources" is ignored and unit content from the File is parsed.

@danrubel
Copy link

Repro:

  • Load sunflower... F3 works.
  • Insert the following before the drawFrame(...) method, but don't save

f2() {
  int vvv;
  vvv = 2;
}

* Now all F3 on references in code after inserted f2() method are wrong... almost as if the offset is wrong.

  • Save and same behavior
  • Make another inconsequential edit and Save... then F3 works again.

Konstantin dug into this and came up with the notes entered above.
Might be a in memory / on disk mismatch when resolving using AnalysisServer.

@bwilkerson
Copy link
Member

Konstantin's notes indicate that this is indeed a problem with the way the compiler is being invoked and that what's happening is that the version of the resource that is on disk is being used instead of the version in the editor. It isn't clear that it has anything to do with analysis server, but you still might be able to find and fix the problem faster than I can. Fel free to re-assign it to me if you want.


Set owner to @danrubel.

@stevemessick
Copy link
Contributor Author

This is a show-stopper for mark occurrences. If I turn off the analysis server then mark occurrences works correctly in modified files. The problem is as scheglov reported: DartCompilerUtilities.secureAnalyzeLibrary() no longer uses the editor buffers provided by the client caller. The true branch of the code that checks if the analysis serve is enabled does not play nicely with editor buffers; it goes to disk every time. The buffer contents are available in the "librarySource" object but only the URI is used from it. See DartCompilerUtilities line 849.


Removed Priority-Medium label.
Added Priority-High label.

@keertip
Copy link
Contributor

keertip commented May 31, 2012

[from sethladd]

Open Declaration for a class imported from a packaged does not work. I have confirmed I have the package installed, the Dart Editor perference is set, and the red underlines are gone. The program works fine. I tried multiple different classes that are imported from packages.

@clayberg
Copy link

clayberg commented Jun 1, 2012

Added this to the M1 milestone.

@danrubel
Copy link

danrubel commented Jun 7, 2012

http://codereview.chromium.org/10545044/


Added Fixed label.

@stevemessick stevemessick added Type-Defect P1 A high priority bug; for example, a single project is unusable or has many test failures labels Jun 7, 2012
@stevemessick stevemessick added this to the M1 milestone Jun 7, 2012
copybara-service bot pushed a commit that referenced this issue Nov 3, 2022
…t, test_process, webdev

Revisions updated by `dart tools/rev_sdk_deps.dart`.

browser_launcher (https://github.com/dart-lang/browser_launcher/compare/981ca88..5fa0bd6):
  5fa0bd6  2022-11-01  Kevin Moore  Update lints, require Dart 2.17, add dependabot (#34)

dartdoc (https://github.com/dart-lang/dartdoc/compare/3273437..179ada0):
  179ada02  2022-11-02  Sam Rawlins  Change _HashableChildLibraryElementVisitor to be a RecursiveElementVisitor (#3242)
  a6e7d908  2022-11-02  Sam Rawlins  Make Inheritable.isOverride late final non-nullable (#3235)
  c4f52cf9  2022-11-02  Sam Rawlins  Test records support in typedefs (#3239)
  f74e129f  2022-11-02  Sam Rawlins  Make Accessor.documentationComment late final non-nullable (#3240)
  ad50bfbc  2022-10-31  dependabot[bot]  Bump github/codeql-action from 2.1.28 to 2.1.29 (#3238)

http (https://github.com/dart-lang/http/compare/738a55b..6339026):
  6339026  2022-11-02  Brian Quinlan  Make timeout and cache controllable per-request. (#815)
  51dbca2  2022-10-31  Brian Quinlan  Add a streaming request example. (#813)

mime (https://github.com/dart-lang/mime/compare/bf041aa..d80f4d0):
  d80f4d0  2022-11-02  Liu YuanYuan  Add .avif to extension map (#70)
  3a6b14e  2022-11-01  dependabot[bot]  Bump actions/checkout from 3.0.2 to 3.1.0 (#72)

string_scanner (https://github.com/dart-lang/string_scanner/compare/10435a4..4a5cbc5):
  4a5cbc5  2022-10-31  Kevin Moore  Make code in readme consistent with example (#49)

test (https://github.com/dart-lang/test/compare/b82fc0b..173a36f):
  173a36f2  2022-11-01  Jacob MacDonald  prep packages to publish (#1780)
  fd8e2b68  2022-10-31  Devon Carew  fix an issue with the github reporter (#1779)

test_process (https://github.com/dart-lang/test_process/compare/068f9f8..1774aa7):
  1774aa7  2022-11-01  dependabot[bot]  Bump actions/checkout from 3.0.2 to 3.1.0 (#36)

webdev (https://github.com/dart-lang/webdev/compare/c350055..069b870):
  069b870  2022-11-01  Elliott Brooks (she/her)  Prepare webdev for release to v.2.7.12 (#1775)
  cb06447  2022-11-01  Elliott Brooks (she/her)  Prep DWDS for release (#1774)
  daa154d  2022-11-01  Elliott Brooks (she/her)  Reset MV3 extension to nice starting point (#1773)
  98a6142  2022-11-01  Jakub Vrána  Remove // ignore: unsafe_html. (#1759)
  939e285  2022-10-31  Elliott Brooks (she/her)  Update documentation for Webdev release process (#1771)
  0428ffb  2022-10-31  Elliott Brooks (she/her)  Update package:file to latest version (#1770)

Change-Id: I5020d718f6c009bca4f9b5e69232dc425b9d3409
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267761
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
This issue was closed.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
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

5 participants