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

NPE in completion contributor #25331

Closed
bwilkerson opened this issue Jan 3, 2016 · 2 comments
Closed

NPE in completion contributor #25331

bwilkerson opened this issue Jan 3, 2016 · 2 comments
Assignees
Labels
analyzer-completion Issues with the analysis server's code completion feature area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P1 A high priority bug; for example, a single project is unusable or has many test failures type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@bwilkerson
Copy link
Member

It appears that the export namespace is not always computed for all libraries when we get to this method.

Dart analysis server, SDK version 1.14.0-edge.6602644bb3fd094cddc638a8e963c6a49d9cbdc8, server version 1.14.0, error: Failed to handle completion domain request: {clientRequestTime: 1451694275093, params: {file: .../scope.dart, offset: 2622}, method: completion.getSuggestions, id: 277}
The null object does not have a getter 'definedNames'.

NoSuchMethodError: method not found: 'definedNames'
Receiver: null
Arguments: []
#0 Object._noSuchMethod (dart:core-patch/object_patch.dart:42)
#1 Object.noSuchMethod (dart:core-patch/object_patch.dart:45)
#2 ImportedReferenceContributor._buildSuggestions (package:analysis_server/src/services/completion/dart/imported_reference_contributor.dart:67)
#3 ImportedReferenceContributor.computeSuggestions.<computeSuggestions_async_body> (package:analysis_server/src/services/completion/dart/imported_reference_contributor.dart:52)
#4 _asyncThenWrapperHelper. (dart:async-patch/async_patch.dart:27)
#5 _rootRunUnary (dart:async/zone.dart:914)
#6 _CustomZone.runUnary (dart:async/zone.dart:810)
#7 _Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:551)
#8 _Future._propagateToListeners (dart:async/future_impl.dart:637)
#9 _Future._complete (dart:async/future_impl.dart:414)
#10 _SyncCompleter.complete (dart:async/future_impl.dart:52)
#11 DartCompletionRequestImpl.resolveDirectives.<resolveDirectives_async_body> (package:analysis_server/src/services/completion/dart/completion_manager.dart)
#12 Future.Future.microtask. (dart:async/future.dart:144)
#13 _rootRun (dart:async/zone.dart:903)
#14 _CustomZone.run (dart:async/zone.dart:802)
#15 _CustomZone.runGuarded (dart:async/zone.dart:708)
#16 _CustomZone.bindCallback. (dart:async/zone.dart:733)
#17 _rootRun (dart:async/zone.dart:907)
#18 _CustomZone.run (dart:async/zone.dart:802)
#19 _CustomZone.runGuarded (dart:async/zone.dart:708)
#20 _CustomZone.bindCallback. (dart:async/zone.dart:733)
#21 _microtaskLoop (dart:async/schedule_microtask.dart:41)
#22 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50)
#23 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:96)
#24 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:149)

@bwilkerson bwilkerson added Type-Defect P1 A high priority bug; for example, a single project is unusable or has many test failures area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. analyzer-completion Issues with the analysis server's code completion feature labels Jan 3, 2016
@kevmoo kevmoo added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) and removed Type-Defect labels Mar 1, 2016
@alexander-doroshko
Copy link

@danrubel should this be fixed in 1.14.2? I'm asking because we've got similar trace from user:

Dart analysis server, SDK version 1.14.2, server version 1.14.0, error: Failed to handle completion domain request: {clientRequestTime: 1456183637438, params: {file: C:\Users\Adrian\Desktop\nnchat44\src\main\resources\web\main.dart, offset: 3543}, method: completion.getSuggestions, id: 437}
The null object does not have a getter 'definedNames'.

NoSuchMethodError: method not found: 'definedNames'
Receiver: null
Arguments: []
#0      Object._noSuchMethod (dart:core-patch/object_patch.dart:42)
#1      Object.noSuchMethod (dart:core-patch/object_patch.dart:45)
#2      ImportedReferenceContributor._buildSuggestions (package:analysis_server/src/services/completion/dart/imported_reference_contributor.dart:67)
#3      ImportedReferenceContributor.computeSuggestions.<computeSuggestions_async_body> (package:analysis_server/src/services/completion/dart/imported_reference_contributor.dart:52)
#4      _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:27)
#5      _rootRunUnary (dart:async/zone.dart:914)
#6      _CustomZone.runUnary (dart:async/zone.dart:810)
#7      _Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:551)
#8      _Future._propagateToListeners (dart:async/future_impl.dart:637)
#9      _Future._complete (dart:async/future_impl.dart:414)
#10     _SyncCompleter.complete (dart:async/future_impl.dart:52)
#11     DartCompletionRequestImpl.resolveDirectives.<resolveDirectives_async_body> (package:analysis_server/src/services/completion/dart/completion_manager.dart:218)
#12     _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:27)
#13     _rootRunUnary (dart:async/zone.dart:914)
#14     _CustomZone.runUnary (dart:async/zone.dart:810)
#15     _Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:551)
#16     _Future._propagateToListeners (dart:async/future_impl.dart:637)
#17     _Future._completeWithValue (dart:async/future_impl.dart:424)
#18     _Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:479)
#19     _rootRun (dart:async/zone.dart:907)
#20     _CustomZone.run (dart:async/zone.dart:802)
#21     _CustomZone.runGuarded (dart:async/zone.dart:708)
#22     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:733)
#23     _microtaskLoop (dart:async/schedule_microtask.dart:41)
#24     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50)
#25     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:96)
#26     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:149)

@danrubel
Copy link

danrubel commented Mar 3, 2016

I don't think the fix made it into 1.14.2. I believe it's fixed in 1.15.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-completion Issues with the analysis server's code completion feature area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P1 A high priority bug; for example, a single project is unusable or has many test failures type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

4 participants