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

getAvailableRefactorings request failure #36682

Closed
timsneath opened this issue Apr 19, 2019 · 6 comments
Closed

getAvailableRefactorings request failure #36682

timsneath opened this issue Apr 19, 2019 · 6 comments
Assignees
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.

Comments

@timsneath
Copy link
Contributor

Exception from analysis server (running from VSCode / Dart Code)

What I was doing

image

Versions

  • Flutter SDK 1.5.3-pre.35
  • Visual Studio Code 1.33.1
  • Dart Code 2.25.1

Analyzer Info

The analyzer was launched using the arguments:

/Users/timsneath/flutter/bin/cache/dart-sdk/bin/snapshots/analysis_server.dart.snapshot
--client-id=Dart-Code.dart-code
--client-version=2.25.1

Exception (fatal)

Failed to handle request: {id: 5253, method: edit.getAvailableRefactorings, params: {file: /Users/timsneath/git/me/cupertino_store/lib/model/products_repository.dart, length: 0, offset: 90}, clientRequestTime: 1555717504077}

RangeError: Value not in range: 93
#0      _StringBase.substring (dart:core-patch/string_patch.dart:383:7)
#1      StatementAnalyzer._hasTokens (package:analysis_server/src/services/correction/statement_analyzer.dart:226:33)
#2      StatementAnalyzer._checkSelectedNodes (package:analysis_server/src/services/correction/statement_analyzer.dart:212:11)
#3      StatementAnalyzer.visitCompilationUnit (package:analysis_server/src/services/correction/statement_analyzer.dart:91:7)
#4      CompilationUnitImpl.accept (package:analyzer/src/dart/ast/ast.dart:2147:49)
#5      StatementAnalyzer.analyze (package:analysis_server/src/services/correction/statement_analyzer.dart:56:24)
#6      ExtractMethodRefactoringImpl._isExtractable (package:analysis_server/src/services/refactoring/extract_method.dart:824:14)
#7      ExtractMethodRefactoringImpl._checkSelection (package:analysis_server/src/services/refactoring/extract_method.dart:494:35)
#8      ExtractMethodRefactoringImpl.isAvailable (package:analysis_server/src/services/refactoring/extract_method.dart:401:13)
#9      EditDomainHandler._getAvailableRefactoringsImpl (package:analysis_server/src/edit/edit_domain.dart:782:14)
<asynchronous suspension>
#10     EditDomainHandler._getAvailableRefactorings (package:analysis_server/src/edit/edit_domain.dart:754:5)
#11     EditDomainHandler.handleRequest (package:analysis_server/src/edit/edit_domain.dart:376:16)
#12     AnalysisServer.handleRequest.<anonymous closure>.<anonymous closure> (package:analysis_server/src/analysis_server.dart:337:45)
#13     _PerformanceTagImpl.makeCurrentWhile (package:analyzer/src/generated/utilities_general.dart:258:15)
#14     AnalysisServer.handleRequest.<anonymous closure> (package:analysis_server/src/analysis_server.dart:333:50)
#15     _rootRun (dart:async/zone.dart:1124:13)
#16     _CustomZone.run (dart:async/zone.dart:1021:19)
#17     _runZoned (dart:async/zone.dart:1516:10)
#18     runZoned (dart:async/zone.dart:1500:12)
#19     AnalysisServer.handleRequest (package:analysis_server/src/analysis_server.dart:332:5)
#20     ByteStreamServerChannel._readRequest.<anonymous closure> (package:analysis_server/src/channel/byte_stream_channel.dart:174:16)
#21     _PerformanceTagImpl.makeCurrentWhile (package:analyzer/src/generated/utilities_general.dart:258:15)
#22     ByteStreamServerChannel._readRequest (package:analysis_server/src/channel/byte_stream_channel.dart:165:47)
#23     ByteStreamServerChannel.listen.<anonymous closure> (package:analysis_server/src/channel/byte_stream_channel.dart:110:26)
#24     _rootRunUnary (dart:async/zone.dart:1132:38)
#25     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#26     _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
#27     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#28     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#29     _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:68:11)
#30     _EventSinkWrapper.add (dart:async/stream_transformers.dart:15:11)
#31     _StringAdapterSink.add (dart:convert/string_conversion.dart:236:11)
#32     _LineSplitterSink._addLines (dart:convert/line_splitter.dart:150:13)
#33     _LineSplitterSink.addSlice (dart:convert/line_splitter.dart:125:5)
#34     StringConversionSinkMixin.add (dart:convert/string_conversion.dart:163:5)
#35     _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:120:24)
#36     _rootRunUnary (dart:async/zone.dart:1132:38)
#37     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#38     _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
#39     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#40     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#41     _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:68:11)
#42     _EventSinkWrapper.add (dart:async/stream_transformers.dart:15:11)
#43     _StringAdapterSink.add (dart:convert/string_conversion.dart:236:11)
#44     _StringAdapterSink.addSlice (dart:convert/string_conversion.dart:241:7)
#45     _Utf8ConversionSink.addSlice (dart:convert/string_conversion.dart:312:20)
#46     _Utf8ConversionSink.add (dart:convert/string_conversion.dart:305:5)
#47     _ConverterStreamEventSink.add (dart:convert/chunked_conversion.dart:72:18)
#48     _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:120:24)
#49     _rootRunUnary (dart:async/zone.dart:1132:38)
#50     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#51     _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
#52     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#53     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#54     _SyncStreamController._sendData (dart:async/stream_controller.dart:764:19)
#55     _StreamController._add (dart:async/stream_controller.dart:640:7)
#56     _StreamController.add (dart:async/stream_controller.dart:586:5)
#57     _Socket._onData (dart:io-patch/socket_patch.dart:1774:41)
#58     _rootRunUnary (dart:async/zone.dart:1136:13)
#59     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#60     _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
#61     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#62     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#63     _SyncStreamController._sendData (dart:async/stream_controller.dart:764:19)
#64     _StreamController._add (dart:async/stream_controller.dart:640:7)
#65     _StreamController.add (dart:async/stream_controller.dart:586:5)
#66     new _RawSocket.<anonymous closure> (dart:io-patch/socket_patch.dart:1323:33)
#67     _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:844:14)
#68     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#69     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#70     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:115:13)
#71     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:5)

Diagnostics requested after the error occurred are:

[
    {
        "name": "/Users/timsneath/git/me/cupertino_store",
        "explicitFileCount": 9,
        "implicitFileCount": 860,
        "workItemQueueLength": 0,
        "cacheEntryExceptions": []
    }
]
@kevmoo kevmoo added the area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. label Apr 20, 2019
@timsneath
Copy link
Contributor Author

timsneath commented May 20, 2019

Fresh example here:

Exception from analysis server (running from VSCode / Dart Code)

What I was doing

image

Versions

  • Flutter SDK 1.6.1-pre.57
  • Visual Studio Code 1.34.0
  • Dart Code 3.0.2

Analyzer Info

The analyzer was launched using the arguments:

/Users/timsneath/flutter/bin/cache/dart-sdk/bin/snapshots/analysis_server.dart.snapshot
--client-id=Dart-Code.dart-code
--client-version=3.0.2

Exception (fatal)

Failed to handle request: {id: 16329, method: edit.getAvailableRefactorings, params: {file: /Users/timsneath/git/me/cambridge/spectrum/lib/spectrum/keyboard.dart, length: 0, offset: 877}, clientRequestTime: 1558393542581}

RangeError: Value not in range: 880
#0      _StringBase.substring (dart:core-patch/string_patch.dart:383:7)
#1      StatementAnalyzer._hasTokens (package:analysis_server/src/services/correction/statement_analyzer.dart:228:33)
#2      StatementAnalyzer._checkSelectedNodes (package:analysis_server/src/services/correction/statement_analyzer.dart:214:11)
#3      StatementAnalyzer.visitCompilationUnit (package:analysis_server/src/services/correction/statement_analyzer.dart:93:7)
#4      CompilationUnitImpl.accept (package:analyzer/src/dart/ast/ast.dart:2146:49)
#5      StatementAnalyzer.analyze (package:analysis_server/src/services/correction/statement_analyzer.dart:58:24)
#6      ExtractMethodRefactoringImpl._isExtractable (package:analysis_server/src/services/refactoring/extract_method.dart:826:14)
#7      ExtractMethodRefactoringImpl._checkSelection (package:analysis_server/src/services/refactoring/extract_method.dart:495:35)
#8      ExtractMethodRefactoringImpl.isAvailable (package:analysis_server/src/services/refactoring/extract_method.dart:402:13)
#9      EditDomainHandler._getAvailableRefactoringsImpl (package:analysis_server/src/edit/edit_domain.dart:782:14)
<asynchronous suspension>
#10     EditDomainHandler._getAvailableRefactorings (package:analysis_server/src/edit/edit_domain.dart:754:5)
#11     EditDomainHandler.handleRequest (package:analysis_server/src/edit/edit_domain.dart:376:16)
#12     AnalysisServer.handleRequest.<anonymous closure>.<anonymous closure> (package:analysis_server/src/analysis_server.dart:318:45)
#13     _PerformanceTagImpl.makeCurrentWhile (package:analyzer/src/generated/utilities_general.dart:258:15)
#14     AnalysisServer.handleRequest.<anonymous closure> (package:analysis_server/src/analysis_server.dart:314:50)
#15     _rootRun (dart:async/zone.dart:1124:13)
#16     _CustomZone.run (dart:async/zone.dart:1021:19)
#17     _runZoned (dart:async/zone.dart:1516:10)
#18     runZoned (dart:async/zone.dart:1500:12)
#19     AnalysisServer.handleRequest (package:analysis_server/src/analysis_server.dart:313:5)
#20     ByteStreamServerChannel._readRequest.<anonymous closure> (package:analysis_server/src/channel/byte_stream_channel.dart:174:16)
#21     _PerformanceTagImpl.makeCurrentWhile (package:analyzer/src/generated/utilities_general.dart:258:15)
#22     ByteStreamServerChannel._readRequest (package:analysis_server/src/channel/byte_stream_channel.dart:165:47)
#23     ByteStreamServerChannel.listen.<anonymous closure> (package:analysis_server/src/channel/byte_stream_channel.dart:110:26)
#24     _rootRunUnary (dart:async/zone.dart:1132:38)
#25     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#26     _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
#27     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#28     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#29     _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:68:11)
#30     _EventSinkWrapper.add (dart:async/stream_transformers.dart:15:11)
#31     _StringAdapterSink.add (dart:convert/string_conversion.dart:236:11)
#32     _LineSplitterSink._addLines (dart:convert/line_splitter.dart:150:13)
#33     _LineSplitterSink.addSlice (dart:convert/line_splitter.dart:125:5)
#34     StringConversionSinkMixin.add (dart:convert/string_conversion.dart:163:5)
#35     _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:120:24)
#36     _rootRunUnary (dart:async/zone.dart:1132:38)
#37     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#38     _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
#39     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#40     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#41     _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:68:11)
#42     _EventSinkWrapper.add (dart:async/stream_transformers.dart:15:11)
#43     _StringAdapterSink.add (dart:convert/string_conversion.dart:236:11)
#44     _StringAdapterSink.addSlice (dart:convert/string_conversion.dart:241:7)
#45     _Utf8ConversionSink.addSlice (dart:convert/string_conversion.dart:312:20)
#46     _Utf8ConversionSink.add (dart:convert/string_conversion.dart:305:5)
#47     _ConverterStreamEventSink.add (dart:convert/chunked_conversion.dart:72:18)
#48     _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:120:24)
#49     _rootRunUnary (dart:async/zone.dart:1132:38)
#50     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#51     _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
#52     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#53     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#54     _SyncStreamController._sendData (dart:async/stream_controller.dart:764:19)
#55     _StreamController._add (dart:async/stream_controller.dart:640:7)
#56     _StreamController.add (dart:async/stream_controller.dart:586:5)
#57     _Socket._onData (dart:io-patch/socket_patch.dart:1774:41)
#58     _rootRunUnary (dart:async/zone.dart:1136:13)
#59     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#60     _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
#61     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#62     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#63     _SyncStreamController._sendData (dart:async/stream_controller.dart:764:19)
#64     _StreamController._add (dart:async/stream_controller.dart:640:7)
#65     _StreamController.add (dart:async/stream_controller.dart:586:5)
#66     new _RawSocket.<anonymous closure> (dart:io-patch/socket_patch.dart:1323:33)
#67     _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:844:14)
#68     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#69     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#70     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:115:13)
#71     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:5)

Diagnostics requested after the error occurred are:

[
    {
        "name": "/Users/timsneath/git/me/cambridge/spectrum",
        "explicitFileCount": 12,
        "implicitFileCount": 617,
        "workItemQueueLength": 0,
        "cacheEntryExceptions": []
    }
]

@DanTup
Copy link
Collaborator

DanTup commented Jul 8, 2019

@scheglov this looks like #35535, but the suspected fix for that was quite some time ago (142641e in October), though the version of Flutter here looks like March/April, so presumably included that change. Maybe still an issue?

@DanTup
Copy link
Collaborator

DanTup commented Jul 8, 2019

#37421 is the same in Flutter 1.5.4-hotfix.2.

@scheglov
Copy link
Contributor

scheglov commented Jul 9, 2019

@scheglov
Copy link
Contributor

scheglov commented Jul 9, 2019

Extract Local was fixed, but Extract Method - not.

dart-bot pushed a commit that referenced this issue Jul 9, 2019
…ethod refactoring.

R=brianwilkerson@google.com

Bug: #36682
Change-Id: I9b15983ff6a872eec14c48bdf29680e6db97a75e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108480
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
@scheglov scheglov closed this as completed Jul 9, 2019
@DanTup
Copy link
Collaborator

DanTup commented Jul 10, 2019

Aha, that explains it. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
Projects
None yet
Development

No branches or pull requests

4 participants