mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-05-06 20:09:54 -05:00
Auto-completion for column names in the SQL editor
Isolated column names are added to the list of possible auto-completions, so they can be completed without having to enter first the table followed by dot. "Table.field" completion is still supported for completing only for fields inside that context. See issue #1242
This commit is contained in:
+5
-1
@@ -138,10 +138,14 @@ void SqlUiLexer::setTableNames(const TablesAndColumnsMap& tables)
|
||||
setupAutoCompletion();
|
||||
for(auto it=tables.constBegin();it!=tables.constEnd();++it)
|
||||
{
|
||||
for(const QString& field : it.value())
|
||||
for(const QString& field : it.value()) {
|
||||
// Completion for table.field
|
||||
autocompleteApi->add(it.key() + "?" + QString::number(SqlUiLexer::ApiCompleterIconIdTable) + "." +
|
||||
field + "?" + QString::number(SqlUiLexer::ApiCompleterIconIdColumn));
|
||||
// Completion for isolated field
|
||||
autocompleteApi->add(field + "?" + QString::number(SqlUiLexer::ApiCompleterIconIdColumn));
|
||||
|
||||
}
|
||||
// Store the table name list in order to highlight them in a different colour
|
||||
listTables.append(it.key());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user