plugins: change return codes of geany_load_module() and GeanyPluginFuncs::init
[geany-mirror.git] / tests / ctags / bug823000.sql
blobf19b89e72cac85348a5e2227d47e3703813e88bd
1 /*
2 Bugs item #823000, was opened at 2003-10-13 21:56
3 Message generated for change (Tracker Item Submitted) made by Item Submitter
4 You can respond by visiting: 
5 https://sourceforge.net/tracker/?func=detail&atid=106556&aid=823000&group_id=6556
7 Category: None
8 Group: None
9 Status: Open
10 Resolution: None
11 Priority: 5
12 Submitted By: Jozsef Nagy (brutal)
13 Assigned to: Nobody/Anonymous (nobody)
14 Summary: PL/SQL functions and procedures
16 Initial Comment:
17 I've tried to use ctags (version 5.5.2) to navigate
18 PL/SQL source codes in vim but jumping to
19 function/procedure definitions worked not properly. I
20 figured out that the problem was that I've defined
21 these functions/procedures in multiline format, for
22 example:
24 test.pkb:
26 CREATE OR REPLACE PACKAGE TEST IS
28 PROCEDURE TestFunc1
30   arg1  IN NUMBER,
31   arg2  IN NUMBER
34 BEGIN
35   NULL;
36 END TestFunc1;
38 PROCEDURE TestFunc2
40   arg1  IN NUMBER,
41   arg2  IN NUMBER
44 BEGIN
45   NULL;
46 END TestFunc2;
48 END TEST;
51 ctags creates a regexp type pattern for my
52 functions/procedures but unfortunately the pattern was
53 /^IS$/ for each function/procedure, that's why the
54 jumping method worked really crappy. (see the output of
55 ctags 5.5.2 on this example code below)
57 ctags -f - --language-force=sql test.pkb
58 TEST    test.pkb        /^CREATE OR REPLACE PACKAGE
59 TEST IS$/;" P
60 TestFunc1       test.pkb        /^IS$/;"        p
61 TestFunc2       test.pkb        /^IS$/;"        p
63 I've looked into the ctags source code and I saw that
64 in parseSubProgram() in sql.c called makeSqlTag() only
65 when KEYWORD_is reached. I have modified this function
66  so that makeSqlTag() is called immediately after a
67 function/procedure keyword and name is read (I have
68 attached the output of diff sql.c.5.5.2 sql.c). I don't
69 know much of ctags internals so I am not sure if this
70 is the best solution but it worked for me. (see the
71 output of my modified ctags below)
73 ctags -f - --language-force=sql test.pkb
74 TEST    test.pkb        /^CREATE OR REPLACE PACKAGE
75 TEST IS$/;" P
76 TestFunc1       test.pkb        /^PROCEDURE
77 TestFunc1$/;"       p
78 TestFunc2       test.pkb        /^PROCEDURE
79 TestFunc2$/;"       p