VS Editor Irritation

A

Alex Clark

Hi All,

Not sure if this is limited to VB.NET or if it affects the C# editor too,
but here goes.

In a new solution, inside a blank code file create an empty class inside a
Namespace. Then, at the bottom of the code after End Namespace, add code
for an Enum, as shown below:

' ================
Namespace Test1

Public Class Class1

End Class

End Namespace

Public Enum ABC
foo
bar
snay
End Enum
' ================

Collapse the code region for the Enum (or just do the Ctrl+M, Ctrl+O).
Somewhere inside the class, press return. A carriage return is inserted but
the cursor doesn't move to a new line! I've searched through the options
dialog but strangely can't find anything that says "Don't go to a new line
after inserting a carriage return when there's a Namespace, Class,
Enum....etc", so all I can assume is that it's a bug in the editor? Please
someone correct me if I'm wrong!

Cheers,
Alex Clark
 
C

Cowboy \(Gregory A. Beamer\)

While not exactly related to the question, why do you have your enum sitting
outsid of the namespace? The only reason I can think of is you are putting a
namespace within the default namespace for the project. If so, you can still
break the enum out into a different file, which would help code maintenance.

Your issue may well be a bug, but it is, overall, unlikely many people will
encounter it, as it is very specific.The collapse region is a bit buggy
overall, if you ask me, but it is rather easy to get around with a single
mouse click to another section of the page. If you hit one more carriage
return, you will likely see the new line. I am not sure why it takes two to
actually show up, but it is the nature of the IDE ... at least for now.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

**********************************************************************
Think Outside the Box!
**********************************************************************
 
A

Alex Clark

Hi Gregory,
I came across it a while ago but hadn't had time to report it. I think I'd
put the Enum down below the Namespace because for reasons which I cannot
remember, it didn't belong in that Namespace, but as it was only a small one
I didn't see the need for a whole new code file. I generally use the Class
Explorer to find things like that in my solutions anyway, so it I don't have
too many concerns putting code in places like that.

Although I agree it's a quirky one, I was pretty much posting to ask if this
really was a by-design feature or if it's a known/accepted bug. Let's face
it, we've gotta wait till halfway through 2004 (at the earliest) for a new
version anyway, so MS might as well get all the niggles sorted out that we
can find.

Cheers,
Alex Clark
 
H

Herfried K. Wagner [MVP]

* "Cowboy \(Gregory A. Beamer\) said:
Your issue may well be a bug, but it is, overall, unlikely many people will
encounter it, as it is very specific.

I am not able to repro the problem on a VS.NET 200*2* machine.
 
C

Chris Dunaway

Although I agree it's a quirky one, I was pretty much posting to ask if this

I have a bug that's been bothering me: if I pound my PC with a sledge
hammer, the computer will crash! Sometimes it will not reboot!

:)

I am always amused to read about bugs like this. I agree that MS might as
well fix it, but I'd rather they fix other bugs that have been around since
the early days of .Net that are still not fixed. For example, a string
that has a Chr(0) embedded in it will not correctly display in the IDE's
watch window. It will cut off at the null byte, even though the length is
correct.

Cheers
 
A

Alex Clark

Hi Herfried,
It's VS2003 I have the problem on (sorry I should have mentioned it in my
post)

Cheers,
Alex
 
A

Alex Clark

Chris,
I have a bug that's been bothering me: if I pound my PC with a sledge
hammer, the computer will crash! Sometimes it will not reboot!

Your analogy is incorrect. Pounding a PC with a sledge hammer is not an
accepted way of using it (though many will argue it is a very tempting way
of using it on occasion). A more precise analogy would have been "I have a
problem where 1 time out of every 10 I click shutdown and Windows doesn't
shut down". That's why this is a bug, not a feature which occurs during
improper operation.

I also know that if someone were to inform me of a bug like this in any of
my software, I would fix it, regardless of whether I thought it was petty or
wouldn't affect many people because it is A BUG.

Personally, I would much rather MS fix *ALL* the problems with VS, not just
the ones they deem to be more deserving of a fix.

Cheers,
Alex Clark
 
C

Chris Dunaway

That's why this is a bug, not a feature which occurs during
improper operation.

My apologies, I didn't mean to suggest that you discovered the bug through
misuse, but rather the seemingly uncommonness of the bug.
I also know that if someone were to inform me of a bug like this in any of
my software, I would fix it, regardless of whether I thought it was petty or
wouldn't affect many people because it is A BUG.

Personally, I would much rather MS fix *ALL* the problems with VS, not just
the ones they deem to be more deserving of a fix.

I agree completely. But if MS hasn't fixed bugs which are more serious,
what are the chances they will fix this one anytime soon?
 
H

Herfried K. Wagner [MVP]

* "Alex Clark said:
Hi Herfried,
It's VS2003 I have the problem on (sorry I should have mentioned it in my
post)

The problem doesn't even occur on my /German/ VS.NET 2003 machine.
 
A

Alex Clark

I agree completely. But if MS hasn't fixed bugs which are more serious,
what are the chances they will fix this one anytime soon?

<rant>

I know what you mean. Can anyone remember when us developers used to get
those... oh, what are they called again..... Service Packs! That's it, I
remember now! A whole handful of bug's would accumulate in Visual Studio,
or a particular language's runtime library, and MS would release a Service
Pack!

I'd say everyone on this newsgroup has probably accumulated their own small
handful of favourite VS bugs by now, but something tells me we're all still
gonna have to wait until Whidbey before we get even one of them fixed. On a
separate group, I'm discussing a hugely annoying bug in Windows Forms that
I've found lately, which causes nasty memory leaks when you do something
totally crazy---open up a context menu. Unfortunately it looks like that's
going to be plaguing me (and as a result the customers using my software)
for the next 6 or 7 months, minimum.

If we all kick up as much of a stink about these problems as the security
folks do about their buffer overrun flaws, ya think we all might get a few
hotfixes?? ;-) (lol)

</rant>

Cheers,
Alex Clark
 
P

Peter Huang

Hi Alex,

I can not reproduce the problem on my vs.net 2003 , windows xp+sp1 when I
follow the steps as you said.
Can you provide more application for me to reproduce the problem.

If you have any concern on this issue, please post here.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
C

Chris Dunaway

gonna have to wait until Whidbey before we get even one of them fixed. On a
separate group, I'm discussing a hugely annoying bug in Windows Forms that
I've found lately, which causes nasty memory leaks when you do something
totally crazy---open up a context menu. Unfortunately it looks like that's
going to be plaguing me (and as a result the customers using my software)
for the next 6 or 7 months, minimum.

Have you tested to see if the bug still exists in Whidbey? If so, you
could post it in the Whidbey groups and perhaps they'll fix it before
Whidbey launches. They seem pretty good about opening bug reports.
 
A

Alex Clark

Sadly I don't have a Whidbey Beta :-(



Chris Dunaway said:
Have you tested to see if the bug still exists in Whidbey? If so, you
could post it in the Whidbey groups and perhaps they'll fix it before
Whidbey launches. They seem pretty good about opening bug reports.

--
Chris

To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
address.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top