8379 Commits

Author SHA1 Message Date
Frank Lanitz
a5a9762498 Update of Portuguese translation 2016-02-13 11:42:38 +01:00
Frank Lanitz
64fbf3cbfe Merge pull request #883 from blogcin/trans
Update Korean Translations
2016-02-12 23:44:01 +01:00
Colomban Wendling
2c99c8827f c++: Fix a test result
748137bd1dfa648948d9d127aa3e27b6857db764 improved return types, but as
this test case was added in parallel it wasn't updated as needed for
the new, more correct, results.
2016-02-11 15:48:50 +01:00
Colomban Wendling
a775da0714 Merge pull request #862 from techee/tm_workspace_find_cleanup3
Rewrite scope completion v3.

Closes #488 and #505.
2016-02-11 15:30:09 +01:00
Colomban Wendling
e38c7e3b67 Merge pull request #879 from b4n/c/cxx11-raw-strings
c++: Fix parsing of C++11 raw string literals.
2016-02-11 15:26:32 +01:00
Colomban Wendling
1438a99e17 Merge pull request #889 from b4n/c/return-type
C, C++, C#, D: Improve return type and var type recognition.
2016-02-11 15:25:49 +01:00
Frank Lanitz
1d58c7faf8 Update i18n on NEWS 2016-02-10 23:02:47 +01:00
Frank Lanitz
7344907df8 Update of German translation 2016-02-10 23:00:18 +01:00
Frank Lanitz
f413f02395 Merge pull request #898 from zygimantus/master
lt translation updated
2016-02-08 20:52:23 +01:00
zygimantus
88ca58e2d6 lt translation updated 2016-02-08 08:31:49 +02:00
Thomas Martitz
658821d2dd api: add script to generate {geany,geany-scintilla}-gtkdoc.h
The script reads the doxygen xml output and generates two headers (optionally
a single header) that contains all of the plugin API in gtk-doc format.

Two headers because it's preferrable to group Scintilla related stuff
into its own namespace. This is a lot easier if g-ir-scanner can
work with a separate header file. If we change minds later on the script is
prepared to generate only one header.
2016-02-07 17:50:23 +01:00
Thomas Martitz
bfa0946420 doxygen: various doxygen-related fixes in preparation for gtkdoc generation 2016-02-07 17:50:23 +01:00
Thomas Martitz
d8f75b7d0f doxygen: generate xml too in preparation for gtkdoc generation
A script will use the xml to generate a gtkdoc'ized header of the plugin API.
The xml files are also installed so that external users can use the xml
that corresponds to the installed version of Geany.

For now a separet doxyfile is used because the gtkdoc'ized header needs
a few types to be documented which not desired to be documented generally.
2016-02-07 17:50:23 +01:00
Enrico Tröger
1ca2554b3a Merge pull request #878 from eht16/drop_obsolete_plugin_test_script
Remove obsolete scripts/plugin_test.c
2016-02-07 14:27:03 +00:00
Frank Lanitz
1be0a255f7 Update of Japanese translation 2016-01-28 19:47:00 +01:00
Jiří Techet
6b2e99d067 Remove scope prefix of variable types
We only perform search based on variable name so if a variable is e.g. of
the type std::Foo, we can drop the std:: prefix and search only for the
Foo type.
2016-01-27 01:06:56 +01:00
Colomban Wendling
748137bd1d C, C++, C#, D: Improve return type and var type recognition
This is far from perfect and contains a lot of guessing.  It showed
good results based on our tests cases, fixing several issues and not
introducing any more issues (admittedly, after working around a subtle
one regarding D static ifs).

Closes #845.
2016-01-26 16:18:11 +01:00
Colomban Wendling
496d51210c Merge pull request #839 from kugel-/gboxed-types
GBoxed types
2016-01-25 23:10:37 +01:00
Colomban Wendling
85f16ebf78 Merge pull request #874 from kugel-/sci-api-export
scintilla: add scintilla_object_* to the plugin api
2016-01-25 23:09:17 +01:00
Colomban Wendling
b40d1f255b Use explicit character literal instead of numerical value 2016-01-25 22:22:51 +01:00
blogcin
dff861cc36 Update Korean Translations 2016-01-26 03:11:28 +09:00
Giuseppe Penone
a32a0d5be3 updated language Italian 2016-01-24 23:20:44 +01:00
Giuseppe Penone
31b7a2d6ad updated language Italian 2016-01-24 21:59:56 +00:00
Colomban Wendling
5a279f0bf6 c++: Fix parsing of prefixed C++11 raw string literals
See http://en.cppreference.com/w/cpp/language/string_literal
2016-01-24 17:33:32 +01:00
Colomban Wendling
cdabbecd37 read: Avoid possible NULL dereference in getNthPrevCFromInputFile()
Also, don't perform subtractions to check pointer bounds, to avoid
unsigned value wraparound.  This is very unlikely as it would either
mean a very large `nth` value or a very small value for the current
line pointer, but better safe than sorry.
2016-01-24 17:29:38 +01:00
Colomban Wendling
67f3add7c7 read: Move logic for getting a previous character into a read function
This ties related logic together, making it less of a hack and easier
to maintain, as well as accessible by all parsers if needed.
2016-01-24 17:25:12 +01:00
Colomban Wendling
a14aa908c5 c++: Fix parsing of C++11 raw string literals
See http://en.cppreference.com/w/cpp/language/string_literal

Closes #877.

---

This contains a pretty ugly hack to fetch the previous character, in
order not to get fooled by string concatenation hidden behind a macro,
like in `FOUR"five"`, which is not a raw string literal but simply the
identifier `FOUR` followed by the string `"five"`.

While this may sound uncommon, it is not and lead to complaints [2][3]
when Scintilla [1] broke this when they introduced C++11 raw string
literal support themselves.

The implementation here still contains a bug with line continuations: a
raw literal of the form:

```c
const char *str = R\
"xxx(...)xxx";
```

is not properly recognized as such, although it's perfectly valid (yet
probably very uncommon).  For the record, Scintilla has also suffers
from this but nobody complained about it yet.

[1] http://scintilla.org/
[2] https://sourceforge.net/p/scintilla/bugs/1207/
[3] https://sourceforge.net/p/scintilla/bugs/1454/
2016-01-23 21:52:40 +01:00
Enrico Tröger
632b215f77 Remove obsolete scripts/plugin_test.c
This script was used in the nightly builds to verify plugins will load
and have no undefined symbol references. Since the new way plugins
are built and linked, this is no longer necessary.
Additionally, this script won't work with new style geany_load_module()
plugins.
2016-01-23 15:29:03 +01:00
Thomas Martitz
43737733ac plugin api: convert StashGroup to GBoxed internally
Because the stash_group_new() is an exported API, it has to be at least a boxed
type to be usable for gobject introspection. The boxed type uses reference
counting as opposed to memory duplication.

The obligatory stash_group_dup() is not exported (doesn't have to).
2016-01-19 17:08:59 +01:00
Thomas Martitz
9a38b7ac20 plugin api: convert TMSourceFile to GBoxed internally
Because the tm_source_file_new() is an exported API, it has to be at least a
boxed type to be usable for gobject introspection. The boxed type uses
reference counting as opposed to memory duplication.

The obligatory tm_source_file_dup() is not exported (doesn't have to).
2016-01-19 17:08:56 +01:00
Thomas Martitz
a032ed506e scintilla: add scintilla_object_* to the plugin api
Analogous to their legacy counterparts. Also required for gir-bindings
generated via g-ir-scanner.
2016-01-19 17:05:30 +01:00
Jiří Techet
c653741a3c Fix member scope completion with nested members
First, the search for existing type with the given scope should be done
also for namespaces.

Second, with the string operations we get no scope as empty string ""
but the rest of TM functions expect scope to be set to NULL in such
case. Fix that.
2016-01-19 00:40:06 +01:00
Jiří Techet
f10747ae5a Remove duplicate names from scope search popup
There may be duplicate tag names in the list e.g. when performing namespace
search and overloaded methods are found.
2016-01-18 23:00:19 +01:00
Jiří Techet
cd1a58f0a5 Use language-specific context separator instead of hard-coded "::"
This makes it possible to popup scope completion dialog for more languages.
2016-01-18 22:56:10 +01:00
Jiří Techet
f38068f04e Skip typedef resolution in namespace search if not needed
When we already have a struct-like type in namespace search,
we don't need any extra resolution - we already have the
right type. Skip the whole typedef resolution in this case.
2016-01-18 22:56:10 +01:00
Jiří Techet
5801844d7e Improve anonymous type handling
Make sure the anonymous types are from the same file as the
variable of that type (or, when performing typedef resolution, from
the same file as the typedef).

On the way, simplify find_scope_members() a bit and fix some minor
problems.
2016-01-18 22:56:10 +01:00
Jiří Techet
981320c3b8 Skip [] when performing scope autocompletion
In addition to skipping function parameters, we can also skip indexes so
in something like

foo[2].

we get autocompletion for foo's type members.
2016-01-18 22:56:10 +01:00
Jiří Techet
5cd5734642 Minor cleanup
Make the unused code compile and remove unused tm_get_current_function()
(we have similar symbols_get_current_function() and there's no reason
to keep it)
2016-01-18 22:56:10 +01:00
Jiří Techet
ad77ee15da Add a "prefix" search for non-scope autocompletion
The main reason for separating m_workspace_find() into two parts is the
fact that when matching only the prefix, the result may contain too
many results and we need to go through all of them, return them and at the
end discard most of them.

For instance, when considering the linux kernel project with 2300000 tags
and when autocompletion is set to be invoked after typing a single character,
we get on average something like 100000 results (tag_num/alphabet_size).
But from these 100000 results, we get only the first 30 which we display
in the popup and discard the rest which means going through the list of
the 100000 tags and comparing them for no reason.

Thanks to using binary search for the start and the end of the sequence of
matching tags (added in a separate patch), we can get the start of the
sequence and the length of the sequence very quickly without going through
it.

For the prefix search we can limit the number of tags we are interested
in and go through at most this number of returned tags (to be precise,
times two, because we need to go both through the workspace array and
global tags array and remove the extras only after sorting the two).

It would be possible to combine both tm_workspace_find() and
tm_workspace_find_prefix() into a single function but the result is a bit
hard to read because some of the logic is used only in tm_workspace_find()
and some only in tm_workspace_find_prefix() so even though there is some
code duplication, I believe it's easier to understand this way.
2016-01-18 22:56:10 +01:00
Jiří Techet
5b4c6f96b2 Don't use anon_struct_* and similar members unless we are sure it's the right one
We can only be sure it's the right one if we previously resolved a
typedef to it and the typedef was in the same file.
2016-01-18 22:56:10 +01:00
Jiří Techet
02105d77d7 Simplify tag type specifications in scope search
Consider types with members to have the same properties everywhere (this
might differ language to language but this assumption should behave
reasonably for any language).

Don't check member type in find_scope_members_tags() - we already check
scope which should be sufficient and will work even if some language
uses function/variable instead of method/member/field.
2016-01-18 22:56:10 +01:00
Jiří Techet
67916dc403 Use only binary search to find first/last element in a row of equal tags
The linear part may become expensive when there are many equal tags
which can happen when partial search, used for non-scope completion,
is used.
2016-01-18 22:56:10 +01:00
Jiří Techet
2682d7973f Remove anon_* elements when performing namespace search
These correspond to anonymous structs, enums, etc. but they don't have
any name so the name shouldn't be listed.
2016-01-18 22:56:10 +01:00
Jiří Techet
7a3d6a4ee1 Filter scope autocompletion list based on user input
When scope autocompletion list shows, start filtering it when
when the user types some more characters. As long as the list
is non-empty, don't switch to normal autocompletion and show
only the scope autocompletion results.
2016-01-18 22:56:10 +01:00
Jiří Techet
932dc71fe2 Don't use struct/class/... member types when the edited text isn't a member
For instance, consider

class A {
    int a;
    int b;
}

class B {
    A c;
    void foo() {
        c.    //<---- (3)
    }
}

int main() {
    c.    //<---- (1)
    foo.c.    //<---- (2)
}

Consider cases (1) and (2) first - in the case (1) scope completion
shouldn't be performed because c isn't a global variable; however,
in case (2) it should be performed because c is a member.

To fix this, we can check whether the typed variable ('c' in this case)
is preceeded by another dot - if it is, use member tags for scope
completion; otherwise don't use them.

There's one exception from this rule - in the case (3) we are accessing
a member variable from a member function at the same scope so the
function should have access to the variable. For this we can use the
scope at the position of the cursor. It should be

B::foo

in this case, more generally ...::class_name::function_name. We need
to check if class_name exists at the given scope and if the member
variable we are trying to access is inside ...::class_name - if so,
scope completion can be performed using member tags (without explicit
invocation on a member).
2016-01-18 22:55:02 +01:00
Colomban Wendling
99938dd821 Update Scintilla to version 3.6.3
Includes improvements for Lua 5.3 and Perl 5.22.
2016-01-18 04:22:26 +01:00
Daniel Șuteu
f3a5dd609a Add file-extensions for Clojure
The extensions are from Wikipedia: https://en.wikipedia.org/wiki/Clojure

Closes #842.
2016-01-18 03:43:35 +01:00
Colomban Wendling
bfd5587f4f Merge pull request #852 from b4n/reflow-hang
Fix hang in reflow command (and small improvements around)
2016-01-18 03:40:56 +01:00
Colomban Wendling
50212093ba Merge pull request #831 from b4n/cuda/tags
CUDA: Use C++ ctags parser
2016-01-18 03:34:02 +01:00
Colomban Wendling
a7ce20dc59 Merge pull request #826 from kugel-/doxygen-fixes2
Doxygen API fixes and cleanup.
2016-01-18 03:19:15 +01:00