question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Autoformat causes an exception

See original GitHub issue

Steps to Reproduce

Pressed Ctrl + L to reformat the code in a freshly open project

Version information

Android Studio 3.4 • Flutter plugin io.flutter 35.2.1 • Dart plugin 183.6270

Error getting Flutter sdk information.

Exception

null

java.lang.IndexOutOfBoundsException: Index out of range: 5373
	at com.intellij.util.text.ImmutableText.findLeaf(ImmutableText.java:234)
	at com.intellij.util.text.ImmutableText.charAt(ImmutableText.java:226)
	at com.intellij.openapi.editor.impl.DocumentImpl$1.charAt(DocumentImpl.java:101)
	at io.flutter.editor.WidgetIndentsHighlightingPass.computeLocation(WidgetIndentsHighlightingPass.java:682)
	at io.flutter.editor.WidgetIndentsHighlightingPass.buildWidgetDescriptors(WidgetIndentsHighlightingPass.java:709)
	at io.flutter.editor.WidgetIndentsHighlightingPass.buildWidgetDescriptors(WidgetIndentsHighlightingPass.java:742)
	at io.flutter.editor.WidgetIndentsHighlightingPass.buildWidgetDescriptors(WidgetIndentsHighlightingPass.java:742)
	at io.flutter.editor.WidgetIndentsHighlightingPass.buildWidgetDescriptors(WidgetIndentsHighlightingPass.java:742)
	at io.flutter.editor.WidgetIndentsHighlightingPass.buildWidgetDescriptors(WidgetIndentsHighlightingPass.java:742)
	at io.flutter.editor.WidgetIndentsHighlightingPass.setOutline(WidgetIndentsHighlightingPass.java:547)
	at io.flutter.editor.WidgetIndentsHighlightingPass.run(WidgetIndentsHighlightingPass.java:523)
	at io.flutter.editor.WidgetIndentsHighlightingPassFactory.runWidgetIndentsPass(WidgetIndentsHighlightingPassFactory.java:299)
	at io.flutter.editor.WidgetIndentsHighlightingPassFactory.lambda$createHighlightingPass$4(WidgetIndentsHighlightingPassFactory.java:270)
	at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:315)
	at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.doRun(LaterInvocator.java:435)
	at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:419)
	at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:403)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:762)
	at java.awt.EventQueue.access$500(EventQueue.java:98)
	at java.awt.EventQueue$3.run(EventQueue.java:715)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:732)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:755)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:704)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:391)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
jacob314commented, May 7, 2019

Unfortunately the repro would need to be included on the github bug for me to be able to view it. Let me try creating a custom intellij plugin build with the likely fix and then you can test if the fix works.

1reaction
alxkzmncommented, May 7, 2019

изображение Everything looks fine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AutoFormat and AutoCorrect
The AutoFormat As You Type feature that seems to cause the most trouble is ... In that case the problem is usually that...
Read more >
How to disable auto formatting upon save in Eclipse?
Eclipse keeps auto formatting upon save, for example: it is insisting the following code should be in a single line once I save,...
Read more >
Code formatting style · Issue #3455 · flutter/flutter-intellij - GitHub
Runs auto format and gets helper lines that align properly. Steps to Reproduce. Run auto format with "Reformat code with Dart fmt" or...
Read more >
Automatic AutoCorrect Exceptions for Beginning Sentences
Automatic AutoCorrect Exceptions for Beginning Sentences · Display the Word Options dialog box. · Click Proofing at the left side of the dialog ......
Read more >
AutoCorrecting - Apache OpenOffice Wiki
To turn autoformatting on or off, go to Format > AutoCorrect and select or deselect the items on the submenu. While Typing automatically...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found