mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 06:16:05 +02:00
IDE: quick fix add -vm: mark all messages of this view with same type as fixed
git-svn-id: trunk@45406 -
This commit is contained in:
parent
dc48a39621
commit
3e15f47c0e
@ -21,15 +21,18 @@
|
|||||||
Author: Mattias Gaertner
|
Author: Mattias Gaertner
|
||||||
|
|
||||||
Abstract:
|
Abstract:
|
||||||
Standard Quick Fixes - tools to fix (compiler) messages.
|
Standard Quick Fixes - tools to help fixing (compiler) messages.
|
||||||
|
|
||||||
ToDo:
|
ToDo:
|
||||||
- TQuickFixIdentifierNotFoundAddLocal: extend with add private/public
|
- TQuickFixIdentifierNotFoundAddLocal: extend with add private/public
|
||||||
|
- local var not used: remove declaration and all assignments
|
||||||
- There is no method in an ancestor class to be overriden:
|
- There is no method in an ancestor class to be overriden:
|
||||||
1. option: if the ancestor has a function with the same name: update the parameter list
|
1. option: if the ancestor has a function with the same name: update the parameter list
|
||||||
2. option: remove the method
|
2. option: remove the method
|
||||||
3. option: add a virtual method to the ancestor
|
3. option: add a virtual method to the ancestor
|
||||||
- complete function implementations with missing parameters
|
- function header doesn't match any method: update from interface/class
|
||||||
|
- function header doesn't match any method: update interface/class
|
||||||
|
- complete function implementation with missing parameters
|
||||||
- private variable not used => remove
|
- private variable not used => remove
|
||||||
- Hint: Local variable "Path" does not seem to be initialized
|
- Hint: Local variable "Path" does not seem to be initialized
|
||||||
auto add begin+end
|
auto add begin+end
|
||||||
@ -39,7 +42,8 @@
|
|||||||
record: FillByte(p %H-,SizeOf(p),0)
|
record: FillByte(p %H-,SizeOf(p),0)
|
||||||
set:=[]
|
set:=[]
|
||||||
enum:=low(enum);
|
enum:=low(enum);
|
||||||
|
default()
|
||||||
|
- Hint: function result does not seem to be initialized, see above for local var
|
||||||
}
|
}
|
||||||
unit etQuickFixes;
|
unit etQuickFixes;
|
||||||
|
|
||||||
@ -232,12 +236,13 @@ var
|
|||||||
CompOpts: TLazCompilerOptions;
|
CompOpts: TLazCompilerOptions;
|
||||||
Pkg: TIDEPackage;
|
Pkg: TIDEPackage;
|
||||||
ToolData: TIDEExternalToolData;
|
ToolData: TIDEExternalToolData;
|
||||||
|
i: Integer;
|
||||||
|
CurMsg: TMessageLine;
|
||||||
begin
|
begin
|
||||||
if not IsApplicable(Msg,ToolData,IDETool) then exit;
|
if not IsApplicable(Msg,ToolData,IDETool) then exit;
|
||||||
if IDETool is TLazProject then begin
|
if IDETool is TLazProject then begin
|
||||||
CompOpts:=TLazProject(IDETool).LazCompilerOptions;
|
CompOpts:=TLazProject(IDETool).LazCompilerOptions;
|
||||||
CompOpts.MessageFlags[Msg.MsgID]:=cfvHide;
|
CompOpts.MessageFlags[Msg.MsgID]:=cfvHide;
|
||||||
Msg.MarkFixed;
|
|
||||||
end else if IDETool is TIDEPackage then begin
|
end else if IDETool is TIDEPackage then begin
|
||||||
if PackageEditingInterface.DoOpenPackageFile(ToolData.Filename,
|
if PackageEditingInterface.DoOpenPackageFile(ToolData.Filename,
|
||||||
[pofAddToRecent],false)<>mrOk then exit;
|
[pofAddToRecent],false)<>mrOk then exit;
|
||||||
@ -245,7 +250,17 @@ begin
|
|||||||
if Pkg=nil then exit;
|
if Pkg=nil then exit;
|
||||||
CompOpts:=Pkg.LazCompilerOptions;
|
CompOpts:=Pkg.LazCompilerOptions;
|
||||||
CompOpts.MessageFlags[Msg.MsgID]:=cfvHide;
|
CompOpts.MessageFlags[Msg.MsgID]:=cfvHide;
|
||||||
Msg.MarkFixed;
|
end else
|
||||||
|
exit;
|
||||||
|
Msg.MarkFixed;
|
||||||
|
// mark all lines of the View with the same message type
|
||||||
|
for i:=0 to Msg.Lines.Count-1 do begin
|
||||||
|
CurMsg:=Msg.Lines[i];
|
||||||
|
if (CurMsg.MsgID<>Msg.MsgID)
|
||||||
|
or (CurMsg.Urgency>=mluError)
|
||||||
|
or (CurMsg.SubTool<>SubToolFPC)
|
||||||
|
then continue;
|
||||||
|
CurMsg.MarkFixed;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user