Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Bug with read-only (write protected) files

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
jeoffh Posted - Feb 28 2007 : 08:33:06 AM
I have a bug to report about read-only files. This one has bothered me a bit for some time and I have just been to lazy to report it - I am using build 1544 in VS 2005 but the bug has been there for a few years in every version I have ever used. Steps to reproduce:
1) Open a project (mine is VC++ .sln file, not sure if that matters)
2) Close all files on the IDE workspace (not necessary, just eliminate confusion)
2) Open a read-only C source or header file in the IDE
3) Open a read/write (normal) C source or header file in the IDE
4) Close the IDE (the VS program) or the solution
5) Open the solution again
6) Activate (switch to) the read/write file, highlite a few rows and hit the comment slash (/). You can also just hit "CTRL-SPACE" and then choose something from the VA drop list and it will lead to the bug in step 7 (below). If you just hit a letter on the keyboard then you will edit the file like normal, its just the VA-editing things that fail as per below.
7) You should see the "Edit of Read-Only File" dialog, but this is wrong because you are on the read/write file. Even worse, if you don't realize what happened an you choose "Make Writable" then any changes will be occurring on the read-only file (switch over and see the mess you have made)

This one's a pretty nasty bug. I have managed to write-over my built-in MFC/ATL header (.h) files a few times before I realized it was a bug in Visual Assist.
8   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Mar 01 2007 : 08:12:35 AM
As an aside, see this FAQ about stopping VA loading: http://docs.wholetomato.com?W306
sean Posted - Feb 28 2007 : 12:49:23 PM
Thanks for the testing.

We had attempted a workaround in 1547; it fixed our testcase but caused more problems 'out in the wild' so had to be backed out (hence 1548). case=4903

I'm contemplating putting in a command to update the VA document state if we can't get this fixed for the next build. Not sure that the workaround is worth the effort since it can't happen automatically - it would require someone in your position to notice the odd behavior and then invoke the command to fix it...
jeoffh Posted - Feb 28 2007 : 12:33:10 PM
VA OFF + Miscellaneous Files ON = switches
VA ON + Miscellaneous Files ON = switches
VA ON + Miscellaneous Files OFF = no switch
VA Off + Miscellaneous Files OFF = no switch

Also, I am turning VA OFF before I exit VS (and thus saving my workspace) but when I load VS 2005 I see that VA has turned itself back on (this is before I load my project, it stays ON after I have loaded my project too, with or without the "miscellaneou files" enabled).
sean Posted - Feb 28 2007 : 12:20:52 PM
Thanks.

Was that with the "Show miscellaneous files" option on or off?
If it was enabled, could you please retry with the option disabled?
jeoffh Posted - Feb 28 2007 : 12:13:54 PM
Yes, with VA off the IDE does mysteriously switch the active window. The curious part (IMHO) is that I did this experiment twice with the "protected.c" file in different tab positions (the first/leftmost and also as the second/rightmost tab) and both times VisualStudio switched to "protected.c", be it tab index 0 or 1. I would have expected the problem to only manifest if the left/first tab was the protected and my workspace was saved with the unprotected file on the right and activated.

I also wanted to mention that I am running VS 2005 with SP1 (the bug was there before I used SP1, I think it was even present when I was using VS 2003 for that matter).

I hope this information helps you in your efforts. Are there any further tests that you would like for me to conduct?
sean Posted - Feb 28 2007 : 12:00:26 PM
We believe this is actually due to a bug in the IDE.

Since you have a reproducible testcase, could you please try something out?

Please add these two macros to your macro list:

Function GetOutputWindowPane(ByVal Name As String, Optional ByVal show As Boolean = True) As OutputWindowPane
Dim window As Window
Dim outputWindow As OutputWindow
Dim outputWindowPane As OutputWindowPane

window = DTE.Windows.Item(EnvDTE.Constants.vsWindowKindOutput)
If show Then window.Visible = True
outputWindow = window.Object
Try
outputWindowPane = outputWindow.OutputWindowPanes.Item(Name)
Catch e As System.Exception
outputWindowPane = outputWindow.OutputWindowPanes.Add(Name)
End Try
outputWindowPane.Activate()
Return outputWindowPane
End Function

Sub GetActiveDocumentName()
Dim doc As Document = DTE.ActiveDocument
Dim docname As String = doc.Name
Dim outputWindowPane As OutputWindowPane
outputWindowPane = GetOutputWindowPane("Output")
outputWindowPane.OutputString("activeDoc: " + docname + vbLf)
End Sub


Close the solution.
Disable VA.
Run the GetActiveDocumentName macro after you open your solution.

Normally, the macro just writes the file name of the active window to the output pane.
But in some cases, the macro causes the active window to change - the IDE notices that the activeDocument is not actually active and then switches it to become active. (But it has already given out bad information to VA by that time.)

Does running the macro cause the active window to change in your testcase?
jeoffh Posted - Feb 28 2007 : 11:29:50 AM
Yes, I am quite addicted to that "Show Miscellaneous files..." feature.

My apologies for reporting a known bug. I tried searching for "read-only" and "protected" in the forums before posting but didn't find anything relevant... Good luck with the bug squashing, and could you please let me know if/when it is fixed?

Thank you, and thanks for the response.
feline Posted - Feb 28 2007 : 11:26:07 AM
using VS2005 and VA 1548 I have just tried this, and I am not seeing any problems. Can you check and see if you have:

Show Miscellaneous files in Solution Explorer" setting in Tools|Options|Environment|Documents

turned on? There is a current bug we are trying to fix where characters are sent to the wrong file, but only if this setting is turned on. I am wondering if you are encountering the same bug.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000