提交 1486dcfc 编写于 作者: S serge-rider

#517 SQL auto-indent fix

上级 e8097c2e
......@@ -126,7 +126,7 @@ public class SQLEditorSourceViewerConfiguration extends TextSourceViewerConfigur
} else if (SQLPartitionScanner.CONTENT_TYPE_SQL_STRING.equals(contentType)) {
return new IAutoEditStrategy[] { new SQLStringAutoIndentStrategy(SQLPartitionScanner.CONTENT_TYPE_SQL_STRING) };
}
return null;
return new IAutoEditStrategy[0];
}
/**
......
......@@ -53,9 +53,10 @@ public class SQLAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
@Override
public void customizeDocumentCommand(IDocument document, DocumentCommand command)
{
if (!command.doit) {
return;
}
// Do not check for doit because it is disabled in LinkedModeUI (e.g. when braket triggers position group)
// if (!command.doit) {
// return;
// }
if (command.offset < 0) {
return;
}
......@@ -164,6 +165,7 @@ public class SQLAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
}
startPos = pos + 1;
final String keyword = document.get(startPos, endPos - startPos);
if (syntaxManager.getDialect().getKeywordType(keyword) == DBPKeywordType.KEYWORD) {
final String fixedKeyword = syntaxManager.getKeywordCase().transform(keyword);
if (!fixedKeyword.equals(keyword)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册