VS Code - How to stop it deleting whitespaces? - html

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

Related

Prevent opening Visual Studio Code when click Show In Folder in Chrome

I've been googling and fighting this for a half a day already.
When I download something in Google Chrome I want to go to the folder with a file. But when I press 'Show in folder' a Visual Studio Code starts instead of my Thunar. How can I fix this?
Firefox opens folders ok but Chromium, Google-Chrome and Opera kicks of Visual Studio Code.
My system is Linux Mint Tara. I've already tried some things. Like added
[Default Applications]
inode/directory=Thunar.desktop
to /home/[user]/.config/mimeapps.list
Completely removed code.desktop from /usr/share/applications/mimeinfo.cache
Ran xdg-mime default Thunar.desktop inode/directory and the output of xdg-mime query default inode/directory is Thunar.desktop!!!
Even fully removed code.desktop from filesystem. Nothing worked!
Please help, this annoys me so much.
This is caused by MimeType=text/plain;inode/directory; which can be found in /usr/share/applications/code.desktop for what I can find.
What fixed it for me is changing this line to MimeType=text/plain; and removing code.desktop from /usr/share/applications/mimelist.cache
EDIT
A more permanent solution i've found is the following.
add inode/directory=org.gnome.Nautilus.desktop to the ~/.local/share/applications/mimeapps.list file.
After doing this make sure to the inode/directory entry is the same or not present at all in ~/.local/share/applications/mimelist.cache' and /usr/share/applications/mimelist.cache
org.gnome.Nautilus.desktop can be replaced by your preferred file explorer if you don't use Nautilus.
You might need to restart your desktop environment for the changes to apply.
The solution is simpler,
What happens is that the system orders the directory opening preferences.
Just go to the file manager > select a folder > right click > open with another application > select the file manager.
This will update the opening preferences for the directories.
Finally found! it. I had to delete
inode/directory; /usr/share/code/code --new-window %s; test=test -n "$DISPLAY"
line in the /etc/mailcap file. Bingo!
Chromium related browsers seems to not respect xdg settings on not full-fledged Desktop environments like i3wm which I use. Because the problem was not reproducible when I logged in with xfce4 session.

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.

HTML in Jenkins job descriptions

I have two Jenkins instances running. An old (legacy) one at version 1.614 and a new one with 1.633.
In the old one it is possible to use HTML in the job description (it even does syntax highlighting editing it). The new one doesn't. HTML content is escaped and shown as plain text. I could not find a change in the release notes explaining this behavior. Is there a configuration that I'm missing?
In the Global security menu:
Select this value to display HTML:
For enabling it via config: you have to install the configuration as code (CASC) plugin (https://plugins.jenkins.io/configuration-as-code/) , and add the following entries to your config file(s - I guess, it is better to have multiple files for a better overview):
markupFormatter:
rawHtml:
disableSyntaxHighLighting: false
If you don't need highlighting, change it to true

MODX: where are new_folder_permissions and new_file_permissions?

Those are asked during the installation, but are not anywhere in config files\tables to change afterwards
EDIT:
The changelog states the following:
[#MODX-760], [#MODX-1080], [#MODX-1528] Added setup option to set new_file_permissions and new_folder_permissions in welcome view
[#MODX-760], [#MODX-1528] Removed new_file_permissions and new_folder_permissions system settings from setup
Seems kinda weird to me to do that... I am still in need to change them, though.
It appears that these should be in your MODX System Settings although I wasn't able to locate them in any of my own MODX installs (all Revo 2.1+). There's a chance they might be redundant or are for some reason not being properly created during installation (in which case it might be an installer bug).
You might be able to override them by adding those settings, like so:
Key: new_folder_permissions
Value: 0755
Do that and then try creating a new folder using the File Manager. Let us know if the correct permissions are then being used. If so I'll look at opening up a bug report for the installer.
They are not in System Settings, as they default to the PHP umask values, as they should. If you want to override them, you can do so by adding the settings "new_file_permissions" or "new_folder_permissions" to your System Settings.
apache/webuser needs to write to:
core/cache
core/export
core/config/config.inc.php [change back after install]
core/packages
core/components
assets/components
EDIT Sorry, take a look here: core/model/modx/processors/system/filesys/folder/create.php
they appear to be hard coded in that file.

How to edit preference file for Notepad++?

My open source project uses spaces, not tabs, in its code.
A contributor to the project has his own website which uses tabs, not spaces.
He uses Notepad++ in Windows to edit files for both projects, and is frustrated when he forgets to manually set the Preferences correctly and thus inserts tabs into my project's files.
Is there a way to edit this Preference via a script? That way he could click one icon to start Notepad++ in mode 1 (running a batch script to modify the Preferences file and then start the program) or click another to start in mode 2.
Or if there's any other way to make him not have to remember this chore, that would work too. Maybe having a Preferences setting that depends on what folder the edited file is inside of?
Any help would be appreciated. Thanks!
The notepad++ setting for replacing tabs with spaces is stored in following xml file
%USERPROFILE%\Application Data\Notepad++\config.xml
The following is the line that needs to be changed
<GUIConfig name="TabSetting" size="4" replaceBySpace="yes" />
Now I don't know how we can edit a file by batch script in windows, but if it is not possible, then he can keep two config files config-tabs.xml and config-spaces.xml. And in the script you can copy appropriate file depending on what he needs to work on.