Giter VIP home page Giter VIP logo

Comments (4)

ahshah avatar ahshah commented on June 1, 2024

Android Studio had set the file to Read-only mode as it was confused as to the state of it's own buffer, compared to the file on disk. Once I cleared this read-only state by refreshing Studio's buffer by reading the file from disk into the buffer, this exception also went away.

from comrade.

beeender avatar beeender commented on June 1, 2024

Hmm, what was the file that AndroidStudio set it o readonly?

Android Studio had set the file to Read-only mode as it was confused as to the state of it's own buffer, compared to the file on disk.

Is there any other process tries to change that file?

When Comrade connect to the AndroidStudio, it won't save to disk anymore to avoid this kind of situation. Instead, it will just sync the changes to AndroidStudio's buffer.

Is there any way that i can reprodcue the issue? thanks!

from comrade.

ahshah avatar ahshah commented on June 1, 2024

Let me look into reproducing for you. This happened I think in the following order:

  1. Open file foo.java in vim-Comrade
  2. Open same file, foo.java, in regular vim
  3. Make a change in foo.java using regular vim and write to disk
  4. Switch to vim-comrade and attempt to make changes (cloberring the old changes) and attempt to write the buffer
  5. Navigating to studio, which was alerted to the buffer change made in step 3.

from comrade.

ahshah avatar ahshah commented on June 1, 2024

I've been able to reproduce something like what I saw, but not exactly.
Essentially you need two editors open on the same file in the project. One editor is Comrade enabled, the other one is regular vanilla nvim. If non-comrade instances write to the file, and then the comrade-enabled instance writes to the same file, clobbering over each other. causes (sometimes) an IllegalStateException.

Here's another Exception I saw

java.lang.IllegalStateException
at com.intellij.codeInsight.daemon.impl.quickfix.AddMethodQualifierFix.getText(AddMethodQualifierFix.java:59)
at com.intellij.codeInsight.daemon.impl.HighlightInfo$IntentionActionDescriptor.toString(HighlightInfo.java:883)
at java.lang.String.valueOf(String.java:2994)
at java.lang.StringBuilder.append(StringBuilder.java:131)
at com.intellij.openapi.util.Pair.toString(Pair.java:81)
at java.lang.String.valueOf(String.java:2994)
at java.util.Arrays.toString(Arrays.java:4571)
at com.intellij.util.containers.LockFreeCopyOnWriteArrayList.toString(LockFreeCopyOnWriteArrayList.java:779)
at java.lang.String.valueOf(String.java:2994)
at java.lang.StringBuilder.append(StringBuilder.java:131)
at com.intellij.codeInsight.daemon.impl.HighlightInfo.toString(HighlightInfo.java:375)
at java.lang.String.valueOf(String.java:2994)
at java.lang.StringBuilder.append(StringBuilder.java:131)
at org.beeender.comradeneovim.insight.InsightItem.(InsightItem.kt:26)
at org.beeender.comradeneovim.insight.InsightProcessor$process$1$itemMap$2.invoke(InsightProcessor.kt:78)
at org.beeender.comradeneovim.insight.InsightProcessor$process$1$itemMap$2.invoke(InsightProcessor.kt:34)
at kotlin.sequences.TransformingSequence$iterator$1.next(Sequences.kt:172)
at kotlin.collections.MapsKt__MapsKt.putAll(Maps.kt:372)
at kotlin.collections.MapsKt__MapsKt.toMap(Maps.kt:540)
at kotlin.collections.MapsKt__MapsKt.toMap(Maps.kt:534)
at org.beeender.comradeneovim.insight.InsightProcessor$process$1.run(InsightProcessor.kt:80)
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:764)
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:74)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:734)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:757)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:706)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:375)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
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)

from comrade.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.