htd / nst Goto Github PK
View Code? Open in Web Editor NEWNew Source Tree Komodo Addon
New Source Tree Komodo Addon
Code Browser -like extension for Komodo Edit by Adam Łyskawa Contributors: See content/NST.js PLEASE - UPDATE COMMENT IN content/NST.js, or I could miss your contribution on ActiveState Community website! And I don't want to! Since I'm too busy with my current work to update NST, please feel free to update the code as you like, fix bugs, implement new features. Then test it, e-mail me it works and I'll release it as new version on ActiveState Community website. You don't need to fork the project, if you need anything, like privileges, just ask. I don't use GIT everyday, so I don't even know how to grant them, but I'll find it out. I would love NST to become community project. It's my "baby", but I can't find time to develop it anymore. Maybe if I ever change my job to more related with what NST does or how it works... http://www.youtube.com/watch?v=dj2nqILbPdA Thank you for all the support. Feel free to change this README too. ----------- -- Notes -- ----------- Please don't change code formatting: 2 spaces for indentation, opening braces on the same line. Or if you convinced 4 spaces indentation would look more readable (well, we have bigger screens now) - change the indentation globally in each file, let it be consistent at least. Please document your changes using JSDoc syntax. THANK YOU. ------------------- -- License (BSD) -- ------------------- Copyright (c) 2010-2013, Adam Łyskawa All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Hi there, I'm the lead Komodo developer. We're currently preparing our 9.2 release which includes a package installer, allowing people to easily install packages (addons, macros, skins, etc) such as this one. For your "package" to be installable by user it needs to have a "release", which people can download.
Please consider adding a release, you can find out how by checking steps 3 through 4 on this page. Thank you!
Be sure to also update your install.rdf to reflect the latest version of Komodo that it is compatible with.
It would be good to be able to parse based on "label" keyword in PHP to ease navigation. Conside the sample below:
/***
* ColorCode
*/
color_label: $code['ColorCode'] = array(
'R' => '255,0,0',
'G' => '0,255,0',
'B' => '0,0,255',
);
/***
* PriceCode
*/
price_label: $code['PriceCode'] = array(
'0' => 'FOC',
'50' => '$0.50',
'100' => '$1.00',
);
Or is there a way to remark a section inside comment for easy navigation?
Files very long, like tkinter/__init__.py
which has almost 4000 lines, are not parsed and the symbols list is not built.
Tested with Komodo Edit 11.0.1 on Linux.
Tried uninstalling and reinstalling. Source no longer an option for the toolbox/sidebar.
It would be really nice to get support for YAML.
I would love to write it myself, but I need some little help to begin with (I am a PHP developer, knowing also Javascript)
If you don't know YAML, see http://yaml.org/
Do similarly to Atom: https://github.com/atom/symbols-view/blob/master/lib/tag-generator.coffee
Yesterday I let Komodo Edit auto-update to 8.5. Upon restart, I am finding that the entire Komodo Edit UI is laggy as long as NST ("Source") is selected in the right-hand sidebar. If I have the "Toolbox" selected, everything (eg. scrolling, typing, menu interaction) is snappy. But if I switch to NST ("Source"), there is severe lag while attempting any of those actions, so long as I'm also currently looking at a PHP file in the editor pane.
This is on Ubuntu, 64-bit.
this code parsed wrong
package test;
sub test1 {
return <<EOT;
'
EOT
}
sub test2 {
#
}
"test2" must be in tree too
I just wanted to bring back to your attention a bug report I made in the Active State comments.
In the source tree window, the objects in the tree are cut off about 40% too early. Its almost like NST thinks the window is much more narrow than it actually is.
This only happens in the NST window in my primary editor instance. If I open a new editor window, the NST display is correct there, that is, the elements span the entire width of the NST window.
Screenshots:
http://rcs-comp.com/tmp/nst1.png
http://rcs-comp.com/tmp/nst2.png
http://rcs-comp.com/tmp/nst3.png
http://rcs-comp.com/tmp/nst4.png
You have said you are not able to reproduce this. Its something I can't STOP reproducing :). I have a fresh install of Xubuntu 11.10, fresh install of Komodo Edit, and fresh install of NST.
If you are not able to reproduce, I'd be happy to setup a VM on one of our servers with the problem so you can troubleshoot.
Thanks.
Komodo Edit version 7.1.*, has been around the entire time I've used NST.
edit:
Can anyone else confirm that simply adding
case 'Python3':
p = new LineParserPython();
break;
After case 'Python': fixes this?
This is more a feature-request than bug.
It is not compatible with the latest version of Komodo Edit.
Are there any plans to make it work with that?
Best regards and thanks for this exceptional plugin!
no sub "tst" in code tree:
print $ENV{m};
sub tst() {
}
At the moment this repository has two branches:
testing
basti1253-testing
Wouldn't it be better the rename the main one master
, in order to avoid confusing?
https://stackoverflow.com/questions/30590083/how-to-rename-a-remote-git-branch-name
I know this plugin is dead, and I wonder if someone will read this one day, but still :
I noticed the method list was incomplete in one of my file :
I got only the 3 first methodes and then nothing.
I deleted line by line to find the cause, and it seems to be this line :
$dir = glob($dir.'/*ZZPFORM');
And more exactly these two combined characters : */
Deleting "/*", I got all my methods back in the list.
So there is probably a problem with the parser...
in this code "<<" is "shift left" operator. not heredoc:
sub test1 {
1 << 2;
}
sub test_2 {
#
}
only the first sub shown in tree, but the second one must be shown too
parsing this code:
sub test1 {
m{
\d{2}\s\d
}x;
}
NST generates exception (created illegal regex)
as result: no source tree for file and "wait" cursor
Functions with accents in the name aren't listed.
I know it's not a good idea to use accents in functions/variables names...
Example :
function ajoutActivité() { ... };
Is not shown in the function list.
Version : 0.61.1
Hi,
please add case 'Node.js': in getLineParser()
otherwise, no outline is there for files typed 'Node.js'
like this:
var getLineParser = function(self) {
switch (self.lang = d.language) {
case 'Node.js':
case 'JavaScript':
p = new LineParserJS(self.lang,
['name.prototype = {',
'*name = {',
'name : {'],
['id.prototype.name = function()',
'function name() {',
'*name = function() {',
'*name : function() {']);
break;
case 'ActionScript':
p = new LineParserJS(self.lang,
For example, NST doesn't parse 'some key' property:
var obj = {
'some key': {},
somekey: {}
}
in this code:
sub foo;
sub bar {
#
}
sub foo {
#
}
all functions must be on the same tree indentation level
PS: and again github code highlighter have the same bug
Regular expressions with paired delimiters can contain balanced pairs of that delimiters.
In this code:
package test;
sub test1 {
m{
\d{2}\s\d
}x;
}
sub test2 {
#
}
"test1" and "test2" must be on the same level (inside "test"),
but now only "test1" shown inside "test1" ("test2" on the same level with "test")
PS: github code highlighter parses this code wrong too
perl: searching for subs inside quoted text, pod, after END
In the following code "not_a_subX" are just quoted strings/documentation/data.
But NST shows it in source tree as subroutimes.
package Foo;
print q{sub not_a_sub};
print qq{sub not_a_sub2};
print <<'END_TEXT';
sub not_a_sub3
END_TEXT
=pod
sub not_a_sub4
=cut
m{sub not_a_sub5};
1;
__END__
sub not_a_sub6
screenshot:
http://files.codejumper.ru/nst-bug2.png
In real code this issue affects perl files with documentation and/or code for generating code.
There is more exotic ways, but them don't used in real code:
print q~sub not_a_sub~;
I am using Komodo Edit version 11.1.1 on Windows 10. I have New Source Tree version 0.63. The "source" pane does not list any classes/methods/functions when a C# code file is opened. Is there a way to enable this for C#?
The add-on doesn't works on latest version of Komodo Edit
I do not know how to add this to the code base (never used GIT or GitHub before), but I have added simple, yet incomplete, support for Tcl. Since version 7 of Komodo Edit this was missing but now I can finally update to Komodo Edit 9!
I just cannot find out how to also show the Tcl [proc] parameters in the source tree but maybe anyone here can help? Anyway, here’s the patched NST.xpi file:
http://www.typoscriptics.de/misc/NST-Tcl.xpi
Please include this into the code on GitHub if you find it useful.
It does not work in php-classes when using type-hinting wich was introduced with php 7:
public function xyz(): bool
{
...
}
I think it worth to separate all parsers functions:
content
NST.js
overlay.xul
pane-nst.xul
parsers
python.js
...
In python.js
you will have your function:
(LineParserPython = function(document) {
// code
}());
Then, at the beginning of NST.js
import python.js
using:
xtk.load('chrome://NST/content/parsers/python.js');
see http://docs.komodoide.com/SDK/api/legacy/xtk#xtk_functions_load
Version 0.61 fails to automatically render source tree in Komodo Edit 6.1 when loading source code (tested with PHP, Javascript, HTML, XML).
When switching between tabs the source tree for the previous tab is rendered.
When the file is saved the source tree for the current file is rendered.
When clicking the "refresh" button the source tree for the current file is rendered.
Version 0.59 did not cause these issues in Komodo Edit 6.1.
in this code only "test1" shown in the source tree:
sub test1 {
255 / 2;
}
sub test2 {
#
}
and "test2" is missed
This works:
var MyObject = {
myFunction: function() {
}
}
This doesn't work:
var MyObject = {
myFunction: function myObjectFunction() {
}
}
Unfortunately this makes NST not work for my entire project :(
in this code
sub foo {
(1) / 2;
}
sub bar {
1;
}
only "foo" appears in source tree, and "bar" missed
While and after showing the tree, every movement slows down.
This works:
var MyObject = {
myFunction: function() {
}
}
This doesn't work:
var MyObject = {
myFunction: function myObjectFunction() {
}
}
Unfortunately this makes NST not work for my entire project :(
In the code section:
if top_level_count == 2:
index = cat_nodes_list.index(cat_node)
default_category = cat_nodes_list[index - 1]
break
the line:
default_category = cat_nodes_list[index - 1]
Is interpreted as a function definition and gets listed in the source tree sidebar
Komodo Edit 7.1.4, build 11196
The Ruby parser does not increment the depth for 'while' loops, which causes the indention to be off for method names after a 'while' loop appears in the code.
Here's a patch:
1204c1204
< else if ( code.match(/^(if|unless|case)\b/) ) {
---
> else if ( code.match(/^(if|unless|case|while)\b/) ) {
in this code only "One" in the source tree
One = function() {
this.foo = new bar(
/[/*]/
);
};
Two = function() {};
and "Two" is missed
but for this code both "One" and "Two" and the source tree:
One = function() {
this.foo = new bar(
/[/]/
);
};
Two = function() {};
in this code only "test1" in the source tree:
sub test1 {
sort grep !/reg_date/, @_;
}
sub test2 {
#
}
and "test2" is missed
in this code only "test1" shown in tree:
sub test1 {
/foo/s;
}
sub test2 {
#
}
and "test2" missed
Hi
First, thanks for this nice plugin ;)
For example in Node.js / Express.js (http://expressjs.com/guide.html) it is usual to write following:
app.get('/url1', function(req, res)
{
});
app.get('/url2', function(req, res)
{
});
app.post('/mypost', function(req, res)
{
});
Is it possible to list such constructs in the NST as for example get(url1), get(url2), post(mypost) ?
Thanks
EXCEPTION: properties is undefined
in line 1642
of chrome://nst/content/NST.js
STACK TRACE:
SourceTreeViewClass.prototype.getCellProperties@chrome://nst/content/NST.js:1643 [anonymous]@null:0Wrong nesting for perl functions inside module.
For following code function "one" in NST nested inside module "Foo", but function "two" outside (must be inside)
package Foo;
sub one {
if ( $#_ ) {
1;
}
}
sub two {
1;
}
1;
screenshot:
http://files.codejumper.ru/nst-bug.png
Komodo Edit, version 7.0.2, build 9923, platform linux-x86
NST 0.59
Hi,
the rendering performance of the xslt parser is slow - if I'm opening a file (1000 lines) I notice a few seconds lasting gap till the file is displayed. It'd be very nice if xslt-support can be commented out till the parser is fast enough to handle serious file sizes.
best regards
Sebastian
it does not works as expected in NST 0.59 / komodo edit 7.0.2, build 9923 ; tested on php a file:
instead of toggleing automatic tracking ( the function / class where the cursor is automatically highlighted when this is on ) clicking on this button perform a one-time update of the highlighted function (correctly) wether i'm switching it to on or off.
if I hit the reload button, the highlighted function is updated if this setting is on but this is not the behavior i expected.
Hi,
There is a strange problem with this plugin :
It makes komodo crash at totally random times.
I'm on MacOS X, with Komodo 10.2.2.
I can observe this bug since the Komodo 9 > 10 update.
Sometimes can see a bug report explicitly calling NST as the source of the problem.
If I can catch it again i'll repost it here.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.