I'm trying to open the find dialog in my VS2012 extension but I'm unable to set any options other than the find text:
var dte=(_DTE)Package.GetGlobalService(typeof(_DTE));
dte.ExecuteCommand("Edit.Find");
// this gets set:
dte.Find.FindWhat="test";
// but all others are ignored:
dte.Find.Target=vsFindTarget.vsFindTargetSolution;
dte.Find.MatchCase=false;
dte.Find.MatchWholeWord=true;
Am I missing something? I'm using VS 2012 Update 1.
Thanks to Ameen I'm now trying a different approach, however I can't find any documentation on how I need to set the arguments when raising commands:
object a=false;
object b=null;
dte.Commands.Raise(
VSConstants.GUID_VSStandardCommandSet97.ToString("B").ToUpper(),
(int)VSConstants.VSStd97CmdID.FindMatchCase, ref a, ref b);
This will always give me an E_INVALIDARG.
The DTE.Find object is stateful. It will flush down its state to the find dialog when you call the Execute method on it. In other words, it does not allow you to change the search options without executing a search.
The setting of the search term is a separate matter. Under the hoods, there is a cmdidSetSearchCombo (recalling from memory) that allows you to only set the search term and that command is executed when you set the FindWhat field of DTE.Find.
As a workaround, you can execute a search with a control character to flush the settings down to the dialog. I'd use a \r\n as the search term and simultaneously unset the multi-line search option guaranteeing that no matches will be found. Needless to say this is a hack and you should resort to this if all else fails and you are about to cry.
Are you trying to do a search in the text editor? The editor exposes the ITextSearchService2 service via MEF which will allow you to do searches scoped to a single document without the need to interact with the find dialog.
Related
I use SQUISH to perform automated tests (written in python) on a GUI application (based Linux SUSE 15) with Qt version 5.9.4.
This application contains objects with properties (example name of a menu) containing the character "&".
My test script crashes everytime an object containing the character "&" (in its properties) is called in the script.
The error is :
"LookupError: Object 'Hardwired links from RCSL to turbine I&C' not found
For debugging, I erase this character from the the application design ==> No more issues were observed, the test scripts passed.
But, it is not a sustainble solution, I need the "&" character in my application.
Do you guys have any information about SQUISH having problem with managing certain characters as "&" ?
The error message may indicate a special case: Using the plain text of an object to look up the same.
Please do not use this undocumented (and generally unsupported) approach.
Instead, please record an interaction with the respective object, and then make use of the object name that Squish automatically generated for it.
Or pick the object and copy the object name.
So in the website for the plugin, the change-log for Version 0.61 (Mar 30, 2016) mentions that they have exposed Jenkins and project bindings for use in a groovy script. I'm currently trying to set a parameter (multi select) and i want it to have different options based on the value of another parameter which is set before this one in the Jenkins job. However i'm not able to get the value of that other parameter in the script.
My problem is very similar to the one explained here
I've tried using ${param}, $(param), $param, bindings.variables.get('param') in the script, and none of it works
I've also tried to set that parameter in the Variable bindings section of the script but still no success.
Any ideas about the correct way to obtain the value?
I set the variable binding as param on the other field that you want to dynamically populate and used param (please note that i didnt use $ ${} or binding.get etc). It worked for me.
As a side note, Will active choice reactive parameter work in your case?
Our application uses embedded xulrunner. We override the default PromptService to provide custom dialogs for alert, prompt, etc by
componentRegistrar.RegisterFactory (PROMPTSERVICE_CID, aClassName, aContractID, MyPromptServiceFactory);
where,
PROMPTSERVICE_CID is "a2112d6a-0e28-421f-b46a-25c0b308cbd0"
CONTRACT_ID is "#mozilla.org/embedcomp/prompt-service;1"
When using XULRunner 1.9.* versions, this works perfectly and the call comes to MyPromptSerivceFactory. But, this doesn't work on newer XULRunner versions (>= 4.0)
I have modified the PROMPTSERVICE_CID to "7ad1b327-6dfa-46ec-9234-f2a620ea7e00" (copied from nsPrompter.manifest). While registering the factory I get the error NS_ERROR_FACTORY_EXISTS.
If I continue to use the old PROMPTSERVICE_CID, then nsIPromptService2 is not used instead nsIWindowCreator2.CreateChromeWindow2 is used to display alerts and prompts.
I have googled on this, but I couldn't find a solution to either fix the NS_ERROR_FACTORY_EXISTS error or for MyPromptServiceFactory to be used.
Any help/suggestions?
It would probably be better to use the existing prompt service the way Firefox does it rather than replace it. If you look at nsPrompter.openPrompt(), before opening a modal dialog it will try to locate and call a JavaScript function getTabModalPrompt() in the window containing the browser. It expects to get a promptBox element back and will call methods appendPrompt() and removePrompt() on it. Obviously, you don't have to give it a promptBox element, just something that behaves similarly - and displays a message any way you like.
But if you really want to replace system components, you shouldn't duplicate prompter's CID - use your own one but #mozilla.org/prompter;1 as contract ID (the old contract ID is for backwards compatibility only).
I came across echofunc.vim today (from a link in SO). Since I'm rubbish at remembering the order of function parameters, it looked like a very useful tool for me.
But the documentation is a bit lean on installation! And I've not been able to find any supplementary resources on the internet.
I'm trying to get it running on a RHEL box. I've copied the script into ~/.vim/plugin/echofunc.vim however no prompt when I type in a function name followed by '('. I've tried adding
let g:EchoFuncLangsUsed = ["php","java","cpp"]
to my .vimrc - still no prompting.
I'm guessing it needs to read from a dictionary somewhere - although there is a file in /usr/share/vim/vim70/ftplugin/php.vim, this is the RH default and does not include an explicit function list.
I'm not too bothered about getting hints on the functions/methods I've defined - just trying to get hints for the built-in functions. I can see there is a dictionary file available here which appears to provide the resources required for echofunc.vim, I can't see how I set this up.
TIA,
It expects a tags file, the last line of the description describes exactly how to generate it:
ctags -R --fields=+lS .
It works here with PHP but not with JS. Your mileage may vary.
I didn't know about this plugin, thanks for the info.
You should try phpcomplete.vim, it shows a prototype of the current function in a scratchpad. It is PHP only, though.
I am using visual studio 2008 and MFC. I accept arguments using a subclass of CCommandLineInfo and overriding ParseParam().
Now I want to pass these arguments to the application while running. For example "test.exe /start" and then to type in the console "test.exe /initialize" to be initialized again.
is there any way to do that?
Edit 1: Some clarifications. My program starts with "test.exe /start". I want to type "test.exe /initialize" and initialize the one and only running process (without closing/opening). And by initialize I mean to read a different XML file, to change some values of the interface and other things.
I cannot think of an easy way to accomplish what you're asking about.
However, you could develop your application to specifically receive commands, and given those commands take any actions you wanted based upon receiving them. Since you're already using MFC, you can do this rather easily. Create a Window (HWND) for your application and register it. It doesn't have to be visible (this won't necessarily make you application a GUI application). Implement a WndProc, and define specific messages that you will receive based on WM_USER + <xxx>.
First and obvious question is why you want to have threads, instead of processes.
You may use GetCommandLine and CommandLineToArgvW to get the fully formatted command line. Detect the arguments, and the call CreateProcess or ShellExecute passing /watever to spawn the process. You may also want to use GetModuleBaseName to get the name of your own EXE.