Invoking quick fix requires write access to file?

It looks like invoking a quick fix *which does not modify the file
("File A") in which the corresponding intention shows up* requires write
access to File A. This is done before applyFix is ever invoked, so I
don't think it's something I've done wrong. Is this some bug in IDEA or
is there some special way to configure the quick fix?

Thanks

3 comments

Keith Lea wrote:

It looks like invoking a quick fix *which does not modify the file
("File A") in which the corresponding intention shows up* requires write
access to File A. This is done before applyFix is ever invoked, so I
don't think it's something I've done wrong. Is this some bug in IDEA or
is there some special way to configure the quick fix?


AFAIK, LocalQuickFixes are Intentions that run with startInWriteAction() returning true.
That seems to be a reasonable mode for most QuickFixes. How exactly do you know that it
requires write access and what problem does it cause?

Sascha

0

Sascha Weinreuter wrote:

AFAIK, LocalQuickFixes are Intentions that run with startInWriteAction()
returning true. That seems to be a reasonable mode for most QuickFixes.
How exactly do you know that it requires write access and what problem
does it cause?


It asks to p4 edit the file. The problem is that the user will have
unnecessarily files open for edit in perforce.

0

Keith Lea wrote:

It asks to p4 edit the file. The problem is that the user will have
unnecessarily files open for edit in perforce.


Oh. Then I guess its unrelated to the WriteAction, but IDEA tries to check out the file
because it anticipates that the QuickFix will most likely modify the file. Would be
interesting if other non-modifying QuickFixes (Ignore External Resource, etc) do the same.

Sascha

0

Please sign in to leave a comment.