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

Analysis Crash in VSCode While Editing Scratch Flutter Project #34475

Closed
timsneath opened this issue Sep 15, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@timsneath
Copy link
Member

commented Sep 15, 2018

Please review the below report for any information you do not wish to share and report to
https://github.com/dart-lang/sdk/issues/new

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

What I was doing

Was just getting started with a scratch project. Cursor in Column area here and deleting:

import 'package:flutter/material.dart';

void main() => runApp(new MyApp());

class MyApp extends StatelessWidget {
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'I Am Rich',
      home: new MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  _MyHomePageState createState() => new _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  Widget build(BuildContext context) {
    return new Scaffold(
      body: new Column(
      ),
    );
  }
}

Versions

  • Flutter SDK 0.8.3-pre.54
  • Visual Studio Code 1.27.2
  • Dart Code 2.18.0

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.18.0

Exception (fatal)

Failed to handle request: {id: 535, method: edit.getAvailableRefactorings, params: {file: /Users/timsneath/git/udemy_flutter/i_am_rich/lib/main.dart, length: 61, offset: 496}}

RangeError: Value not in range: 557
#0      _StringBase.substring (dart:core/runtime/libstring_patch.dart:370:7)
#1      CorrectionUtils.getText (package:analysis_server/src/services/correction/util.dart:949:20)
#2      CorrectionUtils.getRangeText (package:analysis_server/src/services/correction/util.dart:942:12)
#3      ExtractLocalRefactoringImpl._checkSelection (package:analysis_server/src/services/refactoring/extract_local.dart:233:28)
#4      ExtractLocalRefactoringImpl.isAvailable (package:analysis_server/src/services/refactoring/extract_local.dart:219:13)
#5      EditDomainHandler._getAvailableRefactoringsImpl (package:analysis_server/src/edit/edit_domain.dart:604:14)
<asynchronous suspension>
#6      EditDomainHandler._getAvailableRefactorings (package:analysis_server/src/edit/edit_domain.dart:582:5)
#7      EditDomainHandler.handleRequest (package:analysis_server/src/edit/edit_domain.dart:345:16)
#8      AnalysisServer.handleRequest.<anonymous closure>.<anonymous closure> (package:analysis_server/src/analysis_server.dart:742:45)
#9      _PerformanceTagImpl.makeCurrentWhile (package:analyzer/src/generated/utilities_general.dart:210:15)
#10     AnalysisServer.handleRequest.<anonymous closure> (package:analysis_server/src/analysis_server.dart:738:50)
#11     _rootRun (dart:async/zone.dart:1124:13)
#12     _CustomZone.run (dart:async/zone.dart:1021:19)
#13     _runZoned (dart:async/zone.dart:1516:10)
#14     runZoned (dart:async/zone.dart:1500:12)
#15     AnalysisServer.handleRequest (package:analysis_server/src/analysis_server.dart:737:5)
#16     ByteStreamServerChannel._readRequest.<anonymous closure> (package:analysis_server/src/channel/byte_stream_channel.dart:174:16)
#17     _PerformanceTagImpl.makeCurrentWhile (package:analyzer/src/generated/utilities_general.dart:210:15)
#18     ByteStreamServerChannel._readRequest (package:analysis_server/src/channel/byte_stream_channel.dart:165:47)
#19     ByteStreamServerChannel.listen.<anonymous closure> (package:analysis_server/src/channel/byte_stream_channel.dart:110:26)
#20     _rootRunUnary (dart:async/zone.dart:1132:38)
#21     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#22     _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
#23     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#24     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#25     _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:68:11)
#26     _EventSinkWrapper.add (dart:async/stream_transformers.dart:15:11)
#27     _StringAdapterSink.add (dart:convert/string_conversion.dart:268:11)
#28     _LineSplitterSink._addLines (dart:convert/line_splitter.dart:154:13)
#29     _LineSplitterSink.addSlice (dart:convert/line_splitter.dart:129:5)
#30     StringConversionSinkMixin.add (dart:convert/string_conversion.dart:189:5)
#31     _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:120:24)
#32     _rootRunUnary (dart:async/zone.dart:1132:38)
#33     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#34     _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
#35     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#36     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#37     _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:68:11)
#38     _EventSinkWrapper.add (dart:async/stream_transformers.dart:15:11)
#39     _StringAdapterSink.add (dart:convert/string_conversion.dart:268:11)
#40     _StringAdapterSink.addSlice (dart:convert/string_conversion.dart:273:7)
#41     _Utf8ConversionSink.addSlice (dart:convert/string_conversion.dart:348:20)
#42     _Utf8ConversionSink.add (dart:convert/string_conversion.dart:341:5)
#43     _ConverterStreamEventSink.add (dart:convert/chunked_conversion.dart:86:18)
#44     _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:120:24)
#45     _rootRunUnary (dart:async/zone.dart:1132:38)
#46     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#47     _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
#48     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#49     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#50     _SyncStreamController._sendData (dart:async/stream_controller.dart:763:19)
#51     _StreamController._add (dart:async/stream_controller.dart:639:7)
#52     _StreamController.add (dart:async/stream_controller.dart:585:5)
#53     _Socket._onData (dart:io/runtime/binsocket_patch.dart:1714:41)
#54     _rootRunUnary (dart:async/zone.dart:1136:13)
#55     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#56     _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
#57     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#58     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#59     _SyncStreamController._sendData (dart:async/stream_controller.dart:763:19)
#60     _StreamController._add (dart:async/stream_controller.dart:639:7)
#61     _StreamController.add (dart:async/stream_controller.dart:585:5)
#62     new _RawSocket.<anonymous closure> (dart:io/runtime/binsocket_patch.dart:1276:33)
#63     _NativeSocket.issueReadEvent.issue (dart:io/runtime/binsocket_patch.dart:819:14)
#64     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#65     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#66     _runPendingImmediateCallback (dart:isolate/runtime/libisolate_patch.dart:115:13)
#67     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:172:5)

Diagnostics requested after the error occurred are:

[
    {
        "name": "/Users/timsneath/git/udemy_flutter/i_am_rich",
        "explicitFileCount": 2,
        "implicitFileCount": 1343,
        "workItemQueueLength": 0,
        "cacheEntryExceptions": []
    }
]
@bwilkerson

This comment has been minimized.

Copy link
Member

commented Sep 16, 2018

@scheglov scheglov self-assigned this Sep 22, 2018

@scheglov

This comment has been minimized.

Copy link
Contributor

commented Sep 22, 2018

dart-bot pushed a commit that referenced this issue Sep 24, 2018

Check that selection offset/length is valid in Extract Local refactor…
…ing.

R=brianwilkerson@google.com

Bug: #34475
Change-Id: Id2b44494a8464000180a8ca93cfcc770b256f59f
Reviewed-on: https://dart-review.googlesource.com/76063
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>

@scheglov scheglov closed this Sep 24, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.