WebStorm/PhpStorm: files missing from project view - phpstorm

I'm working in PhpStorm 2017.3 but this probably applies to many IDEA IDEs. A while back (on an earlier version) I made a change to project settings that hid .spec.ts files from the project view. I'd like to undo it but I can't figure out what it was.
Here are files in a folder as they appear in the IDE:
Here is the same folder in my OS file explorer. Notice all the spec.ts files:
I thought maybe the setting had to do with Scopes after reading LazyOne's answer here. However I have no scope defined in this project:
I also thought that perhaps I had added these files to the list of excluded files in Settings > Directories but turns out this list has a couple of irrelevant directories but no specific file:
What did I do to hide these files and how can I undo it?

The setting in question had to do with Settings > Editor > File Types pane. See the Ignore files and folders section of this doc page
I had added *.spec.ts to my list, causing the IDE to pretend those files don't exist at all.

Related

PhpStorm set all files / folders to brown background and weird structure

So I just noticed that my PhpStorm has set a background color to my project and also the structure is weird. All best explained by some screenshots.
This is how it is looking now, I cannot even see my App folder etc here:
After I click on Project in the top and then select Project Files, I can see my structure again like normal:
My question is, what does this mean and how can I set it "back to normal"? As for me, "normal" means the following:
I can see all my files in Project and also there is no brown background color.
What I have done so far, as suggested from Google searches, is:
Close the project, remove it from recent projects and opening it again in PhpStorm.
Removing the .idea folder and opening my project again.
Reload All From Disk.
Invalidate Caches.
P.S. This is a new Laravel project, with only some minor changes and all files added to git, and also just did one last commit. Nothing "fixes" this.
This "yellowish" background means that the IDE treats those files/folders as excluded or not part of the project (i.e. outside of the project). This can be caused by some broken/out-of-sync project config file (for whatever reason, e.g. when making a project and there is incomplete .idea folder already / merge conflict etc).
Deleting .idea subfolder while IDE is closed and then reopening the project is enough to fix it (use "Open" and point to the project root folder and PhpStorm will make a new project from existing files).
Related forum thread/tickets:
https://intellij-support.jetbrains.com/hc/en-us/community/posts/4404912351506/comments/4404921897746
https://youtrack.jetbrains.com/issue/IDEA-271728
https://youtrack.jetbrains.com/issue/IDEA-296960

VS Code - How to stop it deleting whitespaces?

I am using Microsoft's VS Code to edit css, html and ts files that are shared by my team on a VSTS Git repo. However, my VS Code keeps removing empty/whitespaces that my colleagues added when I save any change (Image below) and this screws up the whole Git Diff part, as almost every single line of code shows as a diff.
I tried to disable every single config setup but nothings works:
At the end, what was causing my problem was the extension: EditorConfig for VS Code
This plugin attempts to override user/workspace settings with settings
found in .editorconfig files. No additional or vscode-specific files
are required. As with any EditorConfig plugin, if root=true is not
specified, EditorConfig will continue to look for an .editorconfig
file outside of the project.
I believe, it was overriding the options I selected inside of VS Code (such as files.trimTrailingWhitespace: false). So, no setup change I was making was actually being applied.
It seems you have trailing whitespace enabled in User Preferences too.
I'd suggest opening your configuration file of VSCode using
CtrlShiftP or
CmdShiftP in Mac and then go to Open User Settings.
I'm sure the next line is around there somewhere, delete it or change it to false.
files.trimTrailingWhitespace": true
In my case, the JS-CSS-HTML Formatter extension from lonefy
caused the problem.
Editor › Comments: Ignore Empty Lines
——>choose :false

PhpStorm groups SCSS/CSS files ignoring my configuration

I am running PhpStorm 2016.3.2 (I believe it is the current latest).
Since I've updated to this version, css files are always grouped / nested under their scss source files in the project tree, regardless if I have a SCSS watcher or not.
I've tried creating a completely empty new project, with no file watchers whatsoever, and manually created two files: test.scss and test.css. Immediately, the test.css got grouped under the test.scss.
Furthermore (in another project), I am using a custom transpiler, which creates a x.html file for each x.scss file in addition to the x.css file. However, no matter what I set in the Output paths to refresh field, PhpStorm will always group the CSS file, and only the CSS file under the SCSS node.
I am trying to make it also group the HTML file under that node, but ideally I want to know why is it doing any grouping at all when there are no file watchers?
I do want to point out that this was NOT an issue in the previous version.
Is there some hidden setting I am missing, is it a bug or is it a mandatory new "feature"?
Is there some hidden setting I am missing,
No.
is it a bug or is it a mandatory new "feature"?
It's a new feature -- file nesting no longer relies on presence of File Watcher (and the need to run it to have files actually nested).
At the moment it's implemented as hard-coded list of rules which you cannot modify (but you may try and suggest other rules and why they will be good).
UPDATE: The list of nesting rules is fully customizable since 2017.2 version. You can access those rules via cog icon in Project View panel where you may add your own or even disable such nesting.

Files not under caret on new computer

I opened my project on another computer, and the files where I'd been using a file watcher were expanded, like before they used to be nested like home.scss is now after I run the watcher once on that file.
Is there a way to automatically make all the files be nested?
Because when adding new files and folder with git, it would be quite troublesome to go into each and every file in order to make them become nested.
Like I have some minified JavaScript files that used to be nested, but now is expanded for some reason.
Hope you understand. Thank you.
Edit: Nested***
Is there a way to automatically make all the files go under a caret like that?
Unfortunately not. Such nesting information (to "go under a caret" as you are saying) is taken from "Output path to refresh" field of the corresponding File Watcher.
You have to run file watcher for such files at least once in order to see files nested like you have it on your another computer.
Here is how you can run File Watchers manually without the need to modify those files (so no extra history will appear in your git (or whatever VCS you may be using there)).
https://stackoverflow.com/a/20012655/783119
P.S.
In PhpStorm 2016.3 (the next version that will be released in 1.5-2 months or so) such nesting will be done automatically (the most common combinations) so there will be no need to have File Watchers for providing such info.
If you wish -- you can try EAP build right now (EAP means Early Access Program .. which is sort of Alpha/Beta builds (simply speaking).. and therefore some bugs for new functionality might be present and performance may not be optimal).

Exclude some folders from module declaration suggestions in PhpStorm

When I try to click on some function in PhpStorm with a CRTL button the system tries to bring me to a definition of this function. Sometimes there are multiple definitions and the annoying page shows up telling to chose to which definition you want to go. Like here:
Because I am using grunt and minifing / concatenating results, the definitions is in multiple places. I know that I should ignore everything in node_modules, but the system does not. Is there a way for me to exclude some of the folders?
If you don't need any completion/navigation/etc. from your local node_modules, you can exclude this folder from your project:
right-click, Mark directory as/Excluded
You will still be able to run Grunt, but files in these folders won't be indexed and thus suggested for completion/navigation