Skip to content

Commit 0426312

Browse files
Hosch250retailcoder
authored andcommitted
Close #1531. Remove some dead bug comments. (#1535)
1 parent 1a93fc5 commit 0426312

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

RetailCoder.VBE/Inspections/ObsoleteTypeHintInspection.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,18 @@ public override IEnumerable<InspectionResultBase> GetInspectionResults()
2222

2323
var declarations = from item in results
2424
where item.HasTypeHint()
25-
// bug: this inspection result only has one value. Why are we passing two in?
26-
select new ObsoleteTypeHintInspectionResult(this, string.Format(InspectionsUI.ObsoleteTypeHintInspectionResultFormat, InspectionsUI.Inspections_Declaration, item.DeclarationType.ToString().ToLower(), item.IdentifierName), new QualifiedContext(item.QualifiedName, item.Context), item);
27-
// todo: localize this InspectionResultFormat properly
25+
select new ObsoleteTypeHintInspectionResult(this,
26+
string.Format(InspectionsUI.ObsoleteTypeHintInspectionResultFormat,
27+
InspectionsUI.Inspections_Declaration, item.DeclarationType.ToString().ToLower(),
28+
item.IdentifierName), new QualifiedContext(item.QualifiedName, item.Context), item);
29+
2830
var references = from item in results.SelectMany(d => d.References)
2931
where item.HasTypeHint()
30-
select new ObsoleteTypeHintInspectionResult(this, string.Format(InspectionsUI.ObsoleteTypeHintInspectionResultFormat, InspectionsUI.Inspections_Usage, item.Declaration.DeclarationType.ToString().ToLower(), item.IdentifierName), new QualifiedContext(item.QualifiedModuleName, item.Context), item.Declaration);
32+
select new ObsoleteTypeHintInspectionResult(this,
33+
string.Format(InspectionsUI.ObsoleteTypeHintInspectionResultFormat,
34+
InspectionsUI.Inspections_Usage, item.Declaration.DeclarationType.ToString().ToLower(),
35+
item.IdentifierName), new QualifiedContext(item.QualifiedModuleName, item.Context),
36+
item.Declaration);
3137

3238
return declarations.Union(references);
3339
}

RetailCoder.VBE/Inspections/UntypedFunctionUsageInspectionResult.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,20 @@ public override string Description
3232
public class UntypedFunctionUsageQuickFix : CodeInspectionQuickFix
3333
{
3434
public UntypedFunctionUsageQuickFix(ParserRuleContext context, QualifiedSelection selection)
35-
: base(context, selection, string.Format(InspectionsUI.QuickFixUseTypedFunction_, context.GetText(), context.GetText() + "$"))
35+
: base(context, selection,
36+
string.Format(InspectionsUI.QuickFixUseTypedFunction_,
37+
context.GetText(), context.GetText().Insert(context.GetText().IndexOf('('), "$")))
3638
{
3739
}
3840

3941
public override void Fix()
4042
{
4143
var originalInstruction = Context.GetText();
42-
var newInstruction = originalInstruction + "$";
44+
var newInstruction = originalInstruction.Insert(originalInstruction.IndexOf('('), "$");
4345
var selection = Selection.Selection;
4446

4547
var module = Selection.QualifiedName.Component.CodeModule;
46-
var lines = module.get_Lines(selection.StartLine, selection.LineCount);
48+
var lines = module.Lines[selection.StartLine, selection.LineCount];
4749

4850
var result = lines.Replace(originalInstruction, newInstruction);
4951
module.ReplaceLine(selection.StartLine, result);

0 commit comments

Comments
 (0)