Codetools: order Identifier completion by declaration (scoped). Part of issue #40332 (Based on) Patch by WooBean007

This commit is contained in:
Martin 2023-06-24 12:37:56 +02:00
parent 4289e7ad30
commit de3a85ac41
5 changed files with 160 additions and 83 deletions

View File

@ -224,6 +224,8 @@ type
);
TIdentifierListContextFlags = set of TIdentifierListContextFlag;
TIdentComplSortMethod = (icsScopedAlphabetic, icsAlphabetic, icsScopedDeclaration);
TOnGatherUserIdentifiersToFilteredList = procedure(Sender: TIdentifierList;
FilteredList: TFPList; PriorityCount: Integer) of object;
@ -235,7 +237,7 @@ type
FContextFlags: TIdentifierListContextFlags;
FOnGatherUserIdentifiersToFilteredList: TOnGatherUserIdentifiersToFilteredList;
FSortForHistory: boolean;
FSortForScope: boolean;
FSortMethodForCompletion: TIdentComplSortMethod;
FStartAtom: TAtomPosition;
FStartAtomBehind: TAtomPosition;
FStartAtomInFront: TAtomPosition;
@ -255,7 +257,7 @@ type
function CompareIdentListItems({%H-}Tree: TAvlTree; Data1, Data2: Pointer): integer;
procedure SetHistory(const AValue: TIdentifierHistoryList);
procedure SetSortForHistory(AValue: boolean);
procedure SetSortForScope(AValue: boolean);
procedure SetSortMethodForCompletion(AValue: TIdentComplSortMethod);
procedure UpdateFilteredList;
function GetFilteredItems(Index: integer): TIdentifierListItem;
procedure SetPrefix(const AValue: string);
@ -286,7 +288,9 @@ type
property History: TIdentifierHistoryList read FHistory write SetHistory;
property Prefix: string read FPrefix write SetPrefix;
property SortForHistory: boolean read FSortForHistory write SetSortForHistory;
property SortForScope: boolean read FSortForScope write SetSortForScope;
property SortMethodForCompletion: TIdentComplSortMethod read FSortMethodForCompletion
write SetSortMethodForCompletion;
property StartAtom: TAtomPosition read FStartAtom write FStartAtom;
property StartAtomInFront: TAtomPosition
read FStartAtomInFront write FStartAtomInFront; // in front of variable, not only of identifier
@ -582,7 +586,8 @@ var
Item1: TIdentifierListItem absolute Data1;
Item2: TIdentifierListItem absolute Data2;
begin
if SortForScope then begin
if SortMethodForCompletion in [icsScopedAlphabetic, icsScopedDeclaration] then begin
// first sort for Compatibility (lower is better)
if ord(Item1.Compatibility)<ord(Item2.Compatibility) then begin
Result:=-1;
@ -604,7 +609,7 @@ begin
end;
end;
if SortForScope then begin
if SortMethodForCompletion in [icsScopedAlphabetic, icsScopedDeclaration] then begin
// then sort for Level (i.e. scope, lower is better)
if Item1.Level<Item2.Level then begin
Result:=-1;
@ -615,7 +620,30 @@ begin
end;
end;
// then sort alpabetically (lower is better)
if SortMethodForCompletion = icsScopedDeclaration then begin
if (Item1.Node<>nil) and (Item2.Node<>nil) then
begin
if Item1.Node.StartPos<Item2.Node.StartPos then
begin
Result:=-1;
exit;
end else
if Item1.Node.StartPos>Item2.Node.StartPos then
begin
Result:=1;
exit;
end;
end
else
if (Item1.Node<>nil) xor (Item2.Node<>nil) then begin // One node without source pos
if (Item1.Node<>nil) then
Result := 1
else
Result := -1;
exit;
end;
end;
Result:=CompareIdentifierPtrs(Pointer(Item2.Identifier),Pointer(Item1.Identifier));
if Result<>0 then exit;
@ -623,6 +651,14 @@ begin
Result:=Item2.CompareParamList(Item1);
end;
procedure TIdentifierList.SetSortMethodForCompletion(
AValue: TIdentComplSortMethod);
begin
if FSortMethodForCompletion = AValue then Exit;
FSortMethodForCompletion := AValue;
Clear;
end;
procedure TIdentifierList.SetPrefix(const AValue: string);
begin
if FPrefix=AValue then exit;
@ -698,13 +734,6 @@ begin
Clear;
end;
procedure TIdentifierList.SetSortForScope(AValue: boolean);
begin
if FSortForScope=AValue then Exit;
FSortForScope:=AValue;
Clear;
end;
function TIdentifierList.GetFilteredItems(Index: integer): TIdentifierListItem;
begin
UpdateFilteredList;
@ -722,7 +751,7 @@ begin
FIdentSearchItem:=TIdentifierListSearchItem.Create;
FCreatedIdentifiers:=TFPList.Create;
FSortForHistory:=true;
FSortForScope:=true;
FSortMethodForCompletion:=icsScopedAlphabetic;
end;
destructor TIdentifierList.Destroy;

View File

@ -41,7 +41,7 @@ uses
// LCL
LCLType,
// CodeTools
CodeToolManager, DefineTemplates, SourceChanger,
CodeToolManager, DefineTemplates, SourceChanger, IdentCompletionTool,
// IdeIntf
IDEOptionsIntf, IDEOptEditorIntf, MacroIntf,
// LazConfig
@ -79,7 +79,7 @@ type
FAdjustTopLineDueToComment: boolean;
FAvoidUnnecessaryJumps: boolean;
FIdentComplSortForHistory: boolean;
FIdentComplSortForScope: boolean;
FIdentComplSortMethod: TIdentComplSortMethod;
FJumpSingleLinePos: integer;
FJumpCodeBlockPos: integer;
FCursorBeyondEOL: boolean;
@ -290,8 +290,8 @@ type
write FIdentComplShowHelp;
property IdentComplSortForHistory: boolean read FIdentComplSortForHistory
write FIdentComplSortForHistory;
property IdentComplSortForScope: boolean read FIdentComplSortForScope
write FIdentComplSortForScope;
property IdentComplSortMethod: TIdentComplSortMethod read FIdentComplSortMethod
write FIdentComplSortMethod;
// indentation
property IndentOnLineBreak: boolean read FIndentOnLineBreak
@ -621,8 +621,15 @@ begin
'CodeToolsOptions/IdentifierCompletion/ShowHelp',false);
FIdentComplSortForHistory:=XMLConfig.GetValue(
'CodeToolsOptions/IdentifierCompletion/SortForHistory',true);
FIdentComplSortForScope:=XMLConfig.GetValue(
'CodeToolsOptions/IdentifierCompletion/SortForScope',true);
FIdentComplSortMethod := icsAlphabetic;
if XMLConfig.GetValue(
'CodeToolsOptions/IdentifierCompletion/SortForScope',true)
then
FIdentComplSortMethod := icsScopedAlphabetic;
XMLConfig.GetValue(
'CodeToolsOptions/IdentifierCompletion/SortForMethod',
Int64(ord(FIdentComplSortMethod)), FIdentComplSortMethod, TypeInfo(TIdentComplSortMethod));
// indentation
FIndentOnLineBreak :=
@ -808,8 +815,9 @@ begin
FIdentComplShowHelp,false);
XMLConfig.SetDeleteValue('CodeToolsOptions/IdentifierCompletion/SortForHistory',
FIdentComplSortForHistory,true);
XMLConfig.SetDeleteValue('CodeToolsOptions/IdentifierCompletion/SortForScope',
FIdentComplSortForScope,true);
XMLConfig.SetDeleteValue('CodeToolsOptions/IdentifierCompletion/SortForMethod',
FIdentComplSortMethod, int64(ord(icsScopedAlphabetic)), TypeInfo(TIdentComplSortMethod));
XMLConfig.DeleteValue('CodeToolsOptions/IdentifierCompletion/SortForScope');
// indentation
XMLConfig.SetDeleteValue('CodeToolsOptions/Indentation/OnLineBreak/Enabled'
@ -959,7 +967,8 @@ begin
FIdentComplJumpToError:=CodeToolsOpts.FIdentComplJumpToError;
FIdentComplShowHelp:=CodeToolsOpts.FIdentComplShowHelp;
FIdentComplSortForHistory:=CodeToolsOpts.FIdentComplSortForHistory;
FIdentComplSortForScope:=CodeToolsOpts.FIdentComplSortForScope;
FIdentComplSortMethod:=CodeToolsOpts.FIdentComplSortMethod;
end
else
Clear;
@ -1032,7 +1041,7 @@ begin
FIdentComplJumpToError:=true;
FIdentComplShowHelp:=false;
FIdentComplSortForHistory:=true;
FIdentComplSortForScope:=true;
FIdentComplSortMethod:=icsScopedAlphabetic;
// indentation
FIndentOnLineBreak:=true;
@ -1124,7 +1133,7 @@ begin
and (FIdentComplJumpToError=CodeToolsOpts.FIdentComplJumpToError)
and (FIdentComplShowHelp=CodeToolsOpts.FIdentComplShowHelp)
and (FIdentComplSortForHistory=CodeToolsOpts.FIdentComplSortForHistory)
and (FIdentComplSortForScope=CodeToolsOpts.FIdentComplSortForScope)
and (FIdentComplSortMethod=CodeToolsOpts.FIdentComplSortMethod)
;
end;
@ -1197,7 +1206,7 @@ begin
// Identifier Completion - - - - - - - - - - - - - - - - - - - - - - - - - -
Boss.IdentifierList.SortForHistory:=IdentComplSortForHistory;
Boss.IdentifierList.SortForScope:=IdentComplSortForScope;
Boss.IdentifierList.SortMethodForCompletion:=IdentComplSortMethod;
// Code Templates- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
aFilename:=CodeCompletionTemplateFileName;

View File

@ -5,6 +5,7 @@ object CodetoolsIndentifierCompletionOptionsFrame: TCodetoolsIndentifierCompleti
Width = 537
ClientHeight = 415
ClientWidth = 537
ParentFont = False
TabOrder = 0
Visible = False
DesignLeft = 514
@ -17,7 +18,7 @@ object CodetoolsIndentifierCompletionOptionsFrame: TCodetoolsIndentifierCompleti
Left = 0
Height = 19
Top = 179
Width = 162
Width = 160
Caption = 'ICAddSemicolonCheckBox'
TabOrder = 7
end
@ -29,7 +30,7 @@ object CodetoolsIndentifierCompletionOptionsFrame: TCodetoolsIndentifierCompleti
Left = 0
Height = 19
Top = 198
Width = 188
Width = 186
Caption = 'ICAddAssignOperatorCheckBox'
TabOrder = 8
end
@ -41,7 +42,7 @@ object CodetoolsIndentifierCompletionOptionsFrame: TCodetoolsIndentifierCompleti
Left = 0
Height = 19
Top = 25
Width = 186
Width = 184
Caption = 'ICAutoInvokeOnTypeCheckBox'
TabOrder = 0
end
@ -53,7 +54,7 @@ object CodetoolsIndentifierCompletionOptionsFrame: TCodetoolsIndentifierCompleti
Left = 0
Height = 19
Top = 105
Width = 188
Width = 186
Caption = 'ICAutoStartAfterPointCheckBox'
TabOrder = 4
end
@ -65,7 +66,7 @@ object CodetoolsIndentifierCompletionOptionsFrame: TCodetoolsIndentifierCompleti
Left = 0
Height = 19
Top = 236
Width = 230
Width = 228
Caption = 'ICAutoAddParameterBracketsCheckBox'
TabOrder = 10
end
@ -77,7 +78,7 @@ object CodetoolsIndentifierCompletionOptionsFrame: TCodetoolsIndentifierCompleti
Left = 0
Height = 19
Top = 143
Width = 138
Width = 136
Caption = 'ICShowHelpCheckBox'
ParentShowHint = False
ShowHint = True
@ -90,8 +91,8 @@ object CodetoolsIndentifierCompletionOptionsFrame: TCodetoolsIndentifierCompleti
AnchorSideRight.Side = asrBottom
Left = 0
Height = 19
Top = 445
Width = 125
Top = 489
Width = 123
Caption = 'ICReplaceCheckBox'
ParentShowHint = False
ShowHint = True
@ -105,33 +106,21 @@ object CodetoolsIndentifierCompletionOptionsFrame: TCodetoolsIndentifierCompleti
Left = 0
Height = 19
Top = 217
Width = 121
Width = 119
Caption = 'ICAddDoCheckBox'
TabOrder = 9
end
object ICSortForHistoryCheckBox: TCheckBox
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = ICSortDividerBevel
AnchorSideTop.Control = ICSortOrderRadioGroup
AnchorSideTop.Side = asrBottom
Left = 0
Height = 19
Top = 272
Width = 160
Top = 313
Width = 158
Caption = 'ICSortForHistoryCheckBox'
TabOrder = 11
end
object ICSortForScopeCheckBox: TCheckBox
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = ICSortForHistoryCheckBox
AnchorSideTop.Side = asrBottom
Left = 0
Height = 19
Top = 291
Width = 154
Caption = 'ICSortForScopeCheckBox'
ParentShowHint = False
ShowHint = True
TabOrder = 12
TabOrder = 11
end
object ICOpenDividerBevel: TDividerBevel
AnchorSideLeft.Control = Owner
@ -186,7 +175,7 @@ object CodetoolsIndentifierCompletionOptionsFrame: TCodetoolsIndentifierCompleti
AnchorSideRight.Side = asrBottom
Left = 0
Height = 15
Top = 430
Top = 474
Width = 537
Caption = 'ICMiscDividerBevel'
Anchors = [akTop, akLeft, akRight]
@ -201,8 +190,8 @@ object CodetoolsIndentifierCompletionOptionsFrame: TCodetoolsIndentifierCompleti
AnchorSideRight.Side = asrBottom
Left = 0
Height = 19
Top = 464
Width = 151
Top = 508
Width = 149
Caption = 'ICJumpToErrorCheckBox'
ParentShowHint = False
ShowHint = True
@ -216,7 +205,7 @@ object CodetoolsIndentifierCompletionOptionsFrame: TCodetoolsIndentifierCompleti
Left = 20
Height = 19
Top = 124
Width = 135
Width = 133
BorderSpacing.Left = 20
Caption = 'ICAutoUseSingleIdent'
ParentShowHint = False
@ -229,8 +218,8 @@ object CodetoolsIndentifierCompletionOptionsFrame: TCodetoolsIndentifierCompleti
AnchorSideTop.Side = asrBottom
Left = 0
Height = 19
Top = 327
Width = 157
Top = 350
Width = 155
Caption = 'ICContainsFilterCheckBox'
TabOrder = 19
end
@ -242,7 +231,7 @@ object CodetoolsIndentifierCompletionOptionsFrame: TCodetoolsIndentifierCompleti
AnchorSideRight.Side = asrBottom
Left = 0
Height = 15
Top = 394
Top = 438
Width = 537
Caption = 'ICAppearanceDividerBevel'
Anchors = [akTop, akLeft, akRight]
@ -256,24 +245,24 @@ object CodetoolsIndentifierCompletionOptionsFrame: TCodetoolsIndentifierCompleti
AnchorSideTop.Side = asrBottom
Left = 0
Height = 19
Top = 409
Width = 224
Top = 453
Width = 222
Caption = 'ICUseIconsInCompletionBoxCheckBox'
TabOrder = 16
end
object ICContentDividerBevel: TDividerBevel
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = ICSortForScopeCheckBox
AnchorSideTop.Control = ICSortForHistoryCheckBox
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 0
Height = 15
Top = 312
Top = 335
Width = 537
Caption = 'ICContentDividerBevel'
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 2
BorderSpacing.Top = 3
Font.Style = [fsBold]
ParentFont = False
end
@ -282,7 +271,7 @@ object CodetoolsIndentifierCompletionOptionsFrame: TCodetoolsIndentifierCompleti
AnchorSideTop.Side = asrCenter
Left = 0
Height = 15
Top = 352
Top = 375
Width = 112
Caption = 'ICIncludeWordsLabel'
ParentColor = False
@ -294,7 +283,7 @@ object CodetoolsIndentifierCompletionOptionsFrame: TCodetoolsIndentifierCompleti
AnchorSideTop.Side = asrBottom
Left = 117
Height = 23
Top = 348
Top = 371
Width = 200
BorderSpacing.Left = 5
BorderSpacing.Top = 2
@ -308,20 +297,20 @@ object CodetoolsIndentifierCompletionOptionsFrame: TCodetoolsIndentifierCompleti
AnchorSideTop.Side = asrBottom
Left = 0
Height = 19
Top = 382
Width = 167
Top = 396
Width = 172
BorderSpacing.Top = 2
Caption = 'ICIncludeKeywordsCheckBox'
TabOrder = 14
end
end
object ICIncludeCodeTemplatesCheckBox: TCheckBox
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = ICIncludeKeywordsCheckBox
AnchorSideTop.Side = asrBottom
Left = 0
Height = 19
Top = 373
Width = 205
Top = 417
Width = 203
BorderSpacing.Top = 2
Caption = 'ICIncludeCodeTemplatesCheckBox'
TabOrder = 15
@ -334,7 +323,7 @@ object CodetoolsIndentifierCompletionOptionsFrame: TCodetoolsIndentifierCompleti
Left = 20
Height = 19
Top = 44
Width = 147
Width = 145
BorderSpacing.Left = 20
Caption = 'ICAutoOnTypeUseTimer'
ParentShowHint = False
@ -349,7 +338,7 @@ object CodetoolsIndentifierCompletionOptionsFrame: TCodetoolsIndentifierCompleti
Left = 20
Height = 19
Top = 63
Width = 172
Width = 170
BorderSpacing.Left = 20
Caption = 'ICAutoOnTypeOnlyWordEnd'
ParentShowHint = False
@ -383,4 +372,39 @@ object CodetoolsIndentifierCompletionOptionsFrame: TCodetoolsIndentifierCompleti
TabOrder = 3
Value = 2
end
object ICSortOrderRadioGroup: TRadioGroup
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = ICSortDividerBevel
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 0
Height = 39
Top = 274
Width = 537
Anchors = [akTop, akLeft, akRight]
AutoFill = True
AutoSize = True
BorderSpacing.Top = 2
Caption = 'ICSortOrderRadioGroup'
ChildSizing.LeftRightSpacing = 6
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
ChildSizing.EnlargeVertical = crsHomogenousChildResize
ChildSizing.ShrinkHorizontal = crsScaleChilds
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 3
ClientHeight = 19
ClientWidth = 533
Columns = 3
ItemIndex = 0
Items.Strings = (
'Alphabetic (Scoped)'
'Alphabetic'
'Declaration'
)
ParentShowHint = False
ShowHint = True
TabOrder = 12
end
end

View File

@ -27,11 +27,11 @@ interface
uses
SysUtils,
// LCL
Forms, StdCtrls, Spin,
Forms, StdCtrls, Spin, ExtCtrls,
// LazControls
DividerBevel,
// IdeIntf
IDEOptionsIntf, IDEOptEditorIntf,
IDEOptionsIntf, IDEOptEditorIntf, IdentCompletionTool,
// IDE
CodeToolsOptions, LazarusIDEStrConsts;
@ -63,11 +63,11 @@ type
ICAppearanceDividerBevel: TDividerBevel;
ICContentDividerBevel: TDividerBevel;
ICSortForHistoryCheckBox: TCheckBox;
ICSortForScopeCheckBox: TCheckBox;
ICUseIconsInCompletionBoxCheckBox: TCheckBox;
ICIncludeWordsLabel: TLabel;
ICAutoOnTypeMinLengthLbl: TLabel;
ICAutoOnTypeMinLength: TSpinEdit;
ICSortOrderRadioGroup: TRadioGroup;
private
public
function GetTitle: String; override;
@ -111,9 +111,11 @@ begin
ICSortDividerBevel.Caption:=lisSorting;
ICSortForHistoryCheckBox.Caption:=lisShowRecentlyUsedIdentifiersAtTop;
ICSortForScopeCheckBox.Caption:=lisSortForScope;
ICSortForScopeCheckBox.Hint:=lisForExampleShowAtTopTheLocalVariablesThenTheMembers;
ICSortOrderRadioGroup.Hint:=lisForExampleShowAtTopTheLocalVariablesThenTheMembers;
ICSortOrderRadioGroup.Caption:=' '+lisSortOrderTitle+' ';
ICSortOrderRadioGroup.Items[0]:= lisSortOrderSopedAlphabetic;
ICSortOrderRadioGroup.Items[1]:= lisSortOrderAlphabetic;
ICSortOrderRadioGroup.Items[2]:= lisSortOrderDefinition;
ICContentDividerBevel.Caption:=lisContents;
ICContainsFilterCheckBox.Caption := dlgIncludeIdentifiersContainingPrefix;
ICIncludeWordsLabel.Caption := dlgIncludeWordsToIdentCompl;
@ -153,11 +155,16 @@ begin
ICJumpToErrorCheckBox.Checked:=IdentComplJumpToError;
ICShowHelpCheckBox.Checked:=IdentComplShowHelp;
ICSortForHistoryCheckBox.Checked:=IdentComplSortForHistory;
ICSortForScopeCheckBox.Checked:=IdentComplSortForScope;
case IdentComplSortMethod of
icsScopedAlphabetic: ICSortOrderRadioGroup.ItemIndex:= 0;
icsAlphabetic: ICSortOrderRadioGroup.ItemIndex:= 1;
icsScopedDeclaration: ICSortOrderRadioGroup.ItemIndex:= 2;
end;
ICContainsFilterCheckBox.Checked:=IdentComplUseContainsFilter;
ICIncludeKeywordsCheckBox.Checked := IdentComplIncludeKeywords;
ICIncludeCodeTemplatesCheckBox.Checked:=IdentComplIncludeCodeTemplates;
ICUseIconsInCompletionBoxCheckBox.Checked:=IdentComplShowIcons;
case IdentComplIncludeWords of
icwIncludeFromAllUnits: ICAddWordsComboBox.ItemIndex:=0;
icwIncludeFromCurrentUnit: ICAddWordsComboBox.ItemIndex:=1;
@ -186,7 +193,12 @@ begin
IdentComplJumpToError:=ICJumpToErrorCheckBox.Checked;
IdentComplShowHelp:=ICShowHelpCheckBox.Checked;
IdentComplSortForHistory:=ICSortForHistoryCheckBox.Checked;
IdentComplSortForScope:=ICSortForScopeCheckBox.Checked;
case ICSortOrderRadioGroup.ItemIndex of
0: IdentComplSortMethod:=icsScopedAlphabetic;
1: IdentComplSortMethod:=icsAlphabetic;
2: IdentComplSortMethod:=icsScopedDeclaration;
end;
IdentComplUseContainsFilter:=ICContainsFilterCheckBox.Checked;
IdentComplIncludeKeywords := ICIncludeKeywordsCheckBox.Checked;
IdentComplIncludeCodeTemplates:=ICIncludeCodeTemplatesCheckBox.Checked;

View File

@ -5773,10 +5773,13 @@ resourcestring
lisBestViewedByInstallingAHTMLControlLikeTurbopowerip = 'Best viewed by '
+'installing a HTML control like turbopoweriprodsgn';
lisShowRecentlyUsedIdentifiersAtTop = 'Show recently used identifiers at top';
lisSortForScope = 'Sort for scope';
lisForExampleShowAtTopTheLocalVariablesThenTheMembers = 'For example show at'
+' top the local variables, then the members of current class, then of the'
lisForExampleShowAtTopTheLocalVariablesThenTheMembers = '"Scoped" sorting will show'
+' local variables on top, then the members of current class, then of the'
+' ancestors, then the current unit, then of used units';
lisSortOrderTitle = 'Order by';
lisSortOrderDefinition = 'Definition (Scoped)';
lisSortOrderSopedAlphabetic = 'Alphabetic (Scoped)';
lisSortOrderAlphabetic = 'Alphabetic';
lisShowEmptyUnitsPackages = 'Show empty units/packages';
lisUsePackageInProject = 'Use package %s in project';
lisUsePackageInProject2 = 'Use package in project';