zabel-xyz / plsql-language

plsql-language for vscode
MIT License
78 stars 29 forks source link

Syntax colorization (parameters) #22

Open Danieleeee opened 7 years ago

Danieleeee commented 7 years ago

Hi, I notice this behavior (po_* parameters): 1

Can you set this behavior depending on IN and OUT keys (different colors)? So we have colorized variables in input and output.

Consider that we can have IN OUT together: 1

It's very useful, so in every part of the code we can easily recognize the input and output variables: 1

Danieleeee commented 7 years ago

@zabel-xyz , you can use this in your plsql.tmLanguage, tested, it works:

<dict>
            <key>match</key>
            <string>(?i)(\b\w+\b)(?=\s*IN\s+|\s*IN\s+OUT\s+|(?<!IN\s)(?=\s*OUT\s+))</string>
            <key>name</key>
            <string>variable.parameter.oracle</string>
 </dict>

Do you think it's better to use different colors for parameters that ends with IN, IN OUT, OUT?

zabel-xyz commented 7 years ago

Colors are defined by the theme you are using. I'm not sure there is one that takes into account different types of variables (in, out) (others comments in your PR #23)

Danieleeee commented 7 years ago

Colors are defined by the theme you are using.

Templates can be customized, bu we must set different variable name for in and out parameter. variable.parameter.oracle is generic, you can use:

variable.parameter.in.oracle
variable.parameter.out.oracle

If we use the same name it's difficult to have different colors.

Danieleeee commented 7 years ago

updated the PR