285 Commits

Author SHA1 Message Date
Jiří Techet
5d94d15976 Reload tooltip in the symbol tree also on tag update
Because function return types are not used to determine tag equality,
we need to also update the tooltip of an existing tag otherwise the return
type doesn't get updated when changed.
2015-05-03 19:36:26 +02:00
Colomban Wendling
f3078ebbc6 Merge branch 'kugel-/linkage-cleanup_rebase-for-merge'
This merges PR#429 with only small history cleanup (no code changes),
and ABI bump.

Closes #355, #358 and #429.
2015-04-10 16:54:30 +02:00
Colomban Wendling
9644fb0ae2 Define GEANY_{EXPORT,API}_SYMBOL from the build system
This makes it easier to define it consistently to what the compiler
and platform supports, and avoids having to include a special header
everywhere, which is some kind of a problem for separate libraries
like TagManager and especially Scintilla.

As we only use these macros from the source and not the headers, it
is fine for it to be defined to a configure-time check from the build
system.

Warning: Although Waf and Windows makefiles are updated they are not
         tested an will probably required tuning.
2015-04-10 16:08:08 +02:00
Colomban Wendling
1bed458ab9 Merge pull request #270 from b4n/zephir-filetype
Zephir filetype
2015-04-09 01:06:57 +02:00
Colomban Wendling
11e16eed6f Remove an unused argument 2015-04-02 19:12:13 +02:00
Matthew Brush
2f08670763 Mark all plugin API functions to have "default" (public) visibility
Adds a new header `pluginexport.h` to put the macros in, could be
moved into an existing header (support.h?) by I didn't want to drag
a bunch of existing stuff into the source files for this one macro.

TagManager has relative include, this could be fixed by changing the
include directories for it if it's a problem. Mark the Scintilla
functions exported by re-declaring them in sciwrappers.c with the
attribute to avoid changing upstream Scintilla code.
2015-03-10 22:06:47 +01:00
Colomban Wendling
1c1d76721d Fix several tooltips to properly use plain text instead of markup
Most of our tree view tooltips were set from plain text values but
parsed as markup by GTK, which sometimes lead to markup errors, when
the tooltip value contained markup control characters.

This also adds ui_tree_view_set_tooltip_text_column() to the plugin
API so plugins can easily set plain text tooltips from tree views
columns.

Fixes https://sourceforge.net/p/geany/bugs/1091/
2015-02-28 19:15:00 +01:00
Colomban Wendling
91d5079c8d Merge pull request #378 from b4n/remove-macro-list
Remove "Show macro list" keybinding and feature
2015-01-11 17:33:40 +01:00
Colomban Wendling
740c12c0ca Remove "Show macro list" keybinding and feature
This feature looks like a poorly implemented subset of "Complete word",
but lacks some important features like prefix filtering.  It is also
misnamed as it shows not only macros, but also variables and enums.

It also only shows `editor_prefs.autocompletion_max_entries`, but does
so from *each* file, not as a whole.

So drop it altogether, as this feature doesn't really look useful and
the current implementation seem to suffer of too many shortcomings for
it to realistically be actually used.
2015-01-11 17:30:27 +01:00
Colomban Wendling
94aa892c81 Merge pull request #373 from techee/go_ctags
Add a Go ctags parser.
2014-11-30 02:03:00 +01:00
Jiří Techet
ccb15a31be Add the go ctags parser
Make go one of the builtin filetypes, add the parser and update the related
source and config files. While there, remove Rust from [Groups] in
filetype_extensions.conf because it's already a builtin filetype as well.

The parser itself is stolen from the fishman/ctags repo.
2014-11-30 01:35:00 +01:00
Colomban Wendling
af7d63cdf2 Merge pull request #319 from b4n/better-txt2tags-parser
Better txt2tags parser
2014-11-29 23:40:58 +01:00
Colomban Wendling
42a9603f4a Use TMTagType everywhere to hold tag types 2014-10-31 20:07:27 +01:00
Jiří Techet
bdee1336aa Keep a separate list of typenames for Scintilla syntax highlighting
Manage the list the same way as workspace tags_array by the fast tag removal
and merge. Thanks to this, typename tags don't have to be extracted from
tags_array periodically, which speeds up editing.
2014-10-30 22:08:17 +01:00
Jiří Techet
be131b00f9 Extend dedup() and merge() to unref the duplicate tag when needed 2014-10-30 22:08:17 +01:00
Jiří Techet
62332e19aa Since lang is now always part of TMTag, always set its value
This makes it less confusing for code accessing TMTag so it can always
find the language in tag->lang and there is no need to access it through
tag->file.lang.
2014-10-18 21:40:11 +02:00
Jiří Techet
54a9fd83ea Get rid of the nested members in TMTag
The only real change is the removal of struct and union in TMTag, the
rest is purely mechanical removal of "atts.entry." everywhere.
2014-10-18 21:40:11 +02:00
Jiří Techet
48725e4188 Get rid of the file struct in TMTag, preparation for the union removal
The union on TMTag is very confusing and rather dangerous. The fields
file/timestamp and line/lang overlap. Some implicit assumptions are made
in the code - timestamp is never set so when file is NULL, the file
struct should be used to get the lang member. Rather avoid using unions
and move the lang member to the entry struct together with the other
attributes.
2014-10-18 21:40:10 +02:00
Jiří Techet
26587454b0 Remove TmWorkObject and all the OO related stuff
In addition, rename all functions, parameters, comments etc. mentioning
work_object and remove unnecessary parameters of various functions.
Delete dead code paths.

Also move common functions like tm_get_real_path() from tm_work_object to
tm_source_file.
2014-10-18 21:40:10 +02:00
Matthew Brush
634a4b111f Highlight C types from tags in C++ code
Useful for when using, for example, GTK+, SDL, and other C-only APIs
in files with the C++ filetype. Before only the symbol auto-completion
worked, but not the highlighting of type names.

TODO: figure out why taking something like SDL.c.tags and making a copy
as SDL.cpp.tags doesn't work, once that's fixed, this extra condition
could probably be removed.
2014-09-17 16:49:58 -07:00
Colomban Wendling
b7b34ec451 Rewrite the Txt2tags parser for better conformance and features
This fixes parsing indented titles and titles with embedded delimiter
characters, and adds support for title nesting information.

Syntax: http://txt2tags.org/rules.html

Closes [feature-requests:#690].
2014-08-19 16:11:23 +02:00
Colomban Wendling
8812e39e2e Fix searching backwards from the Find dialog
search_find_prev() wasn't properly updated to work on GeanyFindFlags
leading to incorrect flags handling.
2014-08-19 03:31:34 +02:00
Matthew Brush
4efcbab332 Include what you use
This is a mega-commit - because most of it had to be done in one go
otherwise some commits would fail to compile - that attempts to fix a
few problems with Geany's includes as well as various other related
cleanups. After this change it's easier to use includes and there's
little worry about which order things are included in or who includes
what.

Overview of changes:

* Include config.h at the start of each source file if HAVE_CONFIG_H
  is defined (and never in headers).
* Go through each source file and make the includes section generally
  like this:
  - Always config.h first as above
  - Then if the file has a header with the same name, include that
  - Then include in alphabetical order each other internal/geany header.
  - Then include standard headers
  - Then include non-standard system headers
  - Then include GLib/GTK+ related stuff
* Doing as above makes it easier to find implicit header include
  dependencies and it exposed quite a few weird problems with includes
  or forward declarations, fix those.
* Make geany.h contain not much besides some defines.
  - Add a little header file "app.h" for GeanyApp and move it there
  - Move "app" global to new "app.h" file
  - Move "ignore_callback" global to "callbacks.h"
  - Move "geany_object" global to "geanyobject.h"
* Add an include in "geany.h" for "app.h" since GeanyApp used to be
  defined there and some plugins included this header to access
  GeanyApp.
* Include "gtkcompat.h" everywhere instead of gtk/gtk.h so that
  everywhere sees the same definitions (not a problem in practice AFAIK
  so this could be changed back if better that way.
* Remove forward declarations from previous commits as some people
  apparently consider this bad style, despite that it reduces inter-
  header dependencies.

TODO:
* As always, to test on win32
* As always, to test with not Autotools
* Test plugins better, both builtin and geany-plugins, likely API/ABI bump
* Test with various defines/flags that may change what is included
* win32.[ch] not really touched since I couldn't test
2014-05-21 15:37:19 -07:00
Colomban Wendling
b1f93c2977 Add Zephir filetype 2014-05-15 17:03:56 +02:00
Colomban Wendling
de57548a71 Fix a few unlikely corner-case leaks
Fix a few leaks that can only happen in case of programming error.

Thanks to Pavel Roschin and his cppcheck for spotting them!
2014-05-05 16:03:25 +02:00
Colomban Wendling
aeab183ef2 Merge branch 'unified-encoding-combo-boxes' 2014-04-15 15:57:13 +02:00
Colomban Wendling
8c5e198cf1 Unify encoding combo boxes
Make all encoding combo box display a list with encodings grouped by
categories into sub-menus, making it easier to find the appropriate
encoding than in a big single-level list.

This is what was used in the Open dialog, but not in the Preferences
dialog or the Find in Files dialog.  This also makes the encoding
combo boxes behave more like the encoding menus.
2014-04-15 15:51:49 +02:00
Colomban Wendling
ef4c72501e Fortran: generate fake tags for anonymous structures, interfaces and enums
This allows both to show those anonymous elements, as well as giving a
parent to their children, fixing display in the symbols tree.
2014-02-23 20:02:55 +01:00
Colomban Wendling
29336ffed0 Fortran: display components 2014-02-18 19:11:47 +01:00
Colomban Wendling
362a5cc654 Fortran: properly report scope for programs, subroutines and types
To do this we change the internal types to only use types matched by
symbols_get_current_scope().  This is a bit of a hack, but the tag
types were already questionable and simply mapped to ones the
TagManager know.

This however merges Functions and Subroutines under the same top-level
item in the symbol list.
2014-02-18 19:04:37 +01:00
Enrico Tröger
3d9908df8c Set tag kind for Python imports to externvar and map them in the symbol list.
This fixes 'Go to Tag definition' for parsed Python imports as before the import
statement was chosen as the definition while we prefer the class definition as
target.
2014-02-08 10:26:08 +01:00
Enrico Tröger
c4b0f0f74d Add new symbol list category "Extern variables"
This is a requirement for an upcoming Python parser fix. This new category
will be currently only used by Python, C and D parsers. Before this change,
in C & D extern variables were sorted into the category "Other", now they
have their own category.
2014-02-08 10:23:30 +01:00
Colomban Wendling
7473e4b1d9 Add defensive checks for function receiving a GeanyDocument argument
Always check the passed-in GeanyDocument argument is a valid one, not
to possibly work on an invalid document.
2014-01-22 17:38:29 +01:00
SiegeLord
3d7ade4e02 Integrate the Rust lexer with the rest of Geany's functionality 2014-01-14 12:50:38 -05:00
SiegeLord
a085573212 Use :: as the context separator for Rust 2014-01-14 12:50:37 -05:00
Colomban Wendling
cff36e7497 R: properly display sources and libraries in the symbol list 2013-11-20 18:41:11 +01:00
Colomban Wendling
1ab97fe2e0 Plug a memory leak when reading misnamed tag files
Don't leak the file name if we can't determine to which filetype it
belongs.  Thanks to Pavel Roschin for spotting this.

Also, remove an useless second function indirection that simply made
the code harder to understand.  This will make Matthew happy ;)
2013-09-25 00:00:44 +02:00
Nick Treleaven
c615d8431f Don't call getenv twice 2013-08-15 17:52:13 +01:00
Nick Treleaven
0998f1c19c Make code more readable by renaming poorly named macros NZV and NVL
Closes #159
2013-08-14 21:54:20 -07:00
Colomban Wendling
6e902613b3 Improve some test ordering
Spotted by Daniel Marjamäki, thanks.
2013-07-16 19:13:41 +02:00
Colomban Wendling
b016e132fd Java: Report enums and fix parsing them 2013-07-15 17:42:00 +02:00
Colomban Wendling
d91c532f95 Remove a few dead assignments
Spotted by clang --analyze.
2013-07-13 23:00:43 +02:00
Colomban Wendling
e3fad4a745 Merge branch 'master' into wip/better-php-parser 2013-07-03 19:26:06 +02:00
Colomban Wendling
3ba9bd34db SQL: Show variables in the symbol list 2013-06-26 16:33:35 +02:00
Colomban Wendling
f6e9ac094a Remove use of some of our own deprecated Scintilla wrappers
Remove most obvious calls to our very own deprecated Scintilla wrapper
functions sci_get_text(), sci_get_text_range() and
sci_get_selected_text().

Some calls are still left, but they either really benefit from these
functions or the fix would be more complex.
2013-05-22 04:22:53 +02:00
Colomban Wendling
9652a34ef0 Add ellipsis to menu items requiring further user input
This is a very common paradigm used by GNOME, KDE, MacOSX, Windows,
etc., and following it makes our UI more consistent with these and
easier to use by their users.

https://developer.gnome.org/hig-book/stable/menus-design.html.en#menu-item-type-command

Closes #3613494.
2013-05-19 23:15:38 +02:00
elextr
c2d2fddca3 Return a non-printing sequence for no context separators
Function symbols_get_context_separator() returns the symbol
separator for the language, but some languages do not have
symbol context separators, for example markup languages like
Asciidoc.  To prevent the symbols pane wrongly detecting and
acting on a valid character sequence as a separator, return a
non-printing character which should not occur.

Options "" and NULL not used as they break some code and would
need an ABI bump.

Other languages can be added as they are identified.
2013-05-15 14:10:22 +10:00
Colomban Wendling
5868c6991c Fix leaks upon symbol list updating 2013-04-22 20:20:53 +02:00
Colomban Wendling
c986eeee99 PHP: show namespaces and traits in the symbol list 2013-04-17 17:07:47 +02:00
Colomban Wendling
8b3142ef4d PHP: use "::" as the scope separator 2013-04-17 17:07:18 +02:00