7572 Commits

Author SHA1 Message Date
Colomban Wendling
ef8c40f1e4 javascript: Add support for the const keyword
`const` is not yet part of the current ECMAScript standard but is
part of the ECMAScript 6 draft and is supported by popular engines
including Mozilla and WebKit, and people already use it.

See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const
2014-11-24 02:59:08 +01:00
Colomban Wendling
b85d754610 javascript: Improve support for unterminated statements
Add support for implicit semicolons so many unterminated statements'
end are properly recognized.

The implementation doesn't follow the ECMAScript standard because doing
so requires to recognize precise grammar of all constructs, and the
parser doesn't currently work this way.  So instead it uses some
heuristics that should work most of the time and only consider implicit
semicolons where they would be explicitly relevant to avoid most false-
positives.  See the extensive comment in `readTokenFull()` for details.

In practice, this mostly fixes handling of files using unterminated
variable assignations like the following:

    var v1 = 0
    var v2 = 1
    // ...
    function f1() {
        // ...
    }

In such situations the parser used not to be able to really tell where
the variable assignation would end and would not recognize any
statement before the next semicolon or closing curly brace at the same
level.  In practice, it wouldn't have emitted any tag for this example,
not even `v1` as it generates tags when reaching the statement's end.
2014-11-24 02:57:38 +01:00
Colomban Wendling
f2b368e2cc javascript: Report function signature 2014-11-24 02:55:44 +01:00
Colomban Wendling
f65dec49e7 javascript: Fix more handling of class-related unterminated statements 2014-11-24 02:48:55 +01:00
Colomban Wendling
9c84a91bb3 javascript: Fix scope inside nested blocks (if/else/while/for/etc.) 2014-11-24 02:45:22 +01:00
Colomban Wendling
e01ae923a1 javascript: Cleanup findCmdTerm() callers a bit
Move the check for unterminated inside `findCmdTerm()` itself and
return it rather than having each caller do it itself.
2014-11-24 02:43:44 +01:00
Colomban Wendling
7e6215661e javascript: Fix handling some class-related unterminated statements 2014-11-24 02:43:29 +01:00
Colomban Wendling
5a1a22d930 javascript: Properly handle nested unknown blocks
Properly match open curly braces when parsing a statement not to
possibly get fooled by unexpected nested blocks, e.g. after a
`switch`'s `case` or a label.

This mostly reverts c54c3ad5e815d16e3b48f3c477465627808aadee and
replaces it with a more correct and complete solution.
2014-11-24 02:41:57 +01:00
Colomban Wendling
f158f5d362 javascript: Fix scope after some constructs 2014-11-24 02:41:17 +01:00
dfishburn
f886f7084a Javascript parser: Removed warning of unused variable is_inside_class and cleanUp
git-svn-id: https://svn.code.sf.net/p/ctags/code/trunk@815 c5d04d22-be80-434c-894e-aa346cc9e8e8
2014-11-24 02:00:24 +01:00
dfishburn
c54c3ad5e8 Added new method findMatchingToken() to skip over blocks of code. Updated parseSwitch() to use the new method.
Updated tests/ctags/ui5.ui.controller.js with code that broke the switch statement.

git-svn-id: https://svn.code.sf.net/p/ctags/code/trunk@809 c5d04d22-be80-434c-894e-aa346cc9e8e8
2014-11-24 01:48:04 +01:00
dfishburn
52d2d73527 Udated jscript to be able to parse SAPUI5 controller and view files.
Added test case tests/ctags/ui5.controller.js

git-svn-id: https://svn.code.sf.net/p/ctags/code/trunk@808 c5d04d22-be80-434c-894e-aa346cc9e8e8
2014-11-24 01:39:36 +01:00
Frank Lanitz
846335b3f0 Update of Japanese translation 2014-11-18 17:28:28 +01:00
Frank Lanitz
50cbe660fa Merge pull request #382 from cousteaulecommandant/patch-3
Update es.po
2014-11-18 14:54:37 +01:00
cousteaulecommandant
58e01b2d24 Update es.po
Use same text in Split Window menu as in Keybindings dialog.
Also, translate "Side by side" as "Izquierda y derecha" ("left and right") rather than "Yuxtapuestos" ("juxtaposed") which is a rather weird (and inaccurate) word.
2014-11-18 13:12:11 +01:00
Colomban Wendling
299f624f65 Autotools: Fix checking for Git revision
Fix check when building out of tree, and properly handle errors.
2014-11-11 19:01:58 +01:00
Colomban Wendling
c40263709f Merge branch 'css-update' 2014-11-11 18:38:42 +01:00
Colomban Wendling
8da955ec94 Make the currently open project insensitive in the recent menu 2014-11-11 17:46:31 +01:00
Colomban Wendling
3fa41cc0da Cleanup code for updating recent file menus 2014-11-11 17:14:21 +01:00
Colomban Wendling
f765463af0 Import new CSS parser from fishman-ctags
Some highlights:
* Fixes handling of comments
* Adds support for attribute and namespace selectors
* Adds support for @supports blocks
* Fixes tag type for many selectors
* Adds support for pseudo-classes with arguments
2014-11-11 02:01:41 +01:00
Colomban Wendling
2072797283 Import CSS test cases from fishman-ctags 2014-11-11 01:59:12 +01:00
Colomban Wendling
67cc8faf4b Fix closing of the "missing file" infobar
The issue was introduced in b646424ddb715382a937d233a75bc684c22e18ec as
it removed the default handler that used to destroy the infobar.

Now, the infobar is properly closed, but only if the action succeeded.

Closes #375.
2014-11-09 22:14:12 +01:00
Colomban Wendling
1dc09597b2 Fix check for fnmatch and remove strict dependency on it for Windows
Strict dependency on fnmatch was removed in 52076d19e8fe7ab41ebc92928e.

We still have an optional dependency on it from CTags, but I don't
think we use this code, and anyways the checks we had for the optional
path to be taken were incorrect, so it was never actually used.

So, drop the dependency on libibrety for Windows builds, and fix the
remaining checks for an optional fnmatch so if it is found it can
actually be used.
2014-11-09 17:40:03 +01:00
Enrico Tröger
fea71a282f Allow MRU file list length to be set to 0 to disable it
Since the rest of the code is already prepared for it, setting mru_length
to 0 just disables the recent files menu.
2014-11-09 11:22:16 +01:00
Colomban Wendling
aa06427c71 Merge branch 'plugin-symbols-protoypes' 2014-11-09 00:19:14 +01:00
Colomban Wendling
8c77accfd0 Merge PR#356 from 'b4n/techee/tm'
Huge TagManager improvements
2014-11-08 19:37:20 +01:00
Colomban Wendling
ba8ff712b0 Merge pull request #374 from kugel-/for-upstream
project: Remove unecessary calls after loading project files
2014-11-08 19:04:20 +01:00
Colomban Wendling
fd4f31cc07 Bump Geany API and ABI for TagManager API changes 2014-11-08 18:34:15 +01:00
Colomban Wendling
6a0673f4ae TM: Don't allow passing NULL to tm_workspace API 2014-11-08 18:32:41 +01:00
Colomban Wendling
0ed236db30 TM: Fix some test results after sort changes from 90944c77 2014-11-08 18:13:13 +01:00
Colomban Wendling
b38f1f99d5 TM: Use gsize everywhere for the memory buffer size 2014-11-08 18:13:13 +01:00
Thomas Martitz
53101dd5fa project: Remove unecessary calls after loading project files
document_new_file_if_non_open() and ui_focus_current_document() only make sense
when files where actually opened, but the preceeding
configuration_load_session_files() only loads the file names into the global
session_files variable, from which the files are actually opened by a later
call to configuration_open_files(). These two calls should be done after that
one and the callers generally do this already.
2014-11-08 17:59:05 +01:00
Frank Lanitz
202ecf8bcb Merge pull request #372 from cousteaulecommandant/patch-1
"Execute commands" -> "Comandos de ejecución"
2014-11-07 16:31:23 +01:00
cousteaulecommandant
e67f63dd0b "Execute commands" -> "Comandos de ejecución"
"Execute commands" (from the Set Build Commands dialog) is translated to Spanish as if it were a sentence (like "Execute these commands"), but it's actually a name ("<language> commands", "Independent commands", and "Execute commands"; so it means "Commands for 'execute'").  Therefore, +"Comandos de ejecución" is a better translation than -"Ejecutar comandos".
2014-11-07 12:48:04 +01:00
Jiří Techet
f441a121d3 Parse file from buffer only if the file isn't too big
By loading e.g. a huge DB dump into memory we could run out of memory.
Check the size of the file and determine whether to use file parsing
or buffer parsing.

Give up early if LANG_IGNORE set - there's no need to read the file in
this case.
2014-11-06 11:39:40 +01:00
Jiří Techet
0ad85aee04 Fix comment wording 2014-11-05 21:50:07 +01:00
Jiří Techet
a95fc1a994 Don't expose the source file update function to plugins 2014-11-05 21:50:07 +01:00
Jiří Techet
90944c77b0 Unify tag sorting and simplify tag comparison function
Use the same (or compatible) sorting criteria everywhere.

Add tm_tag_attr_line_t to sort options so even after merging file tags
into workspace tags, the same tags defined at different lines are preserved
and not removed as duplicates.

Sort type before scope because it's cheaper to compare (string vs int comparison).

For some reason, the above changes make the sorting performance worse.
Simplify the tag comparison function a bit and reorder the case statements
in the switch to match the sort order. This (again not sure why), makes the
performance like before.
2014-11-05 21:50:07 +01:00
Jiří Techet
29000cf104 Always parse buffer instead of file
This brings the linux kernel parsing time from about 20s to 12s on my machine.
2014-11-05 21:50:07 +01:00
Jiří Techet
448f1fd20e Make sure gboolean tm_source_file_parse() returns the right value
Previously, after finishing the while loop TRUE was returned - this is
wrong because the while was running because parsing was unsuccessful.
Make it work the same way as in ctags (parser() always succeeds,
parser2() returns whether to retry or not).

(The return value actually isn't used, it's just to make sure we know
what we are doing.)
2014-11-05 21:50:07 +01:00
Jiří Techet
f35d0b9c0c Move tm_get_current_tag() from tm_workspace to tm_tag
This function has nothing to do with the workspace so it rather belongs
to tm_tag.
2014-11-02 11:40:05 +01:00
Jiří Techet
71cc1ecb20 Cleaner and safer TMWorkspace API
With the previous TMWorkspace API it was possible to make the workspace
inconsistent by e.g. removing source files and forgetting to update
workspace. This could lead to non-obvious and not immediately visible
crashes.

The new set of the public (but also Geany private) API calls always
updates the workspace accordingly and neither of the calls can lead
to an inconsistent state of the workspace.

In addition, perform some minor cleanups and simplifications - unify
parsing from buffer and from file, support "parsing" of 0-sized buffers
and improve documentation.
2014-11-02 11:39:57 +01:00
Colomban Wendling
48718f4b79 Remove an unused parameter 2014-10-31 20:25:59 +01:00
Colomban Wendling
013c47c6e3 TM: Fix various integer signedness issues 2014-10-31 20:25:13 +01:00
Colomban Wendling
61ee7de86e Return an unisgned tag count in tm_tags_find()
There is no reason to return a signed value an it help unifying
caller's types.
2014-10-31 20:20:25 +01:00
Colomban Wendling
42a9603f4a Use TMTagType everywhere to hold tag types 2014-10-31 20:07:27 +01:00
Nick Treleaven
4e5ed012f2 Recommend Glade 3.8.5, add link for fishman ctags fork 2014-10-31 17:26:24 +00:00
Jiří Techet
d7ed48f86b Fix a problem in tm_tags_remove_file_tags() when more tags of the same name exist 2014-10-31 02:03:13 +01:00
Jiří Techet
cb9e4bbf74 Microoptimization in merge
Improves performance by about 10%.
2014-10-30 22:08:17 +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