[ANN] MiniWiki plugin, v0.2

v 0.2:
added : anchors, and super-anchors
-


Anchors are similar to html anchors.
SuperAnchors add a persistent highlighting, and a gutter icon to the
link target. (see attached illustration)

ex. of anchor:

../../bugs.txt#bug001

.#bug002

ex. of super-anchors:

../../bugs.txt##bug001

(With super-anchors, the target of the link is highlighted, and receives
an icon in the gutter.)



Example of usage:
-



file home.txt

this project:


todo.txt

bugs.txt

../../META-INF/plugin.xml

../doc/documentation.txt

version.txt


file todo.txt

todo for version 0.3


1° fix

bugs.txt##bug001-001

bugs.txt#bug001-002

| 2° update version.txt
| 3° update ../../META-INF/plugin.xml
| 4° update ../doc/documentation.txt


file bugs.txt

|
| #bug001-001: gutter icon is too wide
| #bug001-002: gutter icon is too wide













Attachment(s):
MiniWiki-v02.png
14 comments
Comment actions Permalink

Hi Alain,

thanks a lot for your plugin; this is really very useful functionality!

Here's one suggestion for an extension that I believe would make it even better: Allow Ctrl-B navigation from the output console (currently if I try it, I get a NPE).
I often have information on classes or certain files in the log output, and quicker navigation there would be really cool.

Anyway, thanks again for the work!

Regards,
Jens

0
Comment actions Permalink

YARFE (yet another request for enhancement):

Take attached sources into consideration
(e.g. Ctrl-B on "java.lang.String" only navigates to the compiled class file; not the source)

0
Comment actions Permalink


JetBrains/anybody in the know:

For "java.lang.String",
how can I get a VirtualFile that points to the attached source, and not
the decompiled code, (as happens with the code below ?

PsiClass psiClass = PsiManager.getInstance (i_project).findClass
("java.lang.String");
PsiFile psiFile = psiClass.getContainingFile ();
VirtualFile file = psiFile.getVirtualFile (); // problem: this is the
decompiled code, not the attached source.

TIA

Alain

0
Comment actions Permalink

Hello Alain,

It looks great! One request so far: can you make it work in java files as
well (in comments)? My TODOs would never look the same again. :)

Thx,
Andrei



0
Comment actions Permalink

PsiClass psiClass = PsiManager.getInstance (i_project).findClass
("java.lang.String");
PsiClass psiSourceClass = psiClass.getNavigationElement();
PsiFile psiFile = psiSourceClass.getContainingFile ();
VirtualFile file = psiFile.getVirtualFile ();

0
Comment actions Permalink

Alexei Nikitin wrote:

>psiSourceClass = psiClass.getNavigationElement();

>


Works fine. Thanks.

I noticed every psiElement has a navigationElement. What is it
exactly/does it do? I checked the doc, but found nothing.


Alain

0
Comment actions Permalink

Jens Voss wrote:

>Take attached sources into consideration

>
fixed in v0.3, thanks to Alexei's reply.

Alain

0
Comment actions Permalink

Andrei Oprea wrote:

>

can you make it work in java files as well (in comments)?



Already planned. Coming. Soon.

Alain

0
Comment actions Permalink

Jens

>Here's one suggestion for an extension that I believe would make it even better: Allow Ctrl-B navigation from the output console (currently if I try it, I get a NPE).

>

This plugin only works in editor (text, and soon java).
I tried pressing Ctrl-B in the output console, but never got an NPE.

Alain

0
Comment actions Permalink

Alain Ravet wrote:

Alexei Nikitin wrote:

>> psiSourceClass = psiClass.getNavigationElement();
>>
>>


Works fine. Thanks.

I noticed every psiElement has a navigationElement. What is it
exactly/does it do? I checked the doc, but found nothing.


Alain

getNavigationElement() returns PsiElement's best possible navigation
counterpart. Thus for compiled classes it returns their source version
if available.

--
Maxim Shafirov
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

Maxim,

getNavigationElement() returns PsiElement's best possible navigation
counterpart. Thus for compiled classes it returns their source version
if available.

>

But for compiled classes, when else does it makes sense to use, rather
than the plain element?

Alain

0
Comment actions Permalink

can you make it work in java files as well (in comments)? My TODOs
would never look the same again. :)



Done, in v0.3

Alain

0
Comment actions Permalink

Alain Ravet wrote:

Maxim,

>> getNavigationElement() returns PsiElement's best possible navigation
>> counterpart. Thus for compiled classes it returns their source version
>> if available.
>>


But for compiled classes, when else does it makes sense to use, rather
than the plain element?

Alain

Accessing compiled classes source counterparts isn't free, right? So we
avoid using those in every case possible. Thus we're able to skip their
indexing while building initial repository at startup.
So, we use .class files in any case we're able to get necessary
information from there. Namely, it's all IDEA's functionality except
request to view/edit source file of course and a workaround of a little
annoyance we need to get method parameters which absent in the compiled
classes.

--
Maxim Shafirov
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

Hello Alain,

Works great, thanks.

Andrei

>> can you make it work in java files as well (in comments)? My TODOs
>> would never look the same again. :)
>>

Done, in v0.3

Alain



0

Please sign in to leave a comment.