mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-08 18:19:24 +01:00
IDE: quickfix inherited method is hidden: add modifier override
git-svn-id: trunk@57920 -
This commit is contained in:
parent
087d883674
commit
04805d25f4
@ -310,6 +310,10 @@ begin
|
|||||||
// function hides identifier at "$1". Use overload or reintroduce
|
// function hides identifier at "$1". Use overload or reintroduce
|
||||||
MsgID:=3021;
|
MsgID:=3021;
|
||||||
Result:=true;
|
Result:=true;
|
||||||
|
end else if IDEPas2jsParser.MsgLineIsId(Msg,3077,Value1,Value2) then begin
|
||||||
|
// Method "$1" hides method of base type "$2" at $3
|
||||||
|
MsgID:=3077;
|
||||||
|
Result:=true;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -318,15 +322,15 @@ procedure TQuickFixInheritedMethodIsHidden_AddModifier.CreateMenuItems(
|
|||||||
var
|
var
|
||||||
i, MsgID: Integer;
|
i, MsgID: Integer;
|
||||||
Msg: TMessageLine;
|
Msg: TMessageLine;
|
||||||
aCaption: String;
|
|
||||||
begin
|
begin
|
||||||
for i:=0 to Fixes.LineCount-1 do begin
|
for i:=0 to Fixes.LineCount-1 do begin
|
||||||
Msg:=Fixes.Lines[i];
|
Msg:=Fixes.Lines[i];
|
||||||
if not IsApplicable(Msg,MsgID) then continue;
|
if not IsApplicable(Msg,MsgID) then continue;
|
||||||
aCaption:=lisAddModifierOverload;
|
if ((Msg.SubTool=SubToolFPC) and (MsgID=3057))
|
||||||
Fixes.AddMenuItem(Self,Msg,aCaption,1);
|
or ((Msg.SubTool=SubToolPas2js) and (MsgID=3077)) then
|
||||||
aCaption:=lisAddModifierReintroduce;
|
Fixes.AddMenuItem(Self, Msg, lisAddModifierOverride, 3);
|
||||||
Fixes.AddMenuItem(Self,Msg,aCaption,2);
|
Fixes.AddMenuItem(Self,Msg,lisAddModifierOverload,1);
|
||||||
|
Fixes.AddMenuItem(Self,Msg,lisAddModifierReintroduce,2);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -354,10 +358,11 @@ begin
|
|||||||
OldChange:=LazarusIDE.OpenEditorsOnCodeToolChange;
|
OldChange:=LazarusIDE.OpenEditorsOnCodeToolChange;
|
||||||
LazarusIDE.OpenEditorsOnCodeToolChange:=true;
|
LazarusIDE.OpenEditorsOnCodeToolChange:=true;
|
||||||
try
|
try
|
||||||
if Fixes.CurrentCommand.Tag=2 then
|
case Fixes.CurrentCommand.Tag of
|
||||||
aModifier:='reintroduce'
|
2: aModifier:='reintroduce';
|
||||||
else
|
3: aModifier:='override';
|
||||||
aModifier:='overload';
|
else aModifier:='overload';
|
||||||
|
end;
|
||||||
|
|
||||||
if not CodeToolBoss.AddProcModifier(Code,Msg.Column,Msg.Line,aModifier) then
|
if not CodeToolBoss.AddProcModifier(Code,Msg.Column,Msg.Line,aModifier) then
|
||||||
begin
|
begin
|
||||||
|
|||||||
@ -6396,6 +6396,7 @@ resourcestring
|
|||||||
+'s off} to unit "%s"';
|
+'s off} to unit "%s"';
|
||||||
lisAddModifierOverload = 'Add modifier "overload"';
|
lisAddModifierOverload = 'Add modifier "overload"';
|
||||||
lisAddModifierReintroduce = 'Add modifier "reintroduce"';
|
lisAddModifierReintroduce = 'Add modifier "reintroduce"';
|
||||||
|
lisAddModifierOverride = 'Add modifier "override"';
|
||||||
lisHideWithProjectOptionVm = 'Hide with project option (-vm%s)';
|
lisHideWithProjectOptionVm = 'Hide with project option (-vm%s)';
|
||||||
lisHideWithPackageOptionVm = 'Hide with package option (-vm%s)';
|
lisHideWithPackageOptionVm = 'Hide with package option (-vm%s)';
|
||||||
lisRemoveLocalVariable3 = 'Remove local variable "%s"';
|
lisRemoveLocalVariable3 = 'Remove local variable "%s"';
|
||||||
|
|||||||
@ -44,15 +44,38 @@ general_i_abslines_compiled=01008_I_$1 lines compiled, $2 sec$3
|
|||||||
general_f_compilation_aborted=01018_F_Compilation aborted
|
general_f_compilation_aborted=01018_F_Compilation aborted
|
||||||
% Compilation was aborted.
|
% Compilation was aborted.
|
||||||
|
|
||||||
|
sym_e_id_not_found=03001_E_Identifier not found "$1"
|
||||||
|
% The compiler doesn't know this symbol. Usually happens when you misspell
|
||||||
|
% the name of a variable or procedure, or when you forget to declare a
|
||||||
|
% variable.
|
||||||
|
parser_h_function_hides_nonvirtualproc=03021_H_function hides identifier at "$1". Use overload or reintroduce
|
||||||
|
% A function hides an identifier.
|
||||||
|
parser_w_method_hides_virtualmethod=03077_W_Method "$1" hides method of base type "$2" at $3
|
||||||
|
% A method that is declared \var{virtual} in a parent class, should be
|
||||||
|
% overridden in the descendant class with the \var{override} directive. If you
|
||||||
|
% don't specify the \var{override} directive, you will hide the parent method;
|
||||||
|
% you will not override it.
|
||||||
parser_i_compiling=03104_I_Compiling $1 ...
|
parser_i_compiling=03104_I_Compiling $1 ...
|
||||||
% When you turn on information messages (\var{-vi}), the compiler tells you
|
% When you turn on information messages (\var{-vi}), the compiler tells you
|
||||||
% what units it is recompiling.
|
% what units it is (re)compiling.
|
||||||
|
|
||||||
|
type_w_instance_with_abstract=Constructing a class "$1" with abstract method "$2"
|
||||||
|
% An instance of a class is created which contains non-implemented abstract
|
||||||
|
% methods. This will probably lead to a runtime error 211 in the code if that
|
||||||
|
% routine is ever called. All abstract methods should be overridden.
|
||||||
|
|
||||||
|
sym_h_local_identifier_not_used=05025_H_Local variable "$1" not used
|
||||||
|
% You have declared, but not used, a variable in a procedure or function
|
||||||
|
% implementation.
|
||||||
|
sym_e_no_matching_implementation_found=05042_E_No matching implementation for interface method "$1" found
|
||||||
|
% There was no matching method found which could implement the interface
|
||||||
|
% method. Check argument types and result type of the methods.
|
||||||
|
|
||||||
#
|
#
|
||||||
# Logo (option -l)
|
# Logo (option -l)
|
||||||
#
|
#
|
||||||
option_logo=11023_[
|
option_logo=11023_[
|
||||||
Pas2JS Compiler version $PAS2JSFULLVERSION [$FPCDATE] for $FPCCPU
|
Pas2JS Compiler version $PAS2JSVERSIONTXT [$PAS2JSDATE] for $PAS2JSSRCOS-$PAS2JSSRCCPU
|
||||||
Copyright (c) 2016-2018 by Mattias Gaertner and others
|
Copyright (c) 2016-2018 by Mattias Gaertner and others
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user