atom / symbols-view

Jump to symbols in Atom
MIT License
164 stars 114 forks source link

Associate language-oracle files to SQL #134

Open tschf opened 8 years ago

tschf commented 8 years ago

ctags supports PL/SQL.

http://ctags.sourceforge.net/languages.html

  1. PL/SQL

And also, looking at the source (one of the source clones on GitHub): https://github.com/jakedouglas/exuberant-ctags/blob/master/sql.c#L32-L41, it refers to Oracle PL/SQL.

 /*
 *  On-line "Oracle Database PL/SQL Language Reference":
 *  http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28370/toc.htm
 *
 *  Sample PL/SQL code is available from:
 *  http://www.orafaq.com/faqscrpt.htm#GENPLSQL
 *
 *  On-line SQL Anywhere Documentation
 *  http://www.ianywhere.com/developer/product_manuals/sqlanywhere/index.html  
 */  

When running clang --list-languages, it seems to fall under SQL. And it seems to map only to the sql extension, as from:

$ ctags --list-maps | grep SQL
SQL      *.sql

And indeed, if I have a file test.sql witth the following:

create or replace package body p1
as

    type t_1 is table of number;

    procedure bar()
    as
    begin
        null;
    end bar;

end p1;
/

Atom currently picks up the tags:

However, using another file extension, it misses out (as you would expect based on the previous info):

..

Recently, the language-oracle package was created, so I think now we could associate all files falling under that grammar to Sql?

After this change, all tags are properly picked up in the symbols view.

(on a side note, ctags doesn't currently pick up functions/procedures in a package spec - no as or end seems to be the trigger that it's looking for)