mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 21:59:07 +02:00
Formatting
git-svn-id: trunk@34091 -
This commit is contained in:
parent
05f61e9cb9
commit
72a709a931
@ -4212,7 +4212,8 @@ begin
|
|||||||
repeat
|
repeat
|
||||||
if not IsIdentStartChar[p^] then exit;
|
if not IsIdentStartChar[p^] then exit;
|
||||||
inc(p);
|
inc(p);
|
||||||
while IsIdentChar[p^] do inc(p);
|
while IsIdentChar[p^] do
|
||||||
|
inc(p);
|
||||||
if p^<>'.' then break;
|
if p^<>'.' then break;
|
||||||
inc(p);
|
inc(p);
|
||||||
until false;
|
until false;
|
||||||
|
@ -623,8 +623,8 @@ type
|
|||||||
|
|
||||||
// uses sections
|
// uses sections
|
||||||
function FindUnitInAllUsesSections(Code: TCodeBuffer;
|
function FindUnitInAllUsesSections(Code: TCodeBuffer;
|
||||||
const AnUnitName: string;
|
const AnUnitName: string; out NamePos, InPos: integer;
|
||||||
out NamePos, InPos: integer; const IgnoreMissingIncludeFiles: Boolean = False): boolean;
|
const IgnoreMissingIncludeFiles: Boolean = False): boolean;
|
||||||
function RenameUsedUnit(Code: TCodeBuffer;
|
function RenameUsedUnit(Code: TCodeBuffer;
|
||||||
const OldUnitName, NewUnitName, NewUnitInFile: string): boolean;
|
const OldUnitName, NewUnitName, NewUnitInFile: string): boolean;
|
||||||
function ReplaceUsedUnits(Code: TCodeBuffer;
|
function ReplaceUsedUnits(Code: TCodeBuffer;
|
||||||
@ -4396,8 +4396,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TCodeToolManager.FindUnitInAllUsesSections(Code: TCodeBuffer;
|
function TCodeToolManager.FindUnitInAllUsesSections(Code: TCodeBuffer;
|
||||||
const AnUnitName: string;
|
const AnUnitName: string; out NamePos, InPos: integer;
|
||||||
out NamePos, InPos: integer; const IgnoreMissingIncludeFiles: Boolean = False): boolean;
|
const IgnoreMissingIncludeFiles: Boolean = False): boolean;
|
||||||
var
|
var
|
||||||
NameAtomPos, InAtomPos: TAtomPosition;
|
NameAtomPos, InAtomPos: TAtomPosition;
|
||||||
OldIgnoreMissingIncludeFiles: Boolean;
|
OldIgnoreMissingIncludeFiles: Boolean;
|
||||||
|
@ -786,8 +786,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TPascalReaderTool.FindProcBody(ProcNode: TCodeTreeNode
|
function TPascalReaderTool.FindProcBody(ProcNode: TCodeTreeNode): TCodeTreeNode;
|
||||||
): TCodeTreeNode;
|
|
||||||
begin
|
begin
|
||||||
Result:=ProcNode;
|
Result:=ProcNode;
|
||||||
if Result=nil then exit;
|
if Result=nil then exit;
|
||||||
@ -835,8 +834,7 @@ begin
|
|||||||
Result:=true;
|
Result:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPascalReaderTool.MoveCursorToFirstProcSpecifier(
|
procedure TPascalReaderTool.MoveCursorToFirstProcSpecifier(ProcNode: TCodeTreeNode);
|
||||||
ProcNode: TCodeTreeNode);
|
|
||||||
// After the call,
|
// After the call,
|
||||||
// CurPos will stand on the first proc specifier or on a semicolon
|
// CurPos will stand on the first proc specifier or on a semicolon
|
||||||
begin
|
begin
|
||||||
@ -1057,8 +1055,7 @@ begin
|
|||||||
Result:=CleanPos<=CurPos.StartPos;
|
Result:=CleanPos<=CurPos.StartPos;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TPascalReaderTool.MoveCursorToPropType(PropNode: TCodeTreeNode
|
function TPascalReaderTool.MoveCursorToPropType(PropNode: TCodeTreeNode): boolean;
|
||||||
): boolean;
|
|
||||||
begin
|
begin
|
||||||
Result:=false;
|
Result:=false;
|
||||||
if (PropNode=nil)
|
if (PropNode=nil)
|
||||||
@ -1083,8 +1080,7 @@ begin
|
|||||||
Result:=CurPos.Flag=cafWord;
|
Result:=CurPos.Flag=cafWord;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TPascalReaderTool.MoveCursorToPropName(PropNode: TCodeTreeNode
|
function TPascalReaderTool.MoveCursorToPropName(PropNode: TCodeTreeNode): boolean;
|
||||||
): boolean;
|
|
||||||
begin
|
begin
|
||||||
Result:=false;
|
Result:=false;
|
||||||
if (PropNode=nil)
|
if (PropNode=nil)
|
||||||
@ -1130,8 +1126,7 @@ begin
|
|||||||
Result:=MoveCursorToProcSpecifier(ProcNode,ProcSpec);
|
Result:=MoveCursorToProcSpecifier(ProcNode,ProcSpec);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TPascalReaderTool.GetProcNameIdentifier(ProcNode: TCodeTreeNode
|
function TPascalReaderTool.GetProcNameIdentifier(ProcNode: TCodeTreeNode): PChar;
|
||||||
): PChar;
|
|
||||||
begin
|
begin
|
||||||
|
|
||||||
// ToDo: ppu, dcu
|
// ToDo: ppu, dcu
|
||||||
@ -1281,8 +1276,7 @@ begin
|
|||||||
Result:=GetExtraction(phpInUpperCase in Attr);
|
Result:=GetExtraction(phpInUpperCase in Attr);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TPascalReaderTool.GetPropertyNameIdentifier(PropNode: TCodeTreeNode
|
function TPascalReaderTool.GetPropertyNameIdentifier(PropNode: TCodeTreeNode): PChar;
|
||||||
): PChar;
|
|
||||||
begin
|
begin
|
||||||
// ToDo: ppu, dcu
|
// ToDo: ppu, dcu
|
||||||
|
|
||||||
@ -1292,8 +1286,7 @@ begin
|
|||||||
Result:=@Src[CurPos.StartPos];
|
Result:=@Src[CurPos.StartPos];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TPascalReaderTool.GetPropertyTypeIdentifier(PropNode: TCodeTreeNode
|
function TPascalReaderTool.GetPropertyTypeIdentifier(PropNode: TCodeTreeNode): PChar;
|
||||||
): PChar;
|
|
||||||
begin
|
begin
|
||||||
|
|
||||||
// ToDo: ppu, dcu
|
// ToDo: ppu, dcu
|
||||||
@ -1467,8 +1460,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TPascalReaderTool.GetHintModifiers(Node: TCodeTreeNode
|
function TPascalReaderTool.GetHintModifiers(Node: TCodeTreeNode): TPascalHintModifiers;
|
||||||
): TPascalHintModifiers;
|
|
||||||
|
|
||||||
function IsHintModifier: boolean;
|
function IsHintModifier: boolean;
|
||||||
begin
|
begin
|
||||||
@ -1582,8 +1574,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TPascalReaderTool.FindClassNode(StartNode: TCodeTreeNode;
|
function TPascalReaderTool.FindClassNode(StartNode: TCodeTreeNode;
|
||||||
const AClassName: string; IgnoreForwards, IgnoreNonForwards: boolean
|
const AClassName: string; IgnoreForwards, IgnoreNonForwards: boolean): TCodeTreeNode;
|
||||||
): TCodeTreeNode;
|
|
||||||
// search for class like types on same level
|
// search for class like types on same level
|
||||||
var
|
var
|
||||||
ANode, CurClassNode: TCodeTreeNode;
|
ANode, CurClassNode: TCodeTreeNode;
|
||||||
@ -1639,8 +1630,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TPascalReaderTool.FindClassNodeBackwards(StartNode: TCodeTreeNode;
|
function TPascalReaderTool.FindClassNodeBackwards(StartNode: TCodeTreeNode;
|
||||||
const AClassName: string; IgnoreForwards, IgnoreNonForwards: boolean
|
const AClassName: string; IgnoreForwards, IgnoreNonForwards: boolean): TCodeTreeNode;
|
||||||
): TCodeTreeNode;
|
|
||||||
var
|
var
|
||||||
ANode: TCodeTreeNode;
|
ANode: TCodeTreeNode;
|
||||||
CurClassNode: TCodeTreeNode;
|
CurClassNode: TCodeTreeNode;
|
||||||
@ -1730,8 +1720,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TPascalReaderTool.FindClassNode(CursorNode: TCodeTreeNode
|
function TPascalReaderTool.FindClassNode(CursorNode: TCodeTreeNode): TCodeTreeNode;
|
||||||
): TCodeTreeNode;
|
|
||||||
// find class node of a node in a procedure (declaration or body)
|
// find class node of a node in a procedure (declaration or body)
|
||||||
begin
|
begin
|
||||||
while CursorNode<>nil do begin
|
while CursorNode<>nil do begin
|
||||||
@ -1868,8 +1857,7 @@ begin
|
|||||||
Result:=(Node<>nil) and (Node.Desc=ctnClass);
|
Result:=(Node<>nil) and (Node.Desc=ctnClass);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TPascalReaderTool.FindInheritanceNode(ClassNode: TCodeTreeNode
|
function TPascalReaderTool.FindInheritanceNode(ClassNode: TCodeTreeNode): TCodeTreeNode;
|
||||||
): TCodeTreeNode;
|
|
||||||
begin
|
begin
|
||||||
Result:=ClassNode.FirstChild;
|
Result:=ClassNode.FirstChild;
|
||||||
while (Result<>nil) and (Result.Desc in [ctnClassSealed,ctnClassAbstract]) do
|
while (Result<>nil) and (Result.Desc in [ctnClassSealed,ctnClassAbstract]) do
|
||||||
@ -1878,8 +1866,7 @@ begin
|
|||||||
Result:=nil;
|
Result:=nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TPascalReaderTool.ExtractRecordCaseType(RecordCaseNode: TCodeTreeNode
|
function TPascalReaderTool.ExtractRecordCaseType(RecordCaseNode: TCodeTreeNode): string;
|
||||||
): string;
|
|
||||||
// case a:b.c of
|
// case a:b.c of
|
||||||
// case a:(b,c) of
|
// case a:(b,c) of
|
||||||
var
|
var
|
||||||
@ -1900,8 +1887,7 @@ begin
|
|||||||
Result:=ctnNone;
|
Result:=ctnNone;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TPascalReaderTool.GetSourceNamePos(var NamePos: TAtomPosition
|
function TPascalReaderTool.GetSourceNamePos(var NamePos: TAtomPosition): boolean;
|
||||||
): boolean;
|
|
||||||
begin
|
begin
|
||||||
Result:=false;
|
Result:=false;
|
||||||
NamePos.StartPos:=-1;
|
NamePos.StartPos:=-1;
|
||||||
@ -2057,8 +2043,7 @@ begin
|
|||||||
Result:=UpAtomIs('OPERATOR');
|
Result:=UpAtomIs('OPERATOR');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TPascalReaderTool.NodeIsResultIdentifier(Node: TCodeTreeNode
|
function TPascalReaderTool.NodeIsResultIdentifier(Node: TCodeTreeNode): boolean;
|
||||||
): boolean;
|
|
||||||
begin
|
begin
|
||||||
Result:=(Node<>nil)
|
Result:=(Node<>nil)
|
||||||
and (Node.Desc=ctnVarDefinition)
|
and (Node.Desc=ctnVarDefinition)
|
||||||
@ -2148,8 +2133,7 @@ begin
|
|||||||
Result:=CurPos.Flag=cafWord;
|
Result:=CurPos.Flag=cafWord;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TPascalReaderTool.GetFirstGroupVarNode(VarNode: TCodeTreeNode
|
function TPascalReaderTool.GetFirstGroupVarNode(VarNode: TCodeTreeNode): TCodeTreeNode;
|
||||||
): TCodeTreeNode;
|
|
||||||
begin
|
begin
|
||||||
Result:=VarNode;
|
Result:=VarNode;
|
||||||
if (VarNode=nil) or (VarNode.Desc<>ctnVarDefinition) then exit;
|
if (VarNode=nil) or (VarNode.Desc<>ctnVarDefinition) then exit;
|
||||||
@ -2161,8 +2145,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TPascalReaderTool.FindEndOfWithVar(WithVarNode: TCodeTreeNode
|
function TPascalReaderTool.FindEndOfWithVar(WithVarNode: TCodeTreeNode): integer;
|
||||||
): integer;
|
|
||||||
begin
|
begin
|
||||||
MoveCursorToCleanPos(WithVarNode.StartPos);
|
MoveCursorToCleanPos(WithVarNode.StartPos);
|
||||||
if not ReadTilVariableEnd(true,true) then exit(-1);
|
if not ReadTilVariableEnd(true,true) then exit(-1);
|
||||||
@ -2170,8 +2153,7 @@ begin
|
|||||||
Result:=CurPos.EndPos;
|
Result:=CurPos.EndPos;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TPascalReaderTool.NodeIsIdentifierInInterface(Node: TCodeTreeNode
|
function TPascalReaderTool.NodeIsIdentifierInInterface(Node: TCodeTreeNode): boolean;
|
||||||
): boolean;
|
|
||||||
// true if identifier is visible from other units (without prefixing)
|
// true if identifier is visible from other units (without prefixing)
|
||||||
begin
|
begin
|
||||||
case Node.Desc of
|
case Node.Desc of
|
||||||
@ -2195,8 +2177,7 @@ begin
|
|||||||
Result:=false;
|
Result:=false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TPascalReaderTool.NodeCanHaveForwardType(TypeNode: TCodeTreeNode
|
function TPascalReaderTool.NodeCanHaveForwardType(TypeNode: TCodeTreeNode): boolean;
|
||||||
): boolean;
|
|
||||||
begin
|
begin
|
||||||
Result:=false;
|
Result:=false;
|
||||||
if (TypeNode=nil) or (TypeNode.Desc<>ctnTypeDefinition)
|
if (TypeNode=nil) or (TypeNode.Desc<>ctnTypeDefinition)
|
||||||
@ -2365,8 +2346,7 @@ begin
|
|||||||
Result:=CachedSourceName;
|
Result:=CachedSourceName;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TPascalReaderTool.PropertyIsDefault(PropertyNode: TCodeTreeNode
|
function TPascalReaderTool.PropertyIsDefault(PropertyNode: TCodeTreeNode): boolean;
|
||||||
): boolean;
|
|
||||||
begin
|
begin
|
||||||
Result:=false;
|
Result:=false;
|
||||||
if (PropertyNode=nil) or (PropertyNode.Desc<>ctnProperty) then exit;
|
if (PropertyNode=nil) or (PropertyNode.Desc<>ctnProperty) then exit;
|
||||||
@ -2389,8 +2369,7 @@ begin
|
|||||||
Result:=(CurPos.Flag=cafEdgedBracketOpen);
|
Result:=(CurPos.Flag=cafEdgedBracketOpen);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TPascalReaderTool.PropNodeIsTypeLess(PropNode: TCodeTreeNode
|
function TPascalReaderTool.PropNodeIsTypeLess(PropNode: TCodeTreeNode): boolean;
|
||||||
): boolean;
|
|
||||||
begin
|
begin
|
||||||
|
|
||||||
// ToDo: ppu, dcu
|
// ToDo: ppu, dcu
|
||||||
@ -2457,8 +2436,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TPascalReaderTool.ProcNodeHasParamList(ProcNode: TCodeTreeNode
|
function TPascalReaderTool.ProcNodeHasParamList(ProcNode: TCodeTreeNode): boolean;
|
||||||
): boolean;
|
|
||||||
begin
|
begin
|
||||||
|
|
||||||
// ToDo: ppu, dcu
|
// ToDo: ppu, dcu
|
||||||
@ -2552,8 +2530,7 @@ begin
|
|||||||
Result:=true;
|
Result:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPascalReaderTool.ReadPriorUsedUnit(out UnitNameRange,
|
procedure TPascalReaderTool.ReadPriorUsedUnit(out UnitNameRange,InAtom: TAtomPosition);
|
||||||
InAtom: TAtomPosition);
|
|
||||||
begin
|
begin
|
||||||
ReadPriorAtom; // read unitname
|
ReadPriorAtom; // read unitname
|
||||||
if AtomIsStringConstant then begin
|
if AtomIsStringConstant then begin
|
||||||
@ -2576,12 +2553,13 @@ begin
|
|||||||
until false;
|
until false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TPascalReaderTool.ExtractUsedUnitNameAtCursor(InFilename: PAnsiString
|
function TPascalReaderTool.ExtractUsedUnitNameAtCursor(InFilename: PAnsiString): string;
|
||||||
): string;
|
|
||||||
begin
|
begin
|
||||||
if InFilename<>nil then InFilename^:='';
|
if InFilename<>nil then
|
||||||
|
InFilename^:='';
|
||||||
while CurPos.Flag=cafWord do begin
|
while CurPos.Flag=cafWord do begin
|
||||||
if Result<>'' then Result:=Result+'.';
|
if Result<>'' then
|
||||||
|
Result:=Result+'.';
|
||||||
Result:=Result+GetAtom;
|
Result:=Result+GetAtom;
|
||||||
ReadNextAtom;
|
ReadNextAtom;
|
||||||
if CurPos.Flag<>cafPoint then break;
|
if CurPos.Flag<>cafPoint then break;
|
||||||
@ -2608,8 +2586,7 @@ begin
|
|||||||
Result:=ExtractUsedUnitNameAtCursor(InFilename);
|
Result:=ExtractUsedUnitNameAtCursor(InFilename);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TPascalReaderTool.ReadAndCompareUsedUnit(const AnUnitName: string
|
function TPascalReaderTool.ReadAndCompareUsedUnit(const AnUnitName: string): boolean;
|
||||||
): boolean;
|
|
||||||
// after reading cursor is on atom behind unit name
|
// after reading cursor is on atom behind unit name
|
||||||
var
|
var
|
||||||
p: PChar;
|
p: PChar;
|
||||||
|
@ -3888,8 +3888,7 @@ function TPostH2PasTools.Execute(aText: TIDETextConverter): TModalResult;
|
|||||||
if not IsValidIdent(UnitName) then
|
if not IsValidIdent(UnitName) then
|
||||||
raise Exception.Create('TPostH2PasTools.Execute.AddToUsesSection invalid unitname "'+UnitName+'"');
|
raise Exception.Create('TPostH2PasTools.Execute.AddToUsesSection invalid unitname "'+UnitName+'"');
|
||||||
Changed:=true;
|
Changed:=true;
|
||||||
if not CodeToolBoss.AddUnitToMainUsesSection(
|
if not CodeToolBoss.AddUnitToMainUsesSection(TCodeBuffer(aText.CodeBuffer),UnitName,'')
|
||||||
TCodeBuffer(aText.CodeBuffer),UnitName,'')
|
|
||||||
then begin
|
then begin
|
||||||
AssignCodeToolBossError;
|
AssignCodeToolBossError;
|
||||||
DebugLn(['TPostH2PasTools.Execute.AddToUsesSection failed ',CodeToolBoss.ErrorMessage]);
|
DebugLn(['TPostH2PasTools.Execute.AddToUsesSection failed ',CodeToolBoss.ErrorMessage]);
|
||||||
@ -4943,8 +4942,7 @@ begin
|
|||||||
if (AUnitName='') then continue;
|
if (AUnitName='') then continue;
|
||||||
if not IsValidIdent(AUnitName) then
|
if not IsValidIdent(AUnitName) then
|
||||||
raise Exception.Create('TAddToUsesSection.Execute invalid unitname "'+AUnitName+'"');
|
raise Exception.Create('TAddToUsesSection.Execute invalid unitname "'+AUnitName+'"');
|
||||||
if not CodeToolBoss.AddUnitToMainUsesSection(
|
if not CodeToolBoss.AddUnitToMainUsesSection(TCodeBuffer(aText.CodeBuffer),AUnitName,'')
|
||||||
TCodeBuffer(aText.CodeBuffer),AUnitName,'')
|
|
||||||
then begin
|
then begin
|
||||||
AssignCodeToolBossError;
|
AssignCodeToolBossError;
|
||||||
DebugLn(['TAddToUsesSection.Execute failed ',CodeToolBoss.ErrorMessage]);
|
DebugLn(['TAddToUsesSection.Execute failed ',CodeToolBoss.ErrorMessage]);
|
||||||
|
@ -1040,12 +1040,11 @@ begin
|
|||||||
SelectedUnitName:=CodeToolBoss.GetSourceName(SelectedCode, false);
|
SelectedUnitName:=CodeToolBoss.GetSourceName(SelectedCode, false);
|
||||||
|
|
||||||
// add unit to uses section
|
// add unit to uses section
|
||||||
if not CodeToolBoss.AddUnitToMainUsesSection(TargetCode, SelectedUnitName,
|
if not CodeToolBoss.AddUnitToMainUsesSection(TargetCode, SelectedUnitName,'') then
|
||||||
'') then
|
|
||||||
begin
|
begin
|
||||||
DebugLn(['TCodeBrowserView.UseUnitInSrcEditor CodeToolBoss.'
|
DebugLn(['TCodeBrowserView.UseUnitInSrcEditor CodeToolBoss.'
|
||||||
+'AddUnitToMainUsesSection failed: TargetCode=', TargetCode.Filename, ' '
|
+'AddUnitToMainUsesSection failed: TargetCode=', TargetCode.Filename,
|
||||||
+'SelectedUnitName=', SelectedUnitName]);
|
' SelectedUnitName=', SelectedUnitName]);
|
||||||
LazarusIDE.DoJumpToCodeToolBossError;
|
LazarusIDE.DoJumpToCodeToolBossError;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
12
ide/main.pp
12
ide/main.pp
@ -11185,8 +11185,7 @@ begin
|
|||||||
else
|
else
|
||||||
s:='"'+ActiveSourceEditor.PageName+'"';
|
s:='"'+ActiveSourceEditor.PageName+'"';
|
||||||
if (ActiveUnitInfo.Unit_Name<>'')
|
if (ActiveUnitInfo.Unit_Name<>'')
|
||||||
and (Project1.IndexOfUnitWithName(ActiveUnitInfo.Unit_Name,
|
and (Project1.IndexOfUnitWithName(ActiveUnitInfo.Unit_Name,true,ActiveUnitInfo)>=0) then
|
||||||
true,ActiveUnitInfo)>=0) then
|
|
||||||
begin
|
begin
|
||||||
MessageDlg(Format(
|
MessageDlg(Format(
|
||||||
lisUnableToAddToProjectBecauseThereIsAlreadyAUnitWith, [s]),
|
lisUnableToAddToProjectBecauseThereIsAlreadyAUnitWith, [s]),
|
||||||
@ -11203,8 +11202,7 @@ begin
|
|||||||
MsgResult:=IDEQuestionDialog(lisAddPackageRequirement,
|
MsgResult:=IDEQuestionDialog(lisAddPackageRequirement,
|
||||||
Format(lisTheUnitBelongsToPackage, [APackage.IDAsString]),
|
Format(lisTheUnitBelongsToPackage, [APackage.IDAsString]),
|
||||||
mtConfirmation, [mrYes, lisAddPackageToProject2,
|
mtConfirmation, [mrYes, lisAddPackageToProject2,
|
||||||
mrIgnore, lisAddUnitNotRecommended,
|
mrIgnore, lisAddUnitNotRecommended, mrCancel],'');
|
||||||
mrCancel],'');
|
|
||||||
case MsgResult of
|
case MsgResult of
|
||||||
mrYes:
|
mrYes:
|
||||||
begin
|
begin
|
||||||
@ -11234,8 +11232,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if MessageDlg(Format(lisAddToProject, [s]), mtConfirmation, [mbYes,
|
if MessageDlg(Format(lisAddToProject, [s]), mtConfirmation, [mbYes,mbCancel], 0) in [mrOk,mrYes]
|
||||||
mbCancel], 0) in [mrOk,mrYes]
|
|
||||||
then begin
|
then begin
|
||||||
DependencyAdded:=false;
|
DependencyAdded:=false;
|
||||||
if FilenameIsPascalUnit(ActiveUnitInfo.Filename) then
|
if FilenameIsPascalUnit(ActiveUnitInfo.Filename) then
|
||||||
@ -11251,8 +11248,7 @@ begin
|
|||||||
ActiveUnitInfo.ReadUnitNameFromSource(false);
|
ActiveUnitInfo.ReadUnitNameFromSource(false);
|
||||||
ShortUnitName:=ActiveUnitInfo.CreateUnitName;
|
ShortUnitName:=ActiveUnitInfo.CreateUnitName;
|
||||||
if (ShortUnitName<>'') then begin
|
if (ShortUnitName<>'') then begin
|
||||||
if CodeToolBoss.AddUnitToMainUsesSection(
|
if CodeToolBoss.AddUnitToMainUsesSection(Project1.MainUnitInfo.Source,ShortUnitName,'')
|
||||||
Project1.MainUnitInfo.Source,ShortUnitName,'')
|
|
||||||
then
|
then
|
||||||
Project1.MainUnitInfo.Modified:=true;
|
Project1.MainUnitInfo.Modified:=true;
|
||||||
end;
|
end;
|
||||||
|
@ -312,8 +312,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
if CodeBuf=nil then exit;
|
if CodeBuf=nil then exit;
|
||||||
LazarusIDE.SaveSourceEditorChangesToCodeCache(nil);
|
LazarusIDE.SaveSourceEditorChangesToCodeCache(nil);
|
||||||
if not CodeToolBoss.FindUnitInAllUsesSections(CodeBuf,MissingUnitname,
|
if not CodeToolBoss.FindUnitInAllUsesSections(CodeBuf,MissingUnitname,NamePos,InPos)
|
||||||
NamePos,InPos)
|
|
||||||
then begin
|
then begin
|
||||||
DebugLn('QuickFixUnitNotFoundPosition failed due to syntax errors or '+MissingUnitname+' is not used in '+CodeBuf.Filename);
|
DebugLn('QuickFixUnitNotFoundPosition failed due to syntax errors or '+MissingUnitname+' is not used in '+CodeBuf.Filename);
|
||||||
//LazarusIDE.DoJumpToCodeToolBossError;
|
//LazarusIDE.DoJumpToCodeToolBossError;
|
||||||
|
@ -563,8 +563,7 @@ begin
|
|||||||
if not CodeToolBoss.RemoveUnitFromAllUsesSections(CodeBuf, LazResourcesUnit) then
|
if not CodeToolBoss.RemoveUnitFromAllUsesSections(CodeBuf, LazResourcesUnit) then
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
Messages.Add(Format(lisCouldNotRemoveFromMainSource, ['"',
|
Messages.Add(Format(lisCouldNotRemoveFromMainSource, ['"',LazResourcesUnit,'"']));
|
||||||
LazResourcesUnit, '"']));
|
|
||||||
debugln(['TProjectResources.UpdateMainSourceFile adding LResources to main source failed']);
|
debugln(['TProjectResources.UpdateMainSourceFile adding LResources to main source failed']);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -575,8 +574,7 @@ begin
|
|||||||
if not CodeToolBoss.AddUnitToMainUsesSection(CodeBuf, LazResourcesUnit,'') then
|
if not CodeToolBoss.AddUnitToMainUsesSection(CodeBuf, LazResourcesUnit,'') then
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
Messages.Add(Format(lisCouldNotAddToMainSource, ['"', LazResourcesUnit,
|
Messages.Add(Format(lisCouldNotAddToMainSource, ['"',LazResourcesUnit,'"']));
|
||||||
'"']));
|
|
||||||
debugln(['TProjectResources.UpdateMainSourceFile adding LResources to main source failed']);
|
debugln(['TProjectResources.UpdateMainSourceFile adding LResources to main source failed']);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user