How to programmatically detect command keybinding (shortcut) conflict - visual-studio-extensions

I have command shortcut in extension which is working well in VS2012 and VS2015. But starting from VS2017 it doesn't work. Now VS has its own command shortcut with such keys combination. Commands have different scope VS - Text Editor and my command for TSQL-Editor. Strange but more specific scope (TSQL-Editor) shortcut doesn't work.
I have implemented Microsoft.VisualStudio.OLE.Interop.IOleCommandTarget but QueryStatus doesn't call when I'm trying to execute my command.
There should be some mechanism because for example ReSharper can detect such conflicts
How to handle keybinding conflicts?

Related

What does '/p:' on the Windows Command Line mean

I want to name the environment in the command line when using dotnet publish. I found this solution
dotnet publish -o site /p:EnvironmentName=Production
I've never seen that /p: argument before and want to know what exactly that is. I tried to google it but because of its syntax it was hard to find anything.
I especially want to know if I can use this command also on a Linux machine in bash.
Basically, it is passed to MSBuild and sets a variable/property called EnvironmentName to a value Production. Then MSBuild scripts can read that variable when performing various tasks. It's moreless the same as setting a property in <PropertyGroup> in MSBuild script (also VisualStudio's cpsroj file).
You can see it for example here
msbuild buildapp.csproj -t:HelloWorld -p:Configuration=Release
Note that -p: syntax is the same as /p: (also -t: and /t: and so on). The former is the new one, while the latter conforms to old "DOS" way of providing command line options in Windows. For quite a couple of years many newer developer tools from Microsoft accept both ways, but the - is preferred, as it can also be used in i.e. powershell or linux, while the older / can't (or can, but cause some problems or need complicated escaping/quoting).
EDIT: ah yes, and I didn't fully answer.. The -p or /p is NOT a "windows commandline thing". In your example, this is a parameter for the dotnet program, and what I described above is true only because dotnet happens to later call into msbuild program. if you spot such -p//p parameter anywhere else, in any other application, then it may do something completely different.
Lastly, on Linux - yes, you can use it with dotnet toolset on Linux as well (net core, mono, etc) ((and I'd strongly suggest using -p: version)). However, same rules apply. As long as it is used with this app called dotnet, it will have the effect of setting environmentname during build. In any other case, or any other app, such parameter can have other meanings. It's all app-dependent, be it on Windows, or Linux.

How to save run configurations - Visual Studio Mac

I am developing an asp.net application on macOS with Visual Studio for Mac, and I can specify a custom run configuration.
There seems to be no way to specify a run profile, where all arguments and settings in the custom configuration are saved, instead of reentering command line arguments every time.
Is there a way to do this easily in VS for Mac? Or is that feature not available yet...
No, unfortunately you can't save it but there is workaround for this.
You get the args in the main, just change it to your configuration and put it to code when you need it.
string[] args = new[] {..}

VS 2012 RTM Intellisense Broken

This seems to be happening on a project-by-project basis. Currently I am working on an ASP.NET 4.5 Web Application Project. Intellisense was fine one day but not the next. I am using a custom project template but that should make no difference. I tried editing the text editor settings so that Auto list members and Parameter information are both checked. I tried to reset your Visual Studio settings (Tools --> Import and export settings --> Reset all settings) and I also tried the solution in the accepted answer here:
Intellisense not working
Has anyone got any insight or suggestions? Pending any answers, I've submitted a Connect bug report: https://connect.microsoft.com/VisualStudio/feedback/details/766891/intellisense-broken-in-vs-2012-rtm
You may be able to refresh Intellisense cache with Ctrl + Shift + R (on standard shortcut keys)
I've had the same issue on VS2010 and fixed it another method described at How to turn IntelliSense on in Visual Studio 2010?
From the link:
Delete the files in this folder: %AppData%\Roaming\Microsoft\VisualStudio\10.0\ReflectedSchemas (the 10.0 folder may be a different number for VS2012)
If nothing else works, you type this in the Visual Studio Command Prompt (this is in your Start menu) and hit enter: devenv /resetuserdata
This last option is documented here on MSDN, with the following disclaimer:
Disclaimer: you will lose all your environment settings and
customizations if you use this switch. It is for this reason that this
switch is not officially supported and Microsoft does not advertise
this switch to the public (you won't see this switch if you type
devenv.exe /? in the command prompt). You should only use this switch
as the last resort if you are experiencing an environment problem, and
make sure you back up your environment settings by exporting them
before using this switch.

postMessage not declared in this scope error when building nativeClient plugin

When I am trying to build the plugin module using .\scons it is raising me errors. What might cause these types of errors...? Error is
postMessage() was not declared in this scope.
I am using pepper_16 version. Here is the procee I did
Installed Python and gave the path required(Installed in D drive as I do not have privileges).
Downloaded nacl_sdk.zip extracted in the same folder where I have installed python and updated the tools with nacl_sdk.bat update
Enabled NativeClient form about:flags window and executed the server using httpd.py file.
And created project in Pepper_16/examples/TestApp using init_project.
Written the code as it is in the Getting started tutorial to test.
Then using ./scons in the same project folder in cmd mode I have tried to build
The above process worked fine for me where I have admin privileges. But the same procedure and same code not working where I do not have admin privileges.
Please let me know if any further details are required.
which source file was being compiled? a lengthier cut-n-paste of the output around the error message would help to give context.
also, when you say the plugin module, are you referring to NaCl itself or your own PPAPI plugin? normally NaCl's plugin is built into Chromium using gyp, and while scons can be used to build the NaCl plugin it is typically only used for testing, via the --register-pepper-plugin command line argument to chrome.

How to make a general profile for PHPUnit testing in WebIDE?

I'm playing a bit with beta version of PHP Storm (PHP version of WebIDE) and its integration of PHPUnit. I know how to set a profile to run tests in particular file, directory or class. Problem is, I'd like to create some profile where Run button would run tests in currently opened file.
Any idea if there's a way to do it? Or perhaps it isn't implemented in beta version yet?
Open a context run/debug menu via Ctrl-Alt-F9 (this depends on your OS, look at Run|Debug... menu item), then look at lines marked with 2 & 3 - they correspond to current file and test. Press number to invoke.
You can record a macro with Tools|Record Macro and add a shortcut via Settings|Keymap|Macros. Do not forget to make a Copy on default keymap before attempting a change.

Resources