Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Bug: Edit.GoTo doesn't accept args

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
MattC Posted - Dec 18 2017 : 11:41:54 PM
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.
9   L A T E S T    R E P L I E S    (Newest First)
sean Posted - Feb 21 2018 : 5:49:09 PM
case=113275 is fixed in build 2258
feline Posted - Dec 20 2017 : 08:56:24 AM
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.
yduchene Posted - Dec 20 2017 : 08:19:49 AM
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

feline Posted - Dec 20 2017 : 07:25:24 AM
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.
yduchene Posted - Dec 20 2017 : 02:55:31 AM
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...)
MattC Posted - Dec 19 2017 : 11:45:01 PM
I do have a solution open that contains the files, so that will suffice for now. Thanks!
feline Posted - Dec 19 2017 : 1:48:47 PM
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?
MattC Posted - Dec 19 2017 : 1:21:05 PM
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 :)
feline Posted - Dec 19 2017 : 08:07:55 AM
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.

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