6619 Commits

Author SHA1 Message Date
Colomban Wendling
387d6e1909 PHP: don't include the leading "$" in variable names 2013-04-15 19:17:57 +02:00
Colomban Wendling
b5cd5343fa PHP: fix parsing functions arguments list containing comment or strings
Instead of hand-parsing the argument list and possibly choking inside
comments, strings, heredoc, etc., use the normal token mechanism and
simply convert the tokens to a string representation as the argument
list.  This technique might perhaps lead to some missing characters in
the argument list representation in the (unlikely) case a token
appearing in the argument list is reported as a generic type for which
it is impossible to know the correct string representation, but this
could always be fixed by adding a specific token type and is anyway
less problematic than maybe breaking further parsing of the document.
2013-04-15 19:17:57 +02:00
Colomban Wendling
444745f71e Added new macro for reading last character of vString.
Import of CTags revision 719.
2013-04-15 19:17:57 +02:00
Colomban Wendling
8086129c9c PHP: parse namespaces
PHP namespaces don't work anything like a block, so the implementation
is specific and not combined with scope management.  Namespaces cannot
be nested, and they may apply either to the rest of the file (until the
next namespace declaration, if any) or to a specific block.

Namespaces applying to the rest of the file:

	namespace Foo;
	/* code in namespace Foo */
	namespace Bar\Baz;
	/* code in namespace Bar\Baz */

Namespaces applying to blocks:

	namespace Foo {
		/* code in namespace Foo */
	}
	namespace Bar\Baz {
		/* code in namespace Bar\Baz */
	}
	namespace {
		/* code in root namespace */
	}
2013-04-15 18:55:52 +02:00
Colomban Wendling
c2e4111aaf PHP: parse HereDoc and NowDoc strings 2013-04-15 18:55:14 +02:00
Colomban Wendling
258c4fa65d PHP: generate tags for local variables (disabled by default) 2013-04-15 18:54:42 +02:00
Colomban Wendling
1c3fd55818 PHP: fix generating variable tags for rvalues
Only generate tags for variable declarations without assignments inside
classes and interfaces not to get fooled by rvalues.

This prevents generation of a "$bar" tag for something like:

	$foo = $bar;

while still generating "$bar" tag for:

	class Foo {
		var $bar;
	}
2013-04-15 18:53:59 +02:00
Colomban Wendling
af47ccf98d PHP: report anonymous functions as functions rather than variables
Generate a full function tag for anonymous functions:

	$anon = function($arg1, $arg2) {
		/* ... */
	};
2013-04-15 18:53:07 +02:00
Colomban Wendling
5798f47ea0 PHP: make some arguments const 2013-04-15 18:52:14 +02:00
Colomban Wendling
bdb98f0132 PHP: fix parsing of functions returning a reference
Fix parsing of functions declarations with a leading ampersand (&),
used to make the function return a reference:

	function &foo($arg1, $arg2) {
		/* ... */
	}
2013-04-15 18:51:26 +02:00
Colomban Wendling
d283eb243c PHP: parse and report interfaces 2013-04-15 18:47:54 +02:00
Colomban Wendling
23339dd509 PHP: report class inheritance 2013-04-15 18:43:22 +02:00
Colomban Wendling
f5d315809d PHP: report visibility and implementation type
Report visibility (private/protected/public) and implementation
(abstract or not) for every tag for which it makes sense.
2013-04-15 18:42:08 +02:00
Colomban Wendling
be07870e97 Rewrite the PHP parser as a non-regex parser
Rewrite the PHP parser as a real parser, not using regexes.  This is
more complex but allows for better parsing.

Visible changes:
* Scope reporting;
* Variables inside functions are no longer reported (this is a
  deliberate choice, but can be easily changed);
* Only the PHP part is parsed (e.g. it doesn't report JavaScript
  functions anymore);
* Function arguments spanning several lines are properly reported;
* Interfaces are not yet parsed.

Otherwise the new parser should behave like the old one, at least
where it used to be right.  Parsing of more constructs and reporting
more details is planned.
2013-04-15 18:36:24 +02:00
Colomban Wendling
d453fe33fe Add support for loading Vi and CTags tag files
This allows to load tag files in the CTags format, which is compatible
with Vi format.

References:
 * http://ctags.sourceforge.net/FORMAT
 * http://ctags.sourceforge.net/ctags.html#TAG%20FILE%20FORMAT
2013-04-03 22:10:33 +02:00
Nick Treleaven
99d06abea8 Use widget parameter in on_find_usage() for consistency 2013-03-25 15:57:58 +00:00
Nick Treleaven
4fcce9cc00 Add symbol list Find in Files popup menu item 2013-03-25 15:57:56 +00:00
Nick Treleaven
2da51eb829 Note: Find Usage can be used from the symbol list popup menu 2013-03-25 15:57:54 +00:00
Colomban Wendling
235b8613fb Use GSlice to allocate find_range() elements 2013-03-24 18:47:55 +01:00
Colomban Wendling
2c11c3c5e7 Fix cursor position and selection after comment toggling
Fix the selection start position after uncommenting if it was inside
the comment marker;  and fix the selection end position if it was in
the indentation or before or inside the comment marker.

Improved fix for #3576431.
2013-03-24 18:34:29 +01:00
Colomban Wendling
4f78efc9f1 Unify algorithm for searching all matches inside a range
Instead of re-implementing the search-all algorithm everywhere it is
needed, move it to a re-usable function.  This is useful because some
care is required to avoid improper rematches and endless loop, so
avoiding duplication is important (especially if something has to be
fixed someday).
2013-03-24 15:53:39 +01:00
Colomban Wendling
c83a93eb65 Fix search/replace for the replacement not to change search results
Fix the search & replace algorithm to make sure a replacement won't
possibly affect the next one (e.g. in case of lookahead and lookbehind
regular expressions).

To do so, first find all occurrences and only then perform replacements,
instead of doing both together.

This fixes searching/replacing of any pattern that may be affected by
its replacement (e.g. patterns that look for something not a character
in the match range), including:

 * Start/end of line:
   Before this change, searching with regular expression "^A" and
   replacing with an empty string on the input "AA" would have resulted
   in an empty output ("^A" matching again after removing the first
   one).  Now it properly only removes the leading "A".
 * Lookahead/lookbehind:
   Pattern "(?<=a)b" with empty replacement and input "abb" would have
   resulted in the output "a" instead of "ab".
 * And more generally, many patterns matching non-characters like
   positions or out-of-match characters.
2013-03-24 15:50:22 +01:00
Colomban Wendling
0191659663 Fix swapped tooltips between "run in VTE"/"skip run script" 2013-03-24 15:38:30 +01:00
Lex
e18d75b23b Change signal used to kill executions to SIGTERM
The originally used SIGQUIT has problems:
1) see the deleted comment
2) some xterm alternatives ignore it, so they don't stop

Changed to SIGTERM which is the canonical "terminate" signal.

Removed associated unneeded ignore of SIGQUIT.
2013-03-23 11:58:45 +11:00
Lex
0d84e129bd Add to description of "Newline strips trailing spaces"
Add description of interaction between this action and indentation
since it is not obvious.
2013-03-23 11:48:09 +11:00
Colomban Wendling
b1fb2ab053 Fix various line length computation issues for the last line
The last line doesn't have EOL characters, so computing
(line_length() - eol_length()) is wrong on the last line.

Instead, use (line_end_pos() - line_start_pos()) as suggests
Scintilla's documentation.

Closes PR#124
2013-03-20 23:17:19 +01:00
Frank Lanitz
2cdfeed69e Adding hint for installation via sudo to documentation 2013-03-20 21:20:35 +01:00
Colomban Wendling
57940e67a3 Windows: use absolute path to the icons directory 2013-03-19 16:59:32 +01:00
Igor Shaula
68f3a9fe5a Filetypes: Add some Ruby file extensions 2013-03-19 15:07:43 +01:00
Colomban Wendling
b7485c1925 Merge "Improve GTK compatibility macros for GTK 2.16" from eht16/master 2013-03-19 14:58:50 +01:00
Enrico Tröger
9d412702e8 Make the compat_widget_set_flag macro more robust 2013-03-19 14:43:12 +01:00
Enrico Tröger
de03636e5c Add a note to update http://download.geany.org/MD5SUMS 2013-03-19 14:27:31 +01:00
Enrico Tröger
d9c7f59b41 Improve GTK compatibility macros for GTK 2.16
On GTK 2.16 GTK_WIDGET_[UN]SET_FLAGS resolves to a do-while construct which
raises a syntax error when embedded into a ? operator.
Also gtk_widget_get_visible() is only available since GTK 2.18, so add a fallback to
the old variant.
2013-03-19 14:17:25 +01:00
Colomban Wendling
3291c30de5 Fix utils_parse_and_format_build_date() 2013-03-17 19:36:17 +01:00
Colomban Wendling
11acb59980 Add code for TMTag reference debugging
This code is disabled by default, and is enabled if the DEBUG_TAG_REFS
C preprocessor macro is defined.
2013-03-17 17:31:36 +01:00
Colomban Wendling
e409b70fab Fix various TMTag leaks 2013-03-17 17:31:36 +01:00
Enrico Tröger
fbce364182 Improve build date conversion code
Don't use strptime() as it is not very portable, instead use a GDate and use the
code also for the date output in --version.
2013-03-17 17:17:09 +01:00
Christian Dywan
d270e6c690 Parse compiler provided build date to use the translatable date format string 2013-03-17 17:17:09 +01:00
Christian Dywan
1db4cd90df Drop obsolete 'has_separator' property from the interface definitions 2013-03-17 17:17:09 +01:00
Christian Dywan
a982908bec Define default template date format strings globally and make them translatable 2013-03-17 17:17:09 +01:00
Nick Treleaven
7150c63f22 Add Find Usage popup menu items for symbol list tags (#3608278) 2013-03-17 13:30:59 +00:00
Colomban Wendling
058bbc5368 Update NEWS 2013-03-16 16:49:53 +01:00
Colomban Wendling
232290aad4 Fix our custom styles under KDE and for people using gtk-chtheme
We have a custom RC file defining various styles we need, and we want
the user to be able to override them (e.g. if they want -- or need --
other colors).  Fair enough, one would simply call gtk_rc_parse() with
the appropriate filename.  However, the styling rules applies in the
order they are loaded, then if we load our styles after GTK has loaded
the user's ones we'd override them.

There are 2 solutions to fix this:
1) set our styles' priority to something with lower than "user"
   (actually "theme" priority because rules precedence are first
   calculated depending on the priority no matter of how precise the
   rules is, so we need to override the theme).
2) prepend our custom style to GTK's list while keeping priority to
   user (which is the default), so it gets loaded before real user's
   ones and so gets overridden by them.

One would normally go for 1 because it's ways simpler and requires less
code: you just have to add the priorities to your styles, which is a
matter of adding a few ":theme" in the RC file.  However, KDE being a
bitch it doesn't set the gtk-theme-name but rather directly includes
the style to use in a user gtkrc file, which makes the theme have
"user" priority, hence overriding our styles.  So, we cannot set
priorities in the RC file if we want to support running under KDE,
which pretty much leave us with no choice but to go with solution 2,
which unfortunately requires writing ugly code since GTK don't have a
gtk_rc_prepend_default_file() function.  Thank you very much KDE.

Though, as a side benefit it also makes the code work with people using
gtk-chtheme, which also found it funny to include the theme in the user
RC file.
2013-03-16 16:19:20 +01:00
Nick Treleaven
0cf495a6db Add Rust filetype
(See also: rust-lang.org)
2013-03-16 14:14:41 +00:00
Nick Treleaven
fd8ba60b4a Disable start of word checkbox when whole word checkbox is enabled 2013-03-16 13:47:28 +00:00
Nick Treleaven
14878850cd Don't find start of word when whole word matching should prevent it 2013-03-16 13:26:52 +00:00
Nick Treleaven
feb4a6409e Remove unused variables 2013-03-15 17:55:18 +00:00
Colomban Wendling
71093fec62 Autotools: replace use of deprecated INCLUDES in favor to AM_CPPFLAGS 2013-03-15 16:48:33 +01:00
Colomban Wendling
3a2853c08f Add a few more things to remember when making a release 2013-03-15 16:48:33 +01:00
Enrico Tröger
0c5442b625 More GTK3 Waf build system adjustments
Install the src/gtkcompat.h header and install data/geany.css if necessary.
2013-03-11 19:54:28 +01:00