Rubberduck: Q: Why is the Setting Folder Delimiter Period (.)?

Created on 4 Feb 2017  Â·  14Comments  Â·  Source: rubberduck-vba/Rubberduck

Why is it not backslash in Windows?
Should I change it to slash?

feature-annotations feature-code-explorer feature-settings support user-interface

Most helpful comment

I prefer the dot, because it feels like namespaces.

All 14 comments

Can you link a LoC that you're looking at?

This isn't to do with code .. it's in RD > Settings > General Settings

I typically use slash in Windows (either works). Backslash should be easy to add if you want it. Either will work, but they won't both work at the same time.

I'm so out of the loop. Sounds like @Hosch250 knows what up, so I'll just keep my nose out of it. =)

Well, I don't know. Initially, it was hard-coded as ".". When I re-did the folder stuff, I introduced a setting that allowed "/". I wasn't sure whether or not to do "\", so I just didn't. It should be easy to add.

The "folder delimiter" setting controls how @Folder annotations work.

Option Explicit
'@Folder("MyVBAProject.Foo.Bar")

This would make the module appear under folder MyVBAProject/Foo/Bar in the Code Explorer, so you can better organize your modules for easier navigation; the setting controls whether . or / is separating the folders.

This feature definitely needs better discoverability.

Ahhhhh. That makes sense now!

I prefer the dot, because it feels like namespaces.

Seems like a sensible default and it's configurable anyway.

It seems the dot was chosen to make the virtual folder system feel like namespaces from other languages (Java/.Net). Being it's virtual, it has no affect on the actual file system.

@SystemsModelling you good now? Can we close this?

Thanks Mathieu

As "Folder" invites confusion with the OS filesystem, and you perhaps
mean the virtual folders in the Office compound document file, maybe you
could refer to it as simply the object delimiter reporting? Or leave it
as period as that's how we'd refer to MyVBProject.modFoo.Bar() ?

On 04/02/2017 20:17, Mathieu Guindon wrote:
>

The "folder delimite" setting controls how |@Folder| annotations work.

|Option Explicit '@Folder("MyVBAProject.Foo.Bar") |

This would make the module appear under folder MyVBAProject/Foo/Bar in
the Code Explorer, so you can better organize your modules for easier
navigation; the setting controls whether |.| or |/| is separating the
folders.

This feature definitely needs better discoverability.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/rubberduck-vba/Rubberduck/issues/2637#issuecomment-277473817,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ANQaltbcB7GjJV3mesXELEVi0Aaj9Vt3ks5rZNzLgaJpZM4L3M5C.

--

Patrick O'Beirne, Systems Modelling Ltd
XLTest Spreadsheet Auditing http://XLTest.com
http://ie.linkedin.com/in/patrickobeirne
@ExcelAnalytics mob:+353 86 835 2233
.

Thing is, VBA/VB6 doesn't support either (folders/namespaces) - this is purely for manipulating the treeview representation of the code/project in the Code Explorer. I'm considering dropping the setting altogether - if two different projects use different delimiters, the treeview looks broken in one of them.

Is it just manipulating the treeview, or did we hook into the virtual directory for exporting to the actual file system? I seem to recall talk of it, but don't know if that ever actually happened.

@ckuhn203 it's just for the treeview, and eventually perhaps for some groupings in various toolwindows. Actually putting source files in folders would break other SC solutions (they wouldn't work with RD repositories) in VBA, and would break the actual project in VB6 (hmm, does .vbp support per-file paths?).. although, we're not yet running in the VB6 IDE.

I support dropping the setting. It's far more important that folders work across all projects for all users, even if those users have different preferences. Even a single user with multiple installs is going to have to remember to align the settings everywhere if they don't want the default delimiter.

But delimiter preference should still be achievable. What if we make it a project, or even module-level setting, and then users can express an explicit preference, without impacting other users of the project...

By adding the delimiter as an optional "argument" to the @Folder annotation, it could work, although I still think we should default to period, and limit the number of allowed delimiter characters.

'@Folder("MyVBAProject.Foo.Bar")      ' Defaults to period folders
'@Folder("MyVBAProject.Foo.Bar", ".") ' Explicit period folders
'@Folder("MyVBAProject\Foo\Bar", "\") ' Backslash folders
'@Folder("MyVBAProject/Foo/Bar", "/") ' Forwardslash folders

The lesser alternative, IMO, would be to test for the presence of either "\" or "/" in the folder string, and (given they're both illegal characters in a Windows folder name) infer that the delimiter is the found character.

'Module Foo
'@Folder("MyVBAProject.Foo.Bar")  ' contains periods, delimit by period

'Module Bar
'@Folder("MyVBAProject\Foo\Bar") ' contains backslashes, delimit by backslash

'Module Fizz
'@Folder("MyVBAProject/Foo/Bar") ' contains forwardslashes, delimit by forwardslash
Was this page helpful?
0 / 5 - 0 ratings

Related issues

SteGriff picture SteGriff  Â·  3Comments

ChrisBrackett picture ChrisBrackett  Â·  3Comments

retailcoder picture retailcoder  Â·  3Comments

Gener4tor picture Gener4tor  Â·  3Comments

bclothier picture bclothier  Â·  3Comments