How can we help you today? How can we help you today?

long column names in the candidate list are truncated

The candidate list truncates column names longer than 15 characters down to 13 characters. Compare this to the behavior of Visual Studio, which happily displays the full text of such long class names as DownloadProgressChangedEventArgs (32 characters).

A concrete example: There is a table named ProductFamilies, with columns ProductFamilyCode and ProductFamilyName. If I type this:
select * from ProductFamilies where
I have to type "ProductFamily" before before the candidate list starts to display "Code" and "Name". This is sort of ridiculous, considering that SQL Prompt is supposed to save on typing.

For reference, this affects 22 tables and 36 views in the database that I normally work with:
select distinct o.type, o.name --, a.name, b.name
from syscolumns a 
join syscolumns b on a.id = b.id and a.name < b.name
join sysobjects o on a.id = o.id
where len(a.name) > 15 and len(b.name) > 15
and left(a.name, 13) = left(b.name, 13)
and o.type in ( 'u', 'v')
order by o.type, o.name --, a.name, b.name
bis
0

Comments

3 comments

  • Bart Read
    Hi bis,


    You can just resize the completion window using the grab handle that usually appears in the bottom right hand corner. Sometimes it's in one of the other corners depending upon where the window pops up. You can similarly resize the schema panel that pops up showing you the SQL script definition of the currently selected object.

    We decided to opt for this approach rather than automatically resizing for a couple of reasons:

    (1) Normally the number of objects in the candidate list is much larger than you'd see in Visual Studio since of course you can format identifiers with and without qualification in certain places. This meant that restricting its vertical height is sometimes a pain in the butt and it's nice to be able to quickly drag it out, and then make it smaller again to get a broader view.

    (2) Object names are sometimes very long. Add that to the fact that we show data type information, and owning table for columns and you'd need a pretty wide list to fit it all in. Having a massive popup suddenly appear with the user having no control over how big it actually is seemed like a bad idea, hence we just pick a default size and provide you with the grab handle. You should find the popup remembers whatever size you dragged it to when it next pops up so you don't have to keep resizing it.

    Hope that answers your query.


    Thanks,
    Bart
    Bart Read
    0
  • bis
    The resizing is helpful to know about - I had noticed it before, but it didn't come to mind when I was in the middle of typing a query. Besides, I type fast enough that I might as well just finish typing the whole long column name rather than moving my hand to the mouse and resizing some window.

    Visual Studio's solution, which I like, is to use a smaller variable-width font (MS Sans Serif, I think) instead of using the normal editor font.

    I am sure that you wouldn't want to delay the release of SQL Prompt 3 to rewrite the candidate list display code, but I think it would be a great feature for 3.5.
    bis
    0
  • Bart Read
    You're right, I don't think we'll be delaying the release for that! :)

    We could consider using a variable width font, but then you'd lose the alignment and highlighting as you type, so there is a trade-off involved there. Maybe it'll become an option though. It'd certainly make the rendering code an awful lot simpler.


    Cheers,
    Bart
    Bart Read
    0

Add comment

Please sign in to leave a comment.