GithubHelp home page GithubHelp logo

Comments (7)

krasa avatar krasa commented on July 24, 2024

Works for me, could you send me your format settings file?
What is the failure? Do you have stacktrace?

from eclipsecodeformatter.

EldDraugr avatar EldDraugr commented on July 24, 2024

As I'm not sure if I'm allowed to hand out the formatter file, I cant't give you this as of now. (I'll check if I'm allowed to, though).
This Exception shows in the log file:

krasa.formatter.exception.FormattingFailedException
    at krasa.formatter.eclipse.JSCodeFormatterFacade.formatInternal(JSCodeFormatterFacade.java:83)
    at krasa.formatter.eclipse.CodeFormatterFacade.format(CodeFormatterFacade.java:18)
    at krasa.formatter.plugin.EclipseCodeFormatter.reformat(EclipseCodeFormatter.java:103)
    at krasa.formatter.plugin.EclipseCodeFormatter.formatWhenEditorIsOpen(EclipseCodeFormatter.java:84)
    at krasa.formatter.plugin.EclipseCodeFormatter.format(EclipseCodeFormatter.java:51)
    at krasa.formatter.plugin.EclipseCodeStyleManager.formatWithEclipse(EclipseCodeStyleManager.java:187)
    at krasa.formatter.plugin.EclipseCodeStyleManager.format(EclipseCodeStyleManager.java:95)
    at krasa.formatter.plugin.EclipseCodeStyleManager.reformatText(EclipseCodeStyleManager.java:59)
    at com.intellij.codeInsight.actions.ReformatCodeProcessor$1.call(ReformatCodeProcessor.java:94)
    at com.intellij.codeInsight.actions.ReformatCodeProcessor$1.call(ReformatCodeProcessor.java:83)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$1.call(AbstractLayoutCodeProcessor.java:199)
    at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$1.call(AbstractLayoutCodeProcessor.java:191)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$3.run(AbstractLayoutCodeProcessor.java:255)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:984)
    at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$10$1$1.run(AbstractLayoutCodeProcessor.java:484)
    at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:124)
    at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:99)
    at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:85)
    at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$10$1.run(AbstractLayoutCodeProcessor.java:479)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:319)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
    at java.awt.EventQueue.access$200(EventQueue.java:103)
    at java.awt.EventQueue$3.run(EventQueue.java:694)
    at java.awt.EventQueue$3.run(EventQueue.java:692)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
    at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:697)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:524)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:335)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

from eclipsecodeformatter.

krasa avatar krasa commented on July 24, 2024

The config file should contain only some eclipse formatter settings, therefore nothing sensitive.

The error means that the eclipse formatter failed somewhere inside, unfortunately it never tells why, probably upgrade of eclipse libs could help.

Does it work in Eclipse? If so, which version?

from eclipsecodeformatter.

EldDraugr avatar EldDraugr commented on July 24, 2024

Formatting in Eclipse works. Version is Kepler, SR1 build 20130919-0819.

I additionally found out, that the instanceof operator in the if condition makes the difference.

from eclipsecodeformatter.

krasa avatar krasa commented on July 24, 2024

Ok, it contains much newer lib, My guess is that if you replace this lib:
org.eclipse.wst.jsdt.core_1.1.101.v201108151912.jar

in .WebStorm\config\plugins\EclipseFormatter\lib

by that from your eclipse, it should start to work.

from eclipsecodeformatter.

EldDraugr avatar EldDraugr commented on July 24, 2024

Unfortunately not.

As a workaround I changed the if condition to use the $classname property instead of the instanceof operator.

from eclipsecodeformatter.

krasa avatar krasa commented on July 24, 2024

I have upgraded all libs, if that does not help, I don't know what will.

from eclipsecodeformatter.

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.