8000 Code reference with object type · Issue #960 · utPLSQL/utPLSQL · GitHub
[go: up one dir, main page]

Skip to content
Code reference with object type #960
Closed
@PhilippSalvisberg

Description

@PhilippSalvisberg

Is your feature request related to a problem? Please describe.

In the SQL Developer extension I create hyperlinks for code references in warnings, errors and serveroutput reported by the realtime reporter. Code references are detected by the following regular expressions:

  • \s+("(\S+?)\.(\S+?)(?:\.(\S+?))?",\s+line\s+([0-9]+))
    examples (with line as used by Oracle):

    • at "OWNER.PACKAGE.PROCEDURE", line 42
    • at "OWNER.PROCEDURE", line 42
    • at "OWNER.PACKAGE", line 42
  • ^\s{2}((\S+?)\.(\S+?)\.(\S+?))$
    example (without line, as used for commit/rollback warning, line is calculated via source lookup and parse):

    • owner.package.procedure

Via a click on the hyperlink the referenced code line is opened in the associated editor.

The problem is, that I cannot distinguish between references to aPACKAGE SPECIFICATION and a PACKAGE BODY. This information is simply missing. I do a dictionary lookup to identify the type. But if there is a SPEC and a BODY, then I go for the BODY, which is not always correct (e.g. for warnings regarding ignored annotations).

Describe the solution you'd like

I suggest to keep the existing references as is, if they are referring a PACKAGE BODY or an UNKOWN TYPE (e.g. via Oracle error stack). But for warnings which are known to be for a SPECIFICATION I suggest to extend the code reference as follows:

at package "OWNER.PACKAGE", line 42

for bodies the reference does not need to be changed, we may keep it as today:

at "OWNER.PACKAGE", line 42

Describe alternatives you've considered

There are many ways one could tag a specification, of course. However, I would change only the representation for specifications and keep the format for all other code references to minimize the impact for users working with an older version of the utPLSQL framework. This way the SQL Developer extension will still identify the hyperlink. It will open the body instead of the spec (sometimes), but that's better than no hyperlink at all or maintaining many variants of code reference formats in the SQL Developer extension.

Additional context

Here's a screenshot:

image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0