Skip to content

Commit

Permalink
dbeaver/pro#2293 Add missing colors descriptions, fix NPE, distinct c…
Browse files Browse the repository at this point in the history
…olors for aliases from alias sources
  • Loading branch information
E1izabeth authored and serge-rider committed Dec 22, 2023
1 parent 6dfbf81 commit dfef7c0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
Expand Up @@ -183,11 +183,17 @@ colorDefinition.org.jkiss.dbeaver.sql.editor.color.text.background.description =
colorDefinition.org.jkiss.dbeaver.sql.editor.color.disabled.background.label = SQL disabled background
colorDefinition.org.jkiss.dbeaver.sql.editor.color.disabled.background.description = SQL text background
colorDefinition.org.jkiss.dbeaver.sql.editor.color.table.foreground.label = SQL table name foreground
colorDefinition.org.jkiss.dbeaver.sql.editor.color.table.foreground.description = SQL table name foreground
colorDefinition.org.jkiss.dbeaver.sql.editor.color.table.alias.foreground.label = SQL table alias foreground
colorDefinition.org.jkiss.dbeaver.sql.editor.color.table.alias.foreground.description = SQL table alias foreground
colorDefinition.org.jkiss.dbeaver.sql.editor.color.column.foreground.label = SQL column name foreground
colorDefinition.org.jkiss.dbeaver.sql.editor.color.column.foreground.description = SQL column name foreground
colorDefinition.org.jkiss.dbeaver.sql.editor.color.column.derived.foreground.label = SQL derived column foreground
colorDefinition.org.jkiss.dbeaver.sql.editor.color.column.derived.foreground.description = SQL column alias foreground
colorDefinition.org.jkiss.dbeaver.sql.editor.color.schema.foreground.label = SQL schema name foreground
colorDefinition.org.jkiss.dbeaver.sql.editor.color.schema.foreground.description = SQL schema name foreground
colorDefinition.org.jkiss.dbeaver.sql.editor.color.semanticError.foreground.label = SQL semantic error foreground
colorDefinition.org.jkiss.dbeaver.sql.editor.color.semanticError.foreground.description = SQL semantic error foreground
keyword.org.jkiss.dbeaver.pref.keyword.sql.format.label = formatter query keyword case tab space indent substatement comma delimiter workbench upper lower mixed line
Expand Down
Expand Up @@ -362,10 +362,16 @@ public Interval runWithResult() {
}
return;
} else {
elements.set(0, SQLScriptParser.extractQueryAtPos(parserContext, elements.get(0).getOffset()));
SQLScriptElement element = SQLScriptParser.extractQueryAtPos(parserContext, elements.get(0).getOffset());
if (element != null) {
elements.set(0, element);
}
if (elements.size() > 1) {
int index = elements.size() - 1;
elements.set(index, SQLScriptParser.extractQueryAtPos(parserContext, elements.get(index).getOffset()));
element = SQLScriptParser.extractQueryAtPos(parserContext, elements.get(index).getOffset());
if (element != null) {
elements.set(index, element);
}
}
}

Expand Down
Expand Up @@ -100,15 +100,15 @@ private static TextAttribute makeTextAttribute(TPToken token, SQLRuleScanner sca
style = SWT.NORMAL;
break;
case T_TABLE_ALIAS:
colorKey = SQLConstants.CONFIG_COLOR_TABLE;
colorKey = SQLConstants.CONFIG_COLOR_TABLE_ALIAS;
style = SWT.ITALIC;
break;
case T_COLUMN:
colorKey = SQLConstants.CONFIG_COLOR_COLUMN;
style = SWT.NORMAL;
break;
case T_COLUMN_DERIVED:
colorKey = SQLConstants.CONFIG_COLOR_COLUMN;
colorKey = SQLConstants.CONFIG_COLOR_COLUMN_DERIVED;
style = SWT.ITALIC;
break;
case T_SCHEMA:
Expand Down

0 comments on commit dfef7c0

Please sign in to comment.