Symbol Styles

I was pretty sure I got rid of symbols for good when I blogged about it and then I realized why its not possible.

Thanks to some suggestions I came up with this solution and I wanted to share and hear your opinions on it before I dive into code.

There will be 3 different styles of symbols and every user will choose the one that works for him.

1. The default style will be the hidden dragon. (If you don’t know what this is, read the previous post) This will require no setup and will work for basic users. (Those who don’t have clashes with any other refactoring tools)

2. A prefix, the symbol we’ve grown so fond of. :-)

3. A wrapper, which consists of a prefix and a suffix.

Symbols will be represented in an element called Configuration. (More on this coming up in another post)

Here is the symbol configuration which you will find in the default Code Layout document:

   1:  <CodeLayout>
   2:    <Configuration>
   3:      <Symbol>
   4:        <ApplyOnRegions>
   5:          <HiddenDragon />
   6:        </ApplyOnRegions>
   7:      </Symbol>
   8:    </Configuration>
   9:  </CodeLayout>

You can also choose a different symbol style, such as:

   1:  <CodeLayout>
   2:    <Configuration>
   3:      <Symbol>
   4:        <ApplyOnRegions>
   5:          <Wrapper Prefix="[" Suffix="]" />
   6:        </ApplyOnRegions>
   7:      </Symbol>
   8:    </Configuration>
   9:  </CodeLayout>

To allow easy migration for everyone, you will be able to use the Obsolete element to define one or more obsolete symbols, for example:

   1:  <CodeLayout>
   2:    <Configuration>
   3:      <Symbol>
   4:        <ApplyOnRegions>
   5:          <Wrapper Prefix="{" Suffix="}" />
   6:            </ApplyOnRegions>
   7:            <Obsolete>
   8:              <Prefix Value="[rgn]" />
   9:              <HiddenDragon />
  10:            </Obsolete>
  11:          </Symbol>
  12:    </Configuration>
  13:  </CodeLayout>

I hope most users wouldn’t even have to know this symbol hell exists, but those who have special needs will find this solution good enough. What do you think?

 

This entry was posted on Sunday, September 23rd, 2007at 7:34 pm and is filed under Code Layout Schema, Public Beta, What do you think?, v0.6, v0.6.6.5. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response or trackback from your own site.

 

7 Responses to “Symbol Styles”

  1. Hi Omer,

    would be perfect for me. Especially the optional suffix is a great feature I’ve been waiting for wishfully.

    best regards

    Posted by Brettljausn on September 24th, 2007 12:31 am

  2. It looks much better to me than the previous idea. All in all, the more flexibility you give, the better :) I however feel very cold about this “obsolete” thing. It looks to me like a garbage and adds noize to the schema. Possibly you’d consider my feature request “Regionerate Custom Regions”, as a way to deal with this?

    Posted by Krzysztof Koźmic on September 24th, 2007 3:02 pm

  3. Looks perfect.

    Posted by Anonymous on September 24th, 2007 5:53 pm

  4. I dig it.

    Posted by Travis on September 25th, 2007 7:31 pm

  5. This looks like a perfect solution to me. :-)

    Posted by Anonymous on September 25th, 2007 8:18 pm

  6. You mention problems with refactoring tools; could you elaborate on which ones the new hidden symbol doesn’t work with?

    Also, is there a way to get rid of all the blank lines inserted by regionate? I would prefer no blank lines at all – but it adds some before, inside and after every region! My only quirk with an otherwise superb tool.

    Posted by Morten Mertner on October 14th, 2007 8:38 pm

  7. Morten,

    I still don’t know about any specific problems with any refactoring tools. Some users mentioned there might be problems with ReSharper, but I didn’t find any so far. I guess we’ll have to see if any problems pop up once I release v0.6.6.5.

    Regarding line separation, this was discussed here a couple of months ago and I will have it done in one of the following versions (not v0.6.6.5).

    Keep an eye out and thanks for the complement :-)

    Posted by Omer Rauchwerger on October 15th, 2007 11:05 am

 

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>