Sublime Text 4 editing code, showing a procedure in a new view - sublimetext

Whilst editing some code (Python in my case), a local procedure name can be right-clicked and goto definition chosen. Is it possible to have the procedure displayed in a new view beside the current view?

This is the default behavior when using the LSP package, in conjunction with a Python-specific language server. I use LSP-pyright, which is the server Microsoft uses by default in VS Code, but LSP-pylsp is also a good option.
When you mouse over an identifier, whether it's a variable or a function, a small window (called a phantom) pops up with several links, the first one being "Definition". Click on that and a new view will open up with the source file containing the function's definition.

Related

Add menu item to windows context menu only for text selection

Someone know where can I add registry key for add some function to the right-click menu only when some text is selected?
Such as copy,paste,cut function
Thanks :)
As per the last comment by #zionpi and the specification by #Math1000 stating "Specifically looking to convert LaTex to plain text", I am assuming that the OP is looking to add an option in the context menu for all strings(or text) displayed(or presented) by all and any applications running in the system, which allows the user to, as per the original question, open that particular selected string in explorer if it is a valid path in the system or, as per the added specification, convert that particular selected string to plain text if it is a valid LaTex code (by copying the converted LaTex code to clipboard, perhaps?).
While the validation of the selected text (to check whether it is a valid directory or LaTex code) and implementation of the operation succeeding the validation can be feasibly implemented without any difficulty, the context menu option requiring to be available for "ALL" texts displayed by "ALL" applications in the system is impossible to implement. This is because there is no way to alter the context menus of individual 3rd party applications as their context menus are regulated and controlled by the application itself by the nature of their source code during development and would require APIs released by the concerned application developers themselves to facilitate this demand.
One infamous application that allows the implementation of such behaviors is Office, for which you can build add-ons to customize certain aspects of the application (whose tutorials can be found here and here (for .NET interoperability)) to implement said requirements.
While irrelevant to the original requirement, it is worth looking into the shortcut menu handlers of the shell extension development process here as it is a better and a much more elegant way of adding/implementing right-click context menus in comparison to the way mentioned in the OP's question i.e. by editing the registry.

Dynamically change About dialog text in RCP based application

Are is possible to dynamically change About dialog text in RCP based application? I want to replace aboutText value when About dialog opens by dynamically changing some part of it's text. Problem is that I has a client/server application, where information about client can be static, but server information (at least version string) may change independently and I don't know when it will happen. aboutText itself is static text. about.mapping approach also not work, because this file is packed into application JAR and because of this is read-only too. Are there is a possibility to subclass aboutText or update it in another way before About dialog show it? I not want to rewrite the all Eclipse About dialog class from scratch.
You can use system properties in about.mappings to achieve this:
Create an about.mappings file at the root of your app plugin
Add lines such as 0=$net.dnorth.about.text$
Reference {0} in the aboutText set in plugin.properties
Now call System.setProperty("net.dnorth.about.text", "your dynamic text here") in some code at start-up.
Reference: https://bugs.eclipse.org/bugs/show_bug.cgi?id=172692
The about text of the IDE is instance specific i.e if you are running a RCP application then at that time you cant change the About text.It is only possible if you update your RCP with via Check for updates link or if you install another IDE over the present one.
I these two cases only you can change your about text.

Create an application and attach it on right-click on a file

I want to make an application in C# VS12 preferably, and I want to attach it on right click menu passing the filepath as an argument, it would be great if I could do that on multiple selection too. How do I make that happen?
in the installer of your application you need to add a file extension association. (for development you can test that by registering the extension manually: right click, open with...). the file name that was clicked will be passed to your app as a command line argument (those are the args[] in the main method of you app).
multiple selection is a bit trickier but certainly doable. when your app starts you need to check if you have an instance of the app already running (using a mutex for example) and send a message to that instance with the file name you received.
If you have not worked with context menu handling, you should take a look at this tutorial.
For the file path handling, you could take a look at this image editing example.

How do I display a file or directory browser dialog using MATLAB

I have created a blank GUI and now I want to program a push button to display a file or directory browser dialog.
Your question could use a little more detail, but here's a general suggestion to get you started...
You could set the callback for your push button so that it invokes one of the built-in dialog boxes available in MATLAB. You may be most interested in UIGETDIR or UIGETFILE to browse for and select a directory or file, respectively.
In addition to gnovice's advice, if you want your directory browser to be embedded within your GUI (as opposed to opening in a separate dialog window), you can use Java component. Take a look at my UICOMPONENT utility on the File Exchange for a working example.
Alternately, you can design your own tree-view of folder contents within a matlab panel, using the documented yet unsupported UITREE function or a Java JTree component (take a look at my UIINSPECT or FINDJOBJ utilities for working examples).

Is it possible to replace the system open file dialog?

I want to replace the standard system open file dialog with the one I wrote, that means no matter within which programs you are opening a file, my dialog will be shown instead of the standard one, is this possible?
It seems that that there is no such API provided to accomplish this, is it possible to use some hooking technique, but this has to be reliable and not to be treated as spyware by anti-virus tools?
any other options?
If this is not possible, is it possible to add to the spacebar or toolbar in the standard open file dialog a button which invokes my dialog, which allow users select a file and in turn returns the path of the selected file to the "File name" input box of the standard dialog?
Any hits, links and code examples will be appreciated.
Starting in Vista, the FileOpen/FileSave dialogs are now "Common Item Dialogs" of which IFileOpenDialog & IFileSaveDialog are the two published implementations.
Since they're just COM objects with known CLSIDs you might get away with just replacing them by re-registering using their CLSIDs. Never tried something like that, might trip all sorts of alarm bells.
Pre-Vista file dialogs can be hooked in process, but I've never come across anything about global hooks or equivalent.
If you copy a file/folder to a dialog's filename field it usually pastes the full path anyway.
For example, if you have open both a program calling the standard open/save dialog box and also have a window open at the file or path that you want to work with (open from/save to), you can simply copy the file/folder from the explorer window, and then paste into the filename field of the dialog box, and it will insert the full path of the file/folder. No custom script is required!
Alternatively, for those programs that use custom dialog boxes where this step fails, copy the same file/folder in the window into the address bar of the same window (assuming it is visible). This will paste the full path, which you can copy again, and then paste this full path into the custom dialog box. I often use this when creating Office hyperlinks (Ctrl+K), because the Insert Hyperlink dialog does not work for the first method.
You can also use similar methods but paste into address bar fields and it works.

Resources