mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-26 13:00:35 +02:00
codetools: CompleteLocalVariableAsParameter: trim space of type
git-svn-id: trunk@29908 -
This commit is contained in:
parent
3a715d162c
commit
910c1dfb56
@ -940,7 +940,7 @@ var
|
||||
OldCodePos: TCodePosition;
|
||||
Node: TCodeTreeNode;
|
||||
begin
|
||||
//DebugLn('TCodeCompletionCodeTool.AddLocalVariable A ');
|
||||
//DebugLn('TCodeCompletionCodeTool.AddLocalVariable START ');
|
||||
Result:=false;
|
||||
CursorNode:=FindDeepestNodeAtPos(CleanCursorPos,true);
|
||||
if not CleanPosToCodePos(CleanCursorPos,OldCodePos) then begin
|
||||
@ -1024,8 +1024,8 @@ begin
|
||||
end;
|
||||
|
||||
function TCodeCompletionCodeTool.AddVariable(CursorNode: TCodeTreeNode;
|
||||
CleanCursorPos,
|
||||
OldTopLine: integer; const VariableName, NewType, NewUnitName: string;
|
||||
CleanCursorPos, OldTopLine: integer;
|
||||
const VariableName, NewType, NewUnitName: string;
|
||||
out NewPos: TCodeXYPosition;
|
||||
out NewTopLine: integer; SourceChangeCache: TSourceChangeCache): boolean;
|
||||
var
|
||||
@ -1034,7 +1034,9 @@ var
|
||||
VarType: String;
|
||||
VarTypeUnitName: String;
|
||||
begin
|
||||
// ask what for location of new variable
|
||||
//debugln(['TCodeCompletionCodeTool.AddVariable CursorNode=',CursorNode.DescAsString,
|
||||
// ' VariableName="',VariableName,'" NewType="',NewType,'" NewUnitName="',NewUnitName,'"']);
|
||||
// ask for location of new variable
|
||||
VarLocation:=ncpvLocal;
|
||||
VarType:=NewType;
|
||||
VarTypeUnitName:=NewUnitName;
|
||||
@ -1883,8 +1885,8 @@ begin
|
||||
DebugLn(' CompleteLocalVariableAsParameter Parameter has no type');
|
||||
exit;
|
||||
end;
|
||||
NewType:=copy(Params.NewCodeTool.Src,TypeNode.StartPos,
|
||||
TypeNode.EndPos-TypeNode.StartPos);
|
||||
NewType:=Trim(copy(Params.NewCodeTool.Src,TypeNode.StartPos,
|
||||
TypeNode.EndPos-TypeNode.StartPos));
|
||||
|
||||
// ToDo: find unit of type declaration
|
||||
MissingUnitName:=''; //GetUnitForUsesSection(Params.NewCodeTool);
|
||||
|
@ -21,7 +21,7 @@
|
||||
Author: Mattias Gaertner
|
||||
|
||||
Abstract:
|
||||
Demonstrating, how to add a method to a class and extending the uses section.
|
||||
Demonstrating how to add a method to a class and extending the uses section.
|
||||
}
|
||||
program AddEventMethod;
|
||||
|
||||
|
@ -14082,7 +14082,6 @@ begin
|
||||
Variables[ExternalMacroStart+'FPCSrcDir']:=EnvironmentOptions.GetFPCSourceDirectory;
|
||||
end;
|
||||
|
||||
debugln(['TMainIDE.InitCodeToolBoss AAA2']);
|
||||
// the first template is the "use default" flag
|
||||
CreateUseDefaultsFlagTemplate;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user