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

Wrong line error #2

Closed
vonovak opened this issue Aug 11, 2016 · 6 comments
Closed

Wrong line error #2

vonovak opened this issue Aug 11, 2016 · 6 comments

Comments

@vonovak
Copy link

vonovak commented Aug 11, 2016

thanks for the plugin!

I encountered this when editing the last line of file. I probably made a new line before the error appeared.

Wrong line: 41. Available lines count: 41
java.lang.IndexOutOfBoundsException: Wrong line: 41. Available lines count: 41
    at com.intellij.openapi.editor.impl.LineSet.b(LineSet.java:170)
    at com.intellij.openapi.editor.impl.LineSet.getLineStart(LineSet.java:155)
    at com.intellij.openapi.editor.impl.DocumentImpl.getLineStartOffset(DocumentImpl.java:931)
    at com.github.dsilva.flowtc.TypeCheck.errors(TypeCheck.java:123)
    at com.github.dsilva.flowtc.ExternalAnnotator.doAnnotate(ExternalAnnotator.java:55)
    at com.github.dsilva.flowtc.ExternalAnnotator.doAnnotate(ExternalAnnotator.java:14)
    at com.intellij.codeInsight.daemon.impl.ExternalToolPass.d(ExternalToolPass.java:212)
    at com.intellij.codeInsight.daemon.impl.ExternalToolPass.access$500(ExternalToolPass.java:44)
    at com.intellij.codeInsight.daemon.impl.ExternalToolPass$1.run(ExternalToolPass.java:160)
    at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:320)
    at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:310)
    at com.intellij.util.ui.update.MergingUpdateQueue.lambda$flush$1(MergingUpdateQueue.java:260)
    at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:274)
    at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:229)
    at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:222)
    at com.intellij.util.Alarm$Request$1.run(Alarm.java:378)
    at com.intellij.util.Alarm$Request.run(Alarm.java:389)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask.run(SchedulingWrapper.java:227)
    at com.intellij.util.concurrency.BoundedTaskExecutor.runFirstTaskThenPollAndRunRest(BoundedTaskExecutor.java:178)
    at com.intellij.util.concurrency.BoundedTaskExecutor.access$000(BoundedTaskExecutor.java:40)
    at com.intellij.util.concurrency.BoundedTaskExecutor$2.run(BoundedTaskExecutor.java:197)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
@dsilva
Copy link
Owner

dsilva commented Aug 11, 2016

Thank you for the report!

Do you remember more details of the scenario that led to this, and can you reproduce it consistently? I'm having a bit of trouble reproducing that exception.

@vonovak
Copy link
Author

vonovak commented Aug 11, 2016

try this file:

/**
 * @flow
 */
export default class Project {
    id: number;
     status: string;
     name: string;

    constructor(ProjectStore: any, projectJson: Object) {
        this.id = projectJson.id;
        this.status = projectJson.status
    }

}

note the empty line at the end.
start writing on the empty line (var for example) and the error should pop out.

WebStorm 2016.2.1
Build #WS-162.1447.27, built on August 2, 2016

@dsilva
Copy link
Owner

dsilva commented Aug 11, 2016

Hmm, still can't repro with that file and that webstorm version. What does your project structure look like and what's in your .flowconfig?

@vonovak
Copy link
Author

vonovak commented Aug 11, 2016

.flowconfig


.*/node_modules/*

[include]

[libs]
node_modules/react-native/Libraries/react-native/react-native-interface.js
node_modules/react-native/flow
flow/

[options]
module.system=haste
esproposal.decorators=ignore
unsafe.enable_getters_and_setters=true

esproposal.class_static_fields=enable
esproposal.class_instance_fields=enable

munge_underscores=true

module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub'
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'

suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FixMe

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-4]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-4]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
[version]
0.30.0

as for project structure, I have a root folder with node_modules and js subfolder (with a bunch of other subfolders) and then other react native-specific folders

@dsilva dsilva closed this as completed in 7c38835 Aug 11, 2016
@dsilva
Copy link
Owner

dsilva commented Aug 11, 2016

Thank you -- I can see it now. This happens whenever Flow reports a parse error of the form "Unexpected end of input" and is similar to the issue another plugin ran into at mrcljx/rubocop-for-rubymine#17

@dsilva
Copy link
Owner

dsilva commented Aug 11, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants