
Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net
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
13 years ago
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/
13 years ago
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/
truesoupfly
11 years ago
For perl code it lists this as its second group section:
-show macros
-show structures
-show functions
They don't work.
Report
truesoupfly
12 years ago
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!
Report
truesoupfly
11 years ago
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.
Report
truesoupfly
11 years ago
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.
Report
swarddev
12 years ago
Report
derula
12 years ago
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!
Report
pdescham49
12 years ago
Simply open up pluginkatesymbolviewer.cpp and add
else if (hlModeName == "JavaScript")
parsePhpSymbols();
around line 248
Cheers
Paul.
Report
xrogaan
13 years ago
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)
Report
KermitTheFrog
13 years ago
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
Report
dragonlord79
13 years ago
I will indeed include it in the next release.
Report
FireStorm9
13 years ago
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!
Report
dragonlord79
13 years ago
I will indeed include it in the next release.
Report
MasterDuke
13 years ago
Thanks,
Dan
Report
dragonlord79
13 years ago
So, you need to download and compile version 1.10.0
Report
bugmenot1234
13 years ago
Anyway, since D is syntactically _somewhat_ close to Java, this would allow the symbol viewer to work at least partially.
Thanks for considering it.
Report
dragonlord79
13 years ago
If D is parsed well by symbol viewer, I can consider to extend it to D for the next release.
Thanks for your feedback !
Report
cjbottaro
13 years ago
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.
Report
dragonlord79
13 years ago
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.
Report
spiros2907
13 years ago
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
Report
dragonlord79
13 years ago
I'll consider it for the next release.
Massimo
Report
whiskybar
14 years ago
Report
bigone
14 years ago
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
Report
jirityr
14 years ago
Report
bigone
14 years ago
Report
Diavolo
14 years ago
The Tree-View is just perfect.
Report