> **Rubberduck version information** Version 2.4.0.4533 OS: Microsoft Windows NT 10.0.17763.0, x64 Host Product: Microsoft Office x64 Host Version: 16.0.11328.20070 Host Executable: WINWORD.EXE
**Description**
If I select a field in a type definition I cannot select refactor.encapsulate. This may be a bit of an unfair observation but arises from having followed the thinking in
https://rubberduckvba.wordpress.com/2018/04/
on 'this' and 'TSomething'. I now use Properties and
> **Rubberduck version information** Version 2.4.0.4533 OS: Microsoft Windows NT 10.0.17763.0, x64 Host Product: Microsoft Office x64 Host Version: 16.0.11328.20070 Host Executable: WINWORD.EXE
**Description** If I encapsulate a field (not in a Type declaration) using Refator Encapsulate Field in a class that implements an interface the resulting dialog box does not offer to implement the interface equivalent of the encapsulated field.
Here's a question - why does VBA compiler give wrong error message for this code:
Public Sub x()
Do
If True Then
Loop
End Sub
This yields: Compile error: Loop without Do
When in the case it's really the End If that's missing.
After thinking about it, my guts is that it's trying to complete the If block so it's looking for Do within that block and stops there, never seeing the preceding Do.
Ok, just to be clear - we welcome any kind of contributions, so if you want to fix a bug or introduce an enhancement you also can do this.
Translating may be helpful in getting you familiar with the rubberduck's code layout which may then help you better in contributing enhancements, but that's up to you.
You indicated that your C# is basic - if you elect to do code contributions, you will want to look for the issues that are marked [difficulty-01-duckling] or possibly [difficulty-02-ducky].
I'll leave it to others to explain the mechanics of translation as I never have done any translations - I understand others uses a tool to help make this easy.
The new setup generally is that refactorings know how to get the declaration from a selection, regardless of whether they have a UI or not. Then the actual work starts from the declaration.
The exception is, ImplementInterface.
The declaration is on the model, but is now passed in on construction, or set it explicitly.
Now, the presenters can no longer just return a predefined model.
@M.Doerner I think that's better - the other goal for 4072 was to separate the UI more, so you should be able to test the refactoring by just using a model.
before, the presenter and the refactoring were tightly coupled and there were many tests that tested the presenter but should be in reality testing the model setup within the refactoring.
Design question: currently, one halve of the refactorings has a UI and the other half notifies the user about unusable selections via a message box. I think that neither using the message box nor just bailing out is a good solution. (If a refactoring does not need user input, it should not deal with UI concerns.)
So, I want to install a common framework for notifying the caller about unusable input.
What would you prefer: using an event or raising custom exceptions?
If refactoring shouldn't have UI concerns, I would have thought the command should be the one to display the message to the user that the command cannot be executed.
Severity Code Description Project File Line Suppression State
Error Duplicate 'Compile' items were included. The .NET SDK includes 'Compile' items from your project directory by default. You can either remove these items from your project file, or set the 'EnableDefaultCompileItems' property to 'false' if you want to explicitly include them in your project file. For more information, see aka.ms/sdkimplicititems. The duplicate items were: 'C:\Users\IvenBach\Source\Repos\Rubberduck\Rubberduck.Core\obj\Debug\net46\UI\About\AboutControl.g.cs'; 'C:\Users\IvenBach\Source\Repos\Rubberduck…
open up your Rubberduck.Core.csproj file - does it contains Compile entries for those files?
Unrelated: I'm finding VBA's stupidity WRT Set (or lack of it) to be quite annoying. It happily compiles someObjectVariable = anotherObjectVariable even though it's impossible to do it without Set. (Neither has default members so the implicit access isn't a factor here)
grrrr. I tried their suggestion and now am getting build errors like at work.
In order to get around this error, you can either remove the explicit Compile items that match the ones listed on the previous table, or you can set the <EnableDefaultCompileItems> property to false, like this:
@AlexisDuque keep in mind i never actually did translations myself so I'm unfamiliar w/ the tool but AIUI when youopen the resx manager, you will be able to see a list of resx
you would need to create ***.es.resx then translate from English to Spanish
just as an example -- this is an English resx file:
but with the resx manager, I think you should be able to load the English in the left pane and then create a new .es.resx on the right and get started?
Excellent! There are few more resx files; those needs to be created & translated so that the entire program is translated. Alternatively you can load it up and review your work to verify it looks right in the UI.
^ we appreciate it greatly and I hope you will learn about RD a bit and thus be in a good position to contribute code changes so you can practice your C# and get to use RD too.