Kate Symbol Viewer Plugin

Developers Apps

Source i (link to git-repo or to original if based on someone elses unmodified work):

Add the source-code for this project on opencode.net

1
Become a Fan
5.0

Available as/for:
Description:
Kate Symbol Viewer is a sidebar plugin for Kate that has been integrated in KDE since version 3.2.0.
It allows developers to view symbols (functions, macros and data types) from source code.
By clicking the parsed information you can easily browse the code.
At the moment the following languages are supported:
C/C++, Java, Perl, PHP, Python, Ruby, XSLT, Tcl/Tk, Fortran

Feature list:
- List/Tree mode
- Enable/disable sorting
- Hide/Show Functions Parameters
- Can expand/collapse tree mode
- Auto-update on document change
- Code parsing is based on Kate highlighting
Last changelog:

1.11.0
Improved PHP parser (thanks to Gef)
Improved Fortran parser (thanks to Louis). Support on/off parameters display as well
ANSI C89 supported
key navigation now handles Return key press

1.10.0
*** Added Ruby support

1.9.0
*** Added preliminary PHP support
*** Added XSLT support (thanx to Jiri Tyr)

1.8.1
- perl parser patch (thanx to josander)
- python supports multiline defs/classes
- sorting mode on popup menu

1.8.0
*** Added JAVA support
Basically it uses an improved version of the C++ parser. Not being a Java developer, I would kindly need any feedback from the users.
Following the changes:
- support for classes (not nested, sorry )
- fixes on comments also for macros
- support for inline functions

Configuration Page
- option to automatically expand nodes when in tree mode

This is a version for KDE-apps.org for the KDE 3.5.x users. The mainstream changes are applied only to the KDE 4 SVN trunk.

For a complete changelog please refer to KDE 4 SVN:
http://websvn.kde.org/trunk/KDE/kdesdk/kate/plugins/symbolviewer/
or KDE 3.5 branch:
http://websvn.kde.org/branches/KDE/3.5/kdeaddons/kate/cppsymbolviewer/


Ratings & Comments

50 Comments

truesoupfly

Right click on the symbol viewer panel pops up a context menu. For perl code it lists this as its second group section: -show macros -show structures -show functions They don't work.

truesoupfly

Hi, An equal sign at the start of a line hides functions below it in the symbol viewer. Mandriva 2008.0 i586 kde 3.5.7 Kate Symbol Viewer Plugin 1.11.0 As you know I had to download, and compile to get v1.11.0 on kde3. I don't know if that may be factor. Maybe others can verify by coping and pasting the code below. Here is an example... -------------- sub A{ my $variable = "anything"; } sub B{ my $variable = "somethingelse"; # <- all functions below will be hidden because of this line. } sub C{ #<- does not show my $variable = "somethingelse"; } -------- According to my boss an equals sign on a new line is part of Perl good practices when the write side of the equals is long. Personally I don't like that convention, but I keep having to modify other people's code that has this all over. Thank for a great product keep up the good work!

swarddev

I expect it treats an '=' in the first column special because of its use in Perl Plain Old Docs (delimiters like '=pod' and '=cut').

truesoupfly

I added this to perl_parse.cpp from "^=" to "^=(pod|begin)" from "^=cut$" to "^=(cut|end)" This fixes the function list when it encounters something like this: my foo = 'something'; Getting this plugin to compile under kde3 was challenging, but not too painful. All I needed was the devel rpms I recently moved to kde4 v4.3 (Mandriva 2010), and found myself having to patch the kate symbol viewer again. Here is what I had todo to compile on kde4. 1) install kde4 devel packages 2) check the svn trunk: svn export svn://anonsvn.kde.org/home/kde/trunk/KDE/kdesdk/kate/plugins/symbolviewer/ 3) Edit the CMakeLists.txt Add the following to the beginning: find_package(KDE4) include (KDE4Defaults) include_directories(${KDE4_INCLUDES} ) include(${QT_USE_FILE}) include_directories(${QT_QT3SUPPORT_INCLUDE_DIR}) ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(-DQT3_SUPPORT) 4) run the standard cmake build procedure. $mkdir build cd build cmake .. make make install This was my first cmake build (very cool). It took me a while to figure this out. I hope it saves others some time.

truesoupfly

I added this to perl_parse.cpp from "^=" to "^=(pod|begin)" from "^=cut$" to "^=(cut|end)" This fixes the function list when it encounters something like this: my foo = 'something'; Getting this plugin to compile under kde3 was challenging, but not too painful. All I needed was the devel rpms I recently moved to kde4 v4.3 (Mandriva 2010), and found myself having to patch the kate symbol viewer again. Here is what I had todo to compile on kde4. 1) install kde4 devel packages 2) check the svn trunk: svn export svn://anonsvn.kde.org/home/kde/trunk/KDE/kdesdk/kate/plugins/symbolviewer/ 3) Edit the CMakeLists.txt Add the following to the beginning: find_package(KDE4) include (KDE4Defaults) include_directories(${KDE4_INCLUDES} ) include(${QT_USE_FILE}) include_directories(${QT_QT3SUPPORT_INCLUDE_DIR}) ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(-DQT3_SUPPORT) 4) run the standard cmake build procedure. $mkdir build cd build cmake .. make make install This was my first cmake build (very cool). It took me a while to figure this out. I hope it saves others some time.

derula

Hi and thank you for this great plug-in. However, the Ruby support is annoyingly poor. Optimally there should be a hierarchy like this:

class Foo
  class Bar
  end
end
should result in a tree of the form: Foo - Bar but, seeing the very basic implementation, I don't even expect that. However, please make sure that the following two test scripts get parsed correctly: The first script doesn't contain any valid class definition, but your current version would all detect them as correct:
class 19kgb
class foo
class if
The second one does contain class/module definition which aren't recognized by symbol viewer:
module Foo
  class
    Bar
  end
  class ::Bar
  end
end
(this will, if you're interested, initialize the module Bar and the classes Foo::Bar and Bar.) If you fix this, there will still be a problem in the following script:
module Foo
  class Bar
  end

  def method
  end
end
, as it will recognize method as a method for Foo::Bar instead of Foo, but I can live with that. As long as the second script from the bottom works correctly, I'm happy. Thanks in advance for your effort!

pdescham49

You can use the php_parser for basic javascript parsing. Simply open up pluginkatesymbolviewer.cpp and add else if (hlModeName == "JavaScript") parsePhpSymbols(); around line 248 Cheers Paul.

xrogaan

hay guys, the php parser do not match the "new" php5 oop syntax. More info aboute oop syntax into php5 : http://be.php.net/manual/en/language.oop5.basic.php Go directly into the "visibility" page, i thinks this (public / protected / private / static / ... words break the recognition)

KermitTheFrog

Hi, would you please add support for ANSI C89 to your next release? Just change Quote:

if (hlModeName == "C++" || hlModeName == "C")
to Quote:
if (hlModeName == "C++" || hlModeName == "C" || hlModeName == "ANSI C89")
Thx and greetz Kermit

dragonlord79

Thanks a lot for this ! I will indeed include it in the next release.

FireStorm9

Thanks so much for this plugin!!! I had a file that had over 100 functions, many of which were being lost, and I discovered that escaped quotes didn't seem to handled. I have made the following changes in the php_parser, and it seems to work like a champ. Line 122-128: // Handles a string. Those are freaking evilish ! if ((cl.at(j) == '"') && comment == 3) { if (cl.at(0) == '"' || (j > 0 && cl.at(j - 1) != 0x5c)) { comment = 0; } // only if the string delimiter is not escaped, do we uncomment the block } else if ((cl.at(j) == '"') && comment == 0) { comment = 3; } Thanks again!

dragonlord79

Thanks a lot for this ! I will indeed include it in the next release.

MasterDuke

C++ and Java work, but when I open .pm or .pl files I'm not seeing any symbols. I checked and Kate is highlighting them as Perl files. Is there anything else I need to do? Thanks, Dan

dragonlord79

Hi, it seems you are using the standard KDE 3.5.x plugin which support only C++ and Java. What I post on KDE Apps is something more advanced, that will be included in KDE4 (so your dreams will really become true lol). So, you need to download and compile version 1.10.0

bugmenot1234

Would it be possible to add an option to, say, "treat this file as if it's Java code"? I'm trying to use it for D, which, regrettably, is still not widespread enough to warrant a parser, even though kate _does_ have highlighting for it. Anyway, since D is syntactically _somewhat_ close to Java, this would allow the symbol viewer to work at least partially. Thanks for considering it.

dragonlord79

Hi, in some kind of way you can already do what you'd like to do. The Symbol Viewer is based on Kate highlighting system, so if you select "Java" as highlighting method, the code will be treated as it was Java by the plugin as well. If D is parsed well by symbol viewer, I can consider to extend it to D for the next release. Thanks for your feedback !

cjbottaro

"has been integrated in KDE since version 3.2.0" I'm using KDE 3.5.6 from the official Kubuntu 7.04 repositories and it seems like this plugin is called "c/c++ symbol viewer" and thusly only works for c/c++, I'm guessing, cuz it doesn't do anything when viewing Ruby files. Do you know any way I can get this installed without having to compile from source? Thanks.

dragonlord79

Yeah, sure...you need to wait for KDE 4 ! LOL I posted an improved version of the symbol viewer on kde-apps cause KDE 4 took longer than expected to be developed and moreover cause the KDE team doesn't allow me to commit any major change to the KDE 3.5.x mainline. That's all. Hope it doesn't bother you to compile my plugin. By the way I use Kubuntu as well and it compiles beautifully.

spiros2907

Hey this is great!!! Just installed it and works like a charm. One thing though: there is no Bash parser. As I use kate for shell scripting, I think this would be really useful. All a shell scripting parser has to do is print the function names. Since it is this simple, an existing parser can be used: PHP So in plugin_katesymbolviewer.cpp I changed : else if (hlModeName == "PHP (HTML)" ) to else if (hlModeName == "PHP (HTML)" || hlModeName == "Bash") and it works. Hope you find it useful to include in a future release. Keep it up Best regards Spiros

dragonlord79

Hi, many thanks for the suggestion ! I'll consider it for the next release. Massimo

whiskybar

Thank you for improving the python parser. This plugin is very, very useful - in navigating through someone else's code (of course, my code is easy enough to read without it, [duh])

bigone

Ciao Dragon Lord, i nostri parenti riportano sempre un po' di problemi riguarda la stabilità dei Kate con il tuo plugin. Da report che abbiamo ci sono sempre un 1500-2000 kate al giorno che necessitano di riavviare il nostro editor. Ho provato ad effttuare alconi test con in situazioni "estreme", ossia con una rete molto disturbata, ed effettivamente c'è stato un caso in cui il tuo plug in si è bloccato, smettendo di accettare i dati. Guardando dal log di mozilla (allegao) questo è avvenuto dopo la riga 24914 lKateViewerErrorFunc: instance 0x0 flags 0x1000000 code 0x130701aa Visto la difficoltà nel riprodurlo, è possibile correggere il comportamento del solo log ? Ciao P.S. Scusa il mio taliano

jirityr

All the comments should be written in English.

bigone

bella bella, veramente bella sta plugin, proprio una bella......

Diavolo

That's what I needed in Kate...just add PHP-Support and I am happy :) The Tree-View is just perfect.

Pling
0 Affiliates
Details
license
version 1.11.0
updated
added
downloads 24h 0
mediaviews 24h 0
pageviews 24h 0

Other Developers Apps:

Oo-mox
actionless
last update date: 8 years ago

Score 6.5

KEXI
jstaniek
last update date: 7 years ago

Score 6.5

BlackAdder
appy
last update date: 20 years ago

Score 5.0

Wing IDE Professional
sdeibel
last update date: 15 years ago

Score 5.0

Quanta Gold
appy
last update date: 20 years ago

Score 5.0

Codie
elgunvo
last update date: 15 years ago

Score 5.0



System Tags