Remove a file from the compile, mark it as text - android-studio

Today's Android Studio Tip of the Day...
You can exclude any file from your project. As a result, such a file will be ignored by indexing, inspection and code completion.
In the Project tool window, select the file you want to ignore, and choose Mark as plain text in its context menu.
If necessary, you can always return the file to its original type using the Mark as context menu command.
If this means View >> Tool Windows >> Project I could not find this useful functionality. Any pointers??

Yes, it's in View → Tool Windows → Project. But not every file has this option. XML-files do, Java-files do not. The option is right under "Delete...".

Related

How to add a command to context menus in Visual Studio 2019

I'm trying to add a command to the Document Tab context menu in Visual Studio 2019 so I can go directly to the open file in the Solution Explorer. I'm aware of File Tracking. I don't want to open the folder for every file tab I click on. I'm also aware of this extension but it seems like I have to click it two, sometimes three times before it will go to the file.
I found the relevant context menu under Customize -> Commands. It's "Other Context Menus | Easy MDI Document Window". The problem is that under "Add Command" you can only add from preselected lists of commands, and they don't make things easy to find.
I can see the command I want to add under Options -> Environment -> Keyboard. It's SolutionExplorer.SyncWithActiveDocument. But I don't see any way to use it in the Customize window, or if it's there I can't find it.
You can directly add commands to a menu only from the existing VS menus.
For additional commands, you can create an intermediate command with my Visual Commander extension DTE.ExecuteCommand("SolutionExplorer.SyncWithActiveDocumen") and then add this VCmd.Command01 command to the menu.

Make PyCharm recognize string as path

I am working with Python 3.4.
When I use IDLE and start typing, e.g.,
my_main_folder = "C:/Us"
in the editor window, and then press Ctrl + Space, IDLE offers me all subfolders of C:, and if I press Tab, the string is completed to "C:/Users".
That means that IDLE (or Python Shell) is able to recognize a string as a path.
How to make PyCharm (Community edition) do that?
Its not able in Community Edition Pycharm. But it can be done in Professional Edition Pycharm. I would suggest you to move to Professional Edition.
Does PyCharm have autocomplete file path?
BUT,There is a work around for it in Community Edition.
Place caret in such place and press Alt+Enter -- see if you will have "Inject language or reference" option in appeared menu. If it's present -- use it and choose "File Reference" there.
NOTE 1: this option may not be available if string is empty or has less than 2 characters in it
NOTE 2: this is temp injection -- AFAIK it will be lost after IDE restart (and you will need to do it again if needed)
Otherwise: select desired file in Project View panel and use "Copy Reference" -- it will copy a file path relative to the project root -- you may only need to add leading "/"...
https://intellij-support.jetbrains.com/hc/en-us/community/posts/206574619-Autocompleting-relative-paths
After searching I found this answer:
can we tab through paths, in the same way you can in the terminal?
No, it's not posible:(
I wrote a plugin for Komodo called AutoCode that allowed me to ALT+Click on files in the Project view, and it would automatically resolve the right path
You can use 'Copy reference' in file right-click menu to copy file path relative to project root to clipboard. But this action doesn't unfortunately take resource roots into account
However, you can use CNTRL-SPACE twice and it will present a list of paths and files, example:
For a detailed description of this information see here

Is there a way to use Sublime to show file previews in Windows Explorer for certain files?

I'd like to be able to preview all plain-text files in the Windows File Explorer Preview Pane. To illustrate, here's what sublime files currently look like:
As you can see, Context.sublime-menu is highlighted, but a preview doesn't appear. They're just plain-text files though - you can open them in Notepad. Is there a way to tell windows "Use notepad (or sublime) to view this type of file the preview pane"?
Thanks to #KeithHall's link - while it didn't work for me - got me started on a pretty long path to finally figuring this out. And finding a better solution than I thought existed.
In short, simply install the Delphi Preview Handler. Which pretty much gives you an IDE in the preview pane. It's pretty simple to use and just awesome.
After installation, if you click on a .js file in Windows File Explorer you can immediately see a different preview pane.
Registering Other Extensions
The Preview Handler doesn't compensate for all plain-text files unfortunately, so you're gonna have to manually add the sublime extensions and any other extensions in the Registry Editor.
Here's the bird's-eye view of this process:
Find the key/value that instructs Windows to use Delphi as the preview handler for .js files.
Copy the key/value
Apply that to each extension you want to preview.
Here's more in-depth instructions:
First, you need to find the ID of the Preview Handler, and its Default Value
win + rregedit > expand HKEY_CLASSES_ROOT
Find .js and expand it.
.js should have a subkey named shellex, expand that
You need to recreate this shellex key for each extension you want to add, so copy its contents:
shellex should have a sub-key named with a bunch of numbers, letters, and dashes, this is the ID of the preview pane (I think)
Right-Click that > Rename > Copy > Cancel
Open Sublime > Create a new file > Paste
Go back to the Registry Editor, Click that ID subkey, and a String value called (Default) should appear in the right side of the window.
Double-Click that
Copy > Cancel > Paste in sublime. This is the ID of the Preview Handler (I think).
At this point there should be 2 IDs in the sublime file.
Now You're ready to add these same values to other extensions.
Find the extension(s) you want to change. For me it was all the sublime file-types.
Right-click > New > Key > call it shellex
Go to sublime, copy the first value
Right-click shellex > New > Key > Paste
Go to sublime, copy the second value
Click the new key and make it's default value that 2nd id.
So it should look similar to this:
v .sublime-commands
| v shellex
| |- {823BD1D4-...
And in the right side of the window:
Name Type Data
(Default) REG_SZ {AD9955...
Sources:
This Answer by #rxantos pointed me in the direction of the Delphi Preview Handler.
I spent about an hour looking for this app but never found it.
This Answer by #tvj247 is perhaps a more simple solution, but my HKey structure didn't match his (I'm using Windows 10).
And as for fiddling with the Registry, that was trial, error, and comparing sublime extension keys to js, html and css.

Displaying .h associated with .m automatically in AppCode

Is there a feature in JetBrains AppCode allowing to display automatically the .h associated with the opened .m file (and the other way around).
The associated file would be displayed in a tab of a splitted window (Available through the AppCode menu "Window > Editor Tabs > Split Vertically").
I'm looking for a feature similar to Xcode "automatic counterparts" feature (see picture http://i.stack.imgur.com/tbH8r.png )
I don't think this is possible in an automatic way. But BTW: Xcode almost never displays what you need in the Assistant Editor.
Similar to Xcode, it's possible to switch between .h und .m files with a key command. Having switched, you might want to open e.g. .m file in a split editor (as you described it). Then simply switch back to the .h file in the original window - and there you are.
It takes some more time to get into AppCode. But it's worth it.

How can I programmatically save a Sublime Text 3 workspace (without a dialog box)?

I really want a way to switch programming contexts quickly without hunting for windows that I've left strewn about. What would be nice is a command line tool to let me switch between different patches that I might be working on, and automatically open the sublime text workspace that I had open the last time I was working on that patch. The issue is that in order for the tool to know about the workspaces associated with said patches, it either needs to be told about them explicitly, or it needs to be able to tell sublime to save the current workspace with a specific file path.
Sublime does have a save_workspace_as command, but it opens a saveAs dialog, which is not what I want, and I can't seem to find any documentation that suggests that save_workspace_as can take an argument.
Any ideas?

Resources