standalone diff tool...

I like the diff tool that Idea has very much. So I thought, may I can write a simple wrapper app that uses the diff tool and compares any 2 files. I want this to be standalone so that I can run this outside of intellij.

I tried 2 different code pieces and both of them are failing at the point
ApplicationManager.getInstance().getComponent(<...>)

ApplicationManager.getInstance() is returning null.

Here are the 2 samples that I tried...

OR

Is there any way of making this happen outside intellij?

thanks

10 comments

I doubt you can do that. First there might be some licensing problem. Second, the initialization entry points are not part of the openapi. All components are created and initialized explicitely somewhere from the idea main and place in a global map (in the project or the application). Since there is no lazy initialization done inside the XXX.getInstance() methods you cannot just call them like that and expect valid results without running from IDEA.

Just use Beyond Compare. It is very cheap ($39 I believe) and do a nicer diff job (it doesn't do java hightlighting though).

Sorry

Jacques

0

Jacques is right. There is no way (for you) to make Idea diff standalone.
There is request http://www.intellij.net/tracker/idea/viewSCR?publicId=15211

--

Dmitry Peshehonov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


"Vinay Moharil" <vmohar98@yahoo.com> wrote in message
news:3486485.1076544718965.JavaMail.itn@is.intellij.net...

I like the diff tool that Idea has very much. So I thought, may I can

write a simple wrapper app that uses the diff tool and compares any 2 files.
I want this to be standalone so that I can run this outside of intellij.
>

I tried 2 different code pieces and both of them are failing at the point
ApplicationManager.getInstance().getComponent(<...>)

>

ApplicationManager.getInstance() is returning null.

>

Here are the 2 samples that I tried...

>

     final DiffTool ideaDiffTool = dm.getIdeaDiffTool();
>     DiffRequest diffRequest = new SimpleDiffRequest(     null, "Diff
Tool" );
>     ideaDiffTool.show( diffRequest );]]>

OR

>

     panel.setTitle1( "File 1");
>     panel.setTitle2( "File 2");
>     final VirtualFileManager vfInstance =
VirtualFileManager.getInstance();]]>

Is there any way of making this happen outside intellij?

>

thanks



0

any estimated time frame on this one?

0

It isn't planned for any particular verison, but I want it implemented time
to time.
So it'll be done as soon as I (or some else team-mate) be in great need of
it, or it will be voted enough. Most likely this happens before 4.1, but I
can't provide you any guarantee.

--

Dmitry Peshehonov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


"Vinay Moharil" <vmohar98@yahoo.com> wrote in message
news:32442392.1076600434870.JavaMail.itn@is.intellij.net...

any estimated time frame on this one?



0

Hi! Are any changes in this usefull request since 2005 year? I also need Diff standalone util. Thank you.

0

Ok, I mean any Diff-api for combaining to PsiFiles (for example) and getting list of changes (in which PsiElements where changes and etc)

0

Hello Andremoniy,

Hi! Are any changes in this usefull request since 2005 year? I also
need Diff standalone util. Thank you.


idea.exe diff ]]>

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Hello Andremoniy,

Ok, I mean any Diff-api for combaining to PsiFiles (for example) and
getting list of changes (in which PsiElements where changes and etc)


Note that this has nothing to do at all with the question asked in the original
post.

There is no API in IDEA to calculate differences between PSI trees directly,
but you can use the DiffTree utility class to implement this by yourself.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Hi Dmitry, I tried to use "idea diff <file1> <file2>" with Intellij 7 and 9.0M1 and for both I get below stack trace. Any IDEAs?

java.lang.IllegalArgumentException: Argument 0 for @NotNull parameter of com/intellij/openapi/editor/impl/EditorFactoryImpl.createEditor must not be null
        at com.intellij.openapi.editor.impl.EditorFactoryImpl.createEditor(EditorFactoryImpl.java)
        at com.intellij.openapi.diff.impl.DiffUtil.createEditor(DiffUtil.java:20)
        at com.intellij.openapi.diff.impl.highlighting.EditorPlaceHolder.setContent(EditorPlaceHolder.java:3)
        at com.intellij.openapi.diff.impl.highlighting.DiffPanelState$1.run(DiffPanelState.java:3)

0

Hello Yevgeniy,

This exception can be thrown if one of the files you're diffing is not recognized
as a text file. The diagnostics can of course be better; please file a JIRA
issue for this at http://www.jetbrains.net/jira

Hi Dmitry, I tried to use "idea diff <file1> <file2>" with Intellij 7
and 9.0M1 and for both I get below stack trace. Any IDEAs?


java.lang.IllegalArgumentException: Argument 0 for @NotNull parameter
of com/intellij/openapi/editor/impl/EditorFactoryImpl.createEditor
must not be null
at
com.intellij.openapi.editor.impl.EditorFactoryImpl.createEditor(Editor
FactoryImpl.java)
at
com.intellij.openapi.diff.impl.DiffUtil.createEditor(DiffUtil.java:20)
at
com.intellij.openapi.diff.impl.highlighting.EditorPlaceHolder.setConte
nt(EditorPlaceHolder.java:3)
at
com.intellij.openapi.diff.impl.highlighting.DiffPanelState$1.run(DiffP
anelState.java:3)
---
Original message URL:
http://www.jetbrains.net/devnet/message/5241936#5241936

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Please sign in to leave a comment.