Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 Bug: Edit.GoTo doesn't accept args
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

MattC
New Member

3 Posts

Posted - Dec 18 2017 :  11:41:54 PM  Show Profile  Reply with Quote
Visual Studio's Edit.GoTo command takes a line number as an optional argument. When Visual Assist is enabled, it instead reports an error:

>Edit.GoTo 100
Command "Edit.GoTo" does not accept arguments or switches.

I've tested this in Visual Studio 2012, 2015, and 2017.

feline
Whole Tomato Software

United Kingdom
18749 Posts

Posted - Dec 19 2017 :  08:07:55 AM  Show Profile  Reply with Quote
Thank you for the clear report, that is a rather unexpected problem. I have put in a bug report for this:

case=113275

Have you already noticed that using the command "Edit.GoTo" without an argument shows the Goto dialog, which still works as expected? Not the same, but a useful work around for now.

zen is the art of being at one with the two'ness
Go to Top of Page

MattC
New Member

3 Posts

Posted - Dec 19 2017 :  1:21:05 PM  Show Profile  Reply with Quote
Thanks! The workaround doesn't help me very much. I'm building a standalone tool that has a "Open in Visual Studio" option that works via creating a process a command line like this:

\path\to\devenv.exe /edit "{File}" /command "Edit.GoTo {Line}"

Right now it just opens the file and doesn't go to the line, because I'm not about to disable Visual Assist just to get this to work :)
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18749 Posts

Posted - Dec 19 2017 :  1:48:47 PM  Show Profile  Reply with Quote
Ah, thank you for the explanation, this explains how you came across this bug. It seemed an odd thing to be typing into the command window, rather than just using the keyboard shortcut.

Do you expect to have a solution that contains these files? I am just wondering if setting the clipboard with the file name and line number would be a useful workaround for now. If you show VA's Open File dialog and use the search / filter:

test_general.cpp :35

this will open the file "test_general.cpp" and go to line 35 once the file has been opened. Not quite the same as what you are doing here, but perhaps helpful enough now and then?

zen is the art of being at one with the two'ness
Go to Top of Page

MattC
New Member

3 Posts

Posted - Dec 19 2017 :  11:45:01 PM  Show Profile  Reply with Quote
I do have a solution open that contains the files, so that will suffice for now. Thanks!
Go to Top of Page

yduchene
New Member

3 Posts

Posted - Dec 20 2017 :  02:55:31 AM  Show Profile  Reply with Quote
Hello,

Same issue for me: a Visual Studio 2015 extension calling ide.ExecuteCommand("Edit.GoTo", line) raises an exception with "Command "Edit.Goto" does not accept arguments or switches." (and makes Visual Studio crash...)
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18749 Posts

Posted - Dec 20 2017 :  07:25:24 AM  Show Profile  Reply with Quote
Is this an extension you wrote yourself, or are you using a 3rd party extension? Are you seeing an actual exception, or just an error message?

Which version of VA are you using?

Using VS2015 and VA 2248, I have installed the following IDE macro extension:

https://marketplace.visualstudio.com/items?itemName=VisualStudioPlatformTeam.MacrosforVisualStudio

which has allowed me to set up and run the following one line macro:

dte.ExecuteCommand("Edit.GoTo", 40);

with VA installed, when I run this macro I get an error telling me that the command does not accept arguments or switches, but no exceptions are thrown, and nothing crashes. So I am wondering why the problem is so much worse for you.

zen is the art of being at one with the two'ness
Go to Top of Page

yduchene
New Member

3 Posts

Posted - Dec 20 2017 :  08:19:49 AM  Show Profile  Reply with Quote
Yes, this is an extension that I can build myself and I've got the sources.
The original code doesn't catch the exception, so devenv crashes. I added a try/catch and it doesn't crash as the exception is catched, but the GoTo doesn't work.

The exception is System.Runtime.InteropServices.COMException, with Additional information: Command "Edit.GoTo" does not accept arguments or switches.
Which is the same message I got if I try "Edit.GoTo 40" in the command window.

The command window helped me to find that the problem was not in the extension code, and deactivating each extension one by one, I found that it was caused by visual assist.

VA is version 10.9.2248.0 built 2017.12.16
VS2015 is version 14.0.25431.01 Update 3

Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18749 Posts

Posted - Dec 20 2017 :  08:56:24 AM  Show Profile  Reply with Quote
Thank you for the update, at least the IDE is no longer crashing, this is an important step forward. I have also added this situation to the bug report.

zen is the art of being at one with the two'ness
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Feb 21 2018 :  5:49:09 PM  Show Profile  Reply with Quote
case=113275 is fixed in build 2258
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000