Skip to content

Commit 1addfae

Browse files
committed
Closes #4097
1 parent c5bb40f commit 1addfae

File tree

4 files changed

+21
-20
lines changed

4 files changed

+21
-20
lines changed

Rubberduck.Parsing/Rewriter/MemberAttributesRewriter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public override void Rewrite()
3939
return;
4040
}
4141

42-
var file = vbeKind == VBEKind.Embedded
42+
var file = vbeKind == VBEKind.Hosted
4343
? _exporter.Export(component)
4444
: component.GetFileName(1);
4545

Rubberduck.Parsing/VBA/AttributeParser.cs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public AttributeParser(IModuleExporter exporter, Func<IVBAPreprocessor> preproce
3737
cancellationToken.ThrowIfCancellationRequested();
3838
var component = _projectsProvider.Component(module);
3939

40-
var path = component.VBE.Kind == VBEKind.Embedded
40+
var path = component.VBE.Kind == VBEKind.Hosted
4141
? _exporter.Export(component)
4242
: component.GetFileName(1);
4343

@@ -57,15 +57,18 @@ public AttributeParser(IModuleExporter exporter, Func<IVBAPreprocessor> preproce
5757
code = File.ReadAllText(path, Encoding.Default); //The VBE exports encoded in the current ANSI codepage from the windows settings.
5858
}
5959

60-
try
60+
if (component.VBE.Kind == VBEKind.Hosted)
6161
{
62-
File.Delete(path);
62+
try
63+
{
64+
File.Delete(path);
65+
}
66+
catch
67+
{
68+
// Meh.
69+
}
6370
}
64-
catch
65-
{
66-
// Meh.
67-
}
68-
71+
6972
cancellationToken.ThrowIfCancellationRequested();
7073

7174
var type = module.ComponentType == ComponentType.StandardModule
Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Threading.Tasks;
6-
7-
namespace Rubberduck.VBEditor.SafeComWrappers
1+
namespace Rubberduck.VBEditor.SafeComWrappers
82
{
93
public enum VBEKind
104
{
11-
/// <summary>Embedded VB editor (Visual Basic for Applications).</summary>
12-
Embedded,
5+
/// <summary>
6+
/// Hosted VB editor (Visual Basic for Applications).
7+
/// </summary>
8+
Hosted,
139

14-
/// <summary>Standalone VB editor (Visual Basic).</summary>
10+
/// <summary>
11+
/// Standalone VB editor (Visual Basic).
12+
/// </summary>
1513
Standalone
1614
}
1715
}

Rubberduck.VBEditor.VBA/SafeComWrappers/VB/VBE.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public VBE(VB.VBE target, bool rewrapping = false)
1919
{
2020
}
2121

22-
public VBEKind Kind => VBEKind.Embedded;
22+
public VBEKind Kind => VBEKind.Hosted;
2323
public object HardReference => Target;
2424

2525
public string Version => IsWrappingNullReference ? string.Empty : Target.Version;

0 commit comments

Comments
 (0)