OS X documents folder gone

I have the strangest issue since we got a lot of Mac people here then it seems as good as any place to ask

My OS X documents folder is “gone”, I see it in the sidebar, but when I click it it launches TextWrangler and then textwrangler tries to open every single file on the computer until it gives up.

Browsing in the finder on the disk to the Documents folder I cannot do its not there.

But if I make a simple Xojo application and make Save As dialog then, on the side bar in the Save As dialog I can click documents and all the documents are there.

Anyone got any idea how to fix this ?

(I tested deleting Text Wrangler and now when clicking Documents on the side bar nothing at all happens)

rebuild catalog of drive with disk utility, or better diskwarrior

It turned out that folder had turned into package

Fix for that is in terminal:

setfile -a b Documents/

(a opportunity here for all you utility makers ! the web is flooded with issues from users having various of folders turning into packages)

Now this only got me half way, it makes the Documents on the side bar in the finder work and open the folder. But I still cannot see the folder at all under my user.

I guess I will try as you said to rebuild catalog.

On second thought then doing additionally:

setfile -a v Documents/

Fixes the problem.

So full fix is:

setfile -a b Documents/
setfile -a v Documents/