mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-14 18:12:05 +08:00
Add support for routine parameters in completion proposal of stored routine editor. Fixes issue #2555.
This commit is contained in:
@ -4610,7 +4610,7 @@ procedure TMainForm.SynCompletionProposalExecute(Kind: SynCompletionType;
|
|||||||
Sender: TObject; var CurrentInput: String; var x, y: Integer;
|
Sender: TObject; var CurrentInput: String; var x, y: Integer;
|
||||||
var CanExecute: Boolean);
|
var CanExecute: Boolean);
|
||||||
var
|
var
|
||||||
i,j: Integer;
|
i, j, ImageIndex: Integer;
|
||||||
Results: TDBQuery;
|
Results: TDBQuery;
|
||||||
DBObjects: TDBObjectList;
|
DBObjects: TDBObjectList;
|
||||||
sql, TableClauses, TableName, LeftPart, Token1, Token2, Token3, Token, Ident: String;
|
sql, TableClauses, TableName, LeftPart, Token1, Token2, Token3, Token, Ident: String;
|
||||||
@ -4623,6 +4623,8 @@ var
|
|||||||
QueryMarkers: TSQLBatch;
|
QueryMarkers: TSQLBatch;
|
||||||
Query: TSQLSentence;
|
Query: TSQLSentence;
|
||||||
Conn: TDBConnection;
|
Conn: TDBConnection;
|
||||||
|
RoutineEditor: TfrmRoutineEditor;
|
||||||
|
Param: TRoutineParam;
|
||||||
|
|
||||||
procedure AddTable(Obj: TDBObject);
|
procedure AddTable(Obj: TDBObject);
|
||||||
var
|
var
|
||||||
@ -4808,6 +4810,20 @@ begin
|
|||||||
Proposal.InsertList.Add( MySQLKeywords[i] );
|
Proposal.InsertList.Add( MySQLKeywords[i] );
|
||||||
Proposal.ItemList.Add( Format(SYNCOMPLETION_PATTERN, [ICONINDEX_KEYWORD, 'keyword', MySQLKeywords[i]] ) );
|
Proposal.ItemList.Add( Format(SYNCOMPLETION_PATTERN, [ICONINDEX_KEYWORD, 'keyword', MySQLKeywords[i]] ) );
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// Procedure params
|
||||||
|
if GetParentFormOrFrame(Editor) is TfrmRoutineEditor then begin
|
||||||
|
RoutineEditor := GetParentFormOrFrame(Editor) as TfrmRoutineEditor;
|
||||||
|
for Param in RoutineEditor.Parameters do begin
|
||||||
|
if Param.Context = 'IN' then ImageIndex := 120
|
||||||
|
else if Param.Context = 'OUT' then ImageIndex := 121
|
||||||
|
else if Param.Context = 'INOUT' then ImageIndex := 122
|
||||||
|
else ImageIndex := -1;
|
||||||
|
Proposal.InsertList.Add(Param.Name);
|
||||||
|
Proposal.ItemList.Add(Format(SYNCOMPLETION_PATTERN, [ImageIndex, Param.Datatype, Param.Name]));
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
Reference in New Issue
Block a user