Giter Site home page Giter Site logo

language-oracle's People

Contributors

martindsouza avatar nitashadhingra avatar tschf avatar vincentmorneau avatar zhudock avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

language-oracle's Issues

Deprecated selector in `language-oracle\index.less`

In language-oracle\index.less:

Starting from Atom v1.13.0, the contents of atom-text-editor elements are no longer encapsulated within a shadow DOM boundary. This means you should stop using :host and ::shadow pseudo-selectors, and prepend all your syntax selectors with syntax--. To prevent breakage with existing style sheets, Atom will automatically upgrade the following selectors:

  • atom-text-editor::shadow .logger.oracle => atom-text-editor.editor .logger.syntax--oracle

Automatic translation of selectors will be removed in a few release cycles to minimize startup time. Please, make sure to upgrade the above selectors as soon as possible.

Consider referencing this package in Linguist

Linguist is the repo that maintains what language code files hosted on GitHub are. Currently it references the text mate bundle this repo was based off, as the syntaxes expand in this repo it might be better to reference this instead.

They are referenced as a submodule. Mostly, they are text mate bundles, but there are a couple that are just over a dozen that are referencing atom language grammars, e.g language-python

See: https://github.com/github/linguist/tree/master/vendor/grammars

So far the main change is adding APEX related words.

Opening and Ending name matching

Reported in #36

Need to try a few different scenarios and a few different syntaxes to see the behaviour. Also, a recent change added function matching to generic function naming, so the D1 not being highlighted in the example may affect the result here.

Coding the snippets.cson file

I think it would be easier to code and easier to read to have the snippets like that:

".source.plsql.oracle":
  "declare l_exists number;":
    prefix: "magic-exists-no-data-found"
    body: """
        declare
            l_exists number;
        begin
            select distinct 1
            into l_exists
            from $1
            where $2;
        exception
            when no_data_found then
                $3;
        end;
    """

Notice the double quotes (3x) before and after the body. That make everything realign properly when the code expands.

Undo File-Types Plugin

I already had file-types install and had to modify my config.cson file to remove those changes:

Was

"file-types":
    pkb: "source.sql"
    pks: "source.sql"
    pls: "source.sql"
    plb: "source.sql"

Now

"file-types":
    pkb: "source.pks"
    pks: "source.pkb"
    pls: "source.pks"
    plb: "source.pkb"

I think I can remove this plugin (and configuration)

Regarding this ticket, may be good to make note for people that have done the same thing.

Tidy up grammar: Remove duplicate captures

Some syntax specs seem to have multiple definitions of the same capture.

e.g

{
    captures:
      "1":
        name: "keyword.other.oracle"
      "2":
        name: "keyword.other.oracle"
      "3":
        name: "keyword.other.oracle"
      "4":
        name: "entity.name.function.oracle"
    match: "(?i)\\s*(OVERRIDING)?\\s*(MEMBER|CONSTRUCTOR|STATIC)?\\s*(function|procedure)\\s+([-a-z0-9_]+)"
    name: "meta.procedure.oracle"
  }

1 through 3 appears to be duplicated. I'm sure this isn't required.

Dynamically Generate Oracle package references

Initially based on this discussion

Instead of manually generating the information for oracle packages and their methods we can generate them dynamically.

@tschf pointed out that some of the procedures from the oracle dictionary views may not be supported features. For now I think it's safe to include them as it'll be the easiest thing.

Auto indentation not behaving ideally

If I have package code, and go to create a new procedure, the new line after the definition (as or begin) should be at the same indentation level, but it going back one level of indentation.

e.g.
Expected output:

create or replace package foo
as

    procedure foo1(
        l_input NUMBER
    ) as
    begin
        --todo
    end;

end foo;

Actual output:

create or replace package foo
as

    procedure foo1(
        l_input NUMBER
    ) as
begin
    --todo;

end;
end foo;

Missing highlighting of oracle ddl/dml/scripting keywords

Installation:

  • Atom 1.13 (out of the box with out of the box theme One Dark)
  • Packages: language-oracle 1.6.1, qcolor 0.4.1

Places to think about are marked in comments with: ???

Snippet one (package):

CREATE OR REPLACE PACKAGE XYZ AUTHID DEFINER AS -- AUTID DEFINER ???
k1 CONSTANT INTERVAL DAY(0) TO SECOND(0) := TO_DSINTERVAL('0 00:01:00'); -- DAY SECOND ???
PROCEDURE A1;
END XYZ;
/
CREATE OR REPLACE PACKAGE BODY XYZ AS
g1 VARCHAR2(61);
PROCEDURE A1 IS
lDate DATE;
BEGIN
SELECT SYSDATE INTO lDate FROM DUAL;
SELECT abc INTO lAbc FROM ABC WHERE DEF = 1 AND (GHI < 5 OR GHI > 10); -- AND, OR ???
END A1; -- A1 ???
BEGIN
g1 := SYS.ANYDATA.ConvertObject(CType()).GETTYPENAME(); -- SYS... ???
END XYZ;
/

Snippet two (type):

CREATE OR REPLACE TYPE C1 AS OBJECT -- OBJECT ???
(
PId NUMBER(9,0),
CId NUMBER(9,0),
CONSTRUCTOR FUNCTION C1 RETURN SELF AS RESULT -- SELF RESULT ???
)
/
CREATE OR REPLACE TYPE BODY C1 IS
CONSTRUCTOR FUNCTION C1 RETURN SELF AS RESULT IS
BEGIN
SELF.PId := NULL;
SELF.CId := NULL;
RETURN;
END C1; -- C1 ???
END;
/

DDL snippets:

WHENEVER OSERROR EXIT FAILURE ROLLBACK -- WHENEVER OSERROR FAILURE ???
WHENEVER SQLERROR EXIT FAILURE ROLLBACK -- SQLERROR ???
SET TIMING ON
SET ECHO OFF
SET LINESIZE 300
SET SERVEROUTPUT ON
SET TERMOUT OFF
PROMPT Changeset 0.0.1 -- PROMPT ???
ACCEPT gN1 CHAR PROMPT ': ' -- ACCEPT ???
COLUMN ProtokollDate FORMAT A15 Old_Value ProtokollDate -- FORMAT ???
SELECT TO_CHAR(SYSDATE,'YYYYMMDD_HH24MISS') ProtokollDate FROM DUAL;
SET TERMOUT ON
SPOOL A1_&ProtokollDate..log -- SPOOL ???

ALTER TABLE OWNER.TAB1 SHRINK SPACE CASCADE; -- SHRINK ... ???
ALTER TABLE OWNER.TAB1 MODIFY PARTITION TAB1_P01 SHRINK SPACE; -- MODIFY ... ???
ALTER TABLE OWNER.TAB2 ENABLE ROW MOVEMENT; -- ENABLE ... ???
ALTER TABLE OWNER.TAB2 DISABLE ROW MOVEMENT; -- DISABLE ... ???
ALTER TABLE OWNER.TAB3 ADD CONSTRAINT PK_TAB3 PRIMARY KEY (C1); -- ADD ???

DEFINE T1 = &1 -- DEFINE ???
CONNECT user1@db1 -- CONNECT ???
VAR TSystemProviderId NUMBER -- VAR ???

CREATE TABLE TAB4 (
ID1 NUMBER(9, 0) NOT NULL, -- NOT ???
DATETIME DATE NOT NULL,
DAY DATE NOT NULL,
UUID VARCHAR2(36 BYTE) NOT NULL, -- BYTE ???
CONSTRAINT PRIMARY KEY (ID1)
USING INDEX ( -- INDEX ???
CREATE INDEX IXPK_TAB4 ON TAB4 (ID1)
COMPRESS 3 -- COMPRESS ???
LOCAL -- LOCAL (GLOBAL) ???
(
PARTITION PIXPK_TAB4_MAXVAL_MAXVALUE -- PARTITION ???
TABLESPACE INDEX1 -- TABLESPACE
PCTFREE 10 -- PCTFREE ???
INITRANS 2 -- INITRANS ???
STORAGE ( -- STORAGE ???
INITIAL 5M -- INITIAL 5M ???
PCTINCREASE 0 -- PCTINCREASE ???
)
)
NOPARALLEL -- NOPARALLEL (PARALLEL) ???
LOGGING -- LOGGING (NOLOGGING) ???
),
CONSTRAINT CHK_TAB4NOW CHECK (DAY = TRUNC(DATETIME))
DEFERRABLE -- DEFERRABLE ???
INITIALLY DEFERRED -- INITIALLY DEFERRED (IMMEDIATE) ???
)
PARTITION BY RANGE (ID1, DAY) -- BY ???
(
PARTITION PTAB4_MAXVAL_MAXVALUE VALUES LESS THAN (MAXVALUE, MAXVALUE) -- LESS THAN MAXVALUE ???
TABLESPACE DATA1
PCTFREE 10
INITRANS 2
STORAGE (
INITIAL 20M
PCTINCREASE 0
)
)
NOPARALLEL -- NOPARALLEL ???
NOCACHE -- NOCACHE ???
LOGGING -- LOGGING ???
ENABLE ROW MOVEMENT; -- ENABLE (DISABLE) MOVEMENT ???

ALTER INDEX IXPK_TAB4E MODIFY DEFAULT ATTRIBUTES TABLESPACE INDEX1; -- MODIFY ATTRIBUTES ???

CREATE TABLE T2
(P1 VARCHAR2(50 CHAR) NOT NULL
,V1 VARCHAR2(256 CHAR) NOT NULL
,B1 VARCHAR2(256 CHAR)
,CONSTRAINT PK_T2 PRIMARY KEY (P1)
)
ORGANIZATION INDEX -- ORGANIZATION ???
/

CREATE TABLE T3
(M1 NUMBER(5,0) NOT NULL
,GID NUMBER(38,0) NOT NULL
,US BLOB
)
PCTUSED 60 PCTFREE 10 -- PCTUSED PCTFREE ???
TABLESPACE TS1
LOB (US) -- LOB
STORE AS SECUREFILE L_T3_US ( -- STORE SECUREFILE ???
NOCACHE
LOGGING
DISABLE STORAGE IN ROW
TABLESPACE TSL1
)
PARTITION BY LIST (GID) -- LIST (HASH, REFERENCE) ???
(PARTITION T3_GID_P01
VALUES (1, 3)
TABLESPACE TSP1
)
,PARTITION T3_GID_P02
VALUES (2, 4)
TABLESPACE TSP2
)
,PARTITION T3_GID_P00
VALUES (DEFAULT)
TABLESPACE TS_GID_P00
)
/

SPOOL OFF
SET TIMING OFF

Explicit Logger Support

From https://community.oracle.com/message/14080370#14080370

Would be good to have an option to grey out logger comments. Catch will be how to do this without making it look like commented code. One idea I have is to create a different background color.

I'm not too sure how the coloring system works in Atom but this option (color) may need to be configurable since people use many different themes in Atom.

Deprecated selector in `language-oracle/index.less`

In language-oracle/index.less:

Starting from Atom v1.13.0, the contents of atom-text-editor elements are no longer encapsulated within a shadow DOM boundary. This means you should stop using :host and ::shadow pseudo-selectors, and prepend all your syntax selectors with syntax--. To prevent breakage with existing style sheets, Atom will automatically upgrade the following selectors:

  • atom-text-editor::shadow .logger.oracle => atom-text-editor.editor .logger.syntax--oracle

Automatic translation of selectors will be removed in a few release cycles to minimize startup time. Please, make sure to upgrade the above selectors as soon as possible.

Add support for PL/SQL Developer package files

Please add support for the file endings of packages created with PL/SQL Developer from Allround Automations.
For Specs it´s spc and for package bodies it´s bdy (For Functions fnc and procedure prc). Would be nice, so I have not to change pl sql (oracle).cson by myself everytime you update the package...
Thanks!

large file causes freezing

On large package body Atom will freeze on loading a file. If I disable language-plsql (tried 1.5-1.6.2) the file loads fine. Also tested using language-sql and the file loads fine.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.