How to index file names only in certain directory in IntelliJ? - intellij-idea

I usually exclude cache and log directories from indexing in my projects but sometimes I want to quickly navigate to a log file.
Is there a way to keep log contents excluded from indexing but make it show up in "Navigate to file" popup?

Related

PhpStorm Search Everywhere is not working, do you know the solution?

I don't know this is off topic or not, I'm using general channels. Is there a solution for Search Anywhere in PhpStorm. I work with Laravel but when I use the feature I can't find the file even though it exists.
Looking at your screenshot: based on the fact that ALL files in the project tree have that sort of "dirty yellow" background color... it looks like ALL of your files are considered excluded / outside of the project for some reason.
Most likely a user error of some kind. E.g. you may have opened it from a different path (i.e. when symlink is involved), may have c=misconfigured it later somehow (marked folder as Excluded by mistake or whatnot) or maybe even some sort of config file corruption (pretty unlikely).
Anyway, please do this:
Close your project
Go to the project root folder and delete your .idea subfolder (that's where your project settings are stored).
If you have that project still visible in the IDE (Recent Projects on the Welcome screen) -- you may remove it there as well (to avoid any possible confusion).
Now create a new project in PhpStorm from scratch using existing files: just use "Open" and point to the folder with your project.
Please check filter option. If you are doing file search then click on Files tab.

How to navigate to file in WebStorm if file belongs to excluded folder?

I've excluded vendor folder from indexing.
I can navigate to file if it outside of vendor folder with Ctrl + Shift + N but if a file inside the one WebStorm can't find it.
You can try to do an "All" search with double shift. It should appear there if you have ever visited the file. If you haven't opened the file, most probably it will not appear there.
The reason for excluding files from indexing is mainly the good performance and marking directories that contain for example build artifacts or libraries to not add noise to your search results. That's why you will not see them.

I want to copy the file in sandbox without NSOpenPanel

I want to copy some files to specified folder by NSOpemPanel.
The source file is reading from XML and show to list in NSTable.
I can copy file by copyItemAtPath.
But now my app will turn to sandbox, then I can’t copy the file by copyItemAtURL.
How do I copy the file in sandbox mode?
I was looked over a lot of post. And I think the Security-scoped Bookmark may be a solution for this.
But I can’t create "Security-scoped Bookmark" from XML inside the path (the path was convert to NSURL ready).
I was setting to sandbox.entitlements but it's not clear this problem.
Is there any way for this?
Develop in macOS10.12 and Xcode8.3.3
Thanks
How do I copy the file in sandbox mode?
It is unclear what your current code is doing, but the rules under the sandbox are simple: To read or write a file located outside of an application's own container (which is hidden away under the Library folder) your application must either:
Use NSOpenPanel to obtain a URL from the user for the file path; or
Use NSOpenPanel to obtain a URL from the user for one of the ancestor folders of the file.
The second option gives access to a whole folder, including any sub-folders; i.e. the whole file/folder subtree rooted in the folder.
As you want to copy "some files" it sounds like asking the user for permission for the folder is appropriate. You can customise the NSOpenPanel to be a "request permission" dialog. If you are requesting a specific folder you can also have the dialog open in it's containing folder and only have the specific folder enabled for selection by the user.
Once you have the URL for the folder from NSOpenPanel you can create a security scoped bookmark for it and save that in your app's preferences or other configuration file (stored within the app's container). Doing this enables your app to regain access to the folder on subsequent executions without asking the user again.
If after investigating this issue and writing some code you hit an issue ask a new question, showing your code, and explaining the problem. Someone will undoubtedly help you with the next step.
HTH

Problems overwriting file in application folder

I have a file called PolicyLookup.sql that sits in my application's root folder. My app loads this file into a text box, so that users can edit it and overwrite the original file by pressing a save button. This all worked perfectly during test, however after deployment users are unable to save the file due to write issues within C:\Program Files.
Is there a way around this - or is there a better way to implement this type of thing? One solution that springs to mind for me is placing the contents of the PolicyLookup.sql file within a User Setting - however it intrinsically feels wrong to me to put the entire contents of a file within a settings variable.
Ordinary users do not have write permissions on %ProgramFiles%. If you need to save a configuration file then put it in a subfolder of %APPDATA% (which for me is C:\Users\Gord\AppData\Roaming) or some other place where a regular user is allowed to write.

Hide files from /build directory in navigate class/file action

One of the most productive actions in Android Studio is Navigate action. The problem is it shows so much useless files. Sometimes it's hard to find the class/file you're looking for.
Take below image as an example. If you're looking for AndroidManifest.xml in module b you have to scroll down the list to find the file you want.
Is there a way to filter what this dialog shows, in particular exclude some directories from results? All of the files from the /build directory are completely useless.
I know that I can filter what types of files are shown but it doesn't help much.
Mark your build folder as excluded:
File > Project Settings > Modules > Sources > Mark as Excluded (red icon)
Alternatively, right click on your build folder and select Mark Directory as > Excluded.
Excluded folders (shown as rootExcluded) are ones that IntelliJ IDEA "partially ignores". Very limited coding assistance is provided for files in excluded folders. Classes contained in excluded folders don't appear in code completion suggestion lists, references to such classes are shown in the editor as unresolved. When searching, IntelliJ IDEA doesn't look in excluded folders, etc.
Source
Another way is to define a custom scope as described here.