CSS property is red highlighted in github - github

The touch-action property in a SCSS file is red highlighted in Github diff. Any reason why?
Here is the DOM for it:

Github will highlight code like this if there is a syntax error. It's not 100% accurate, and it's not actually running your code.
Sometimes it will miss an error, other times it will highlight something that isn't an error. It is however still a handy feature.
I would imagine that as touch-action is not very well supported, the syntax checker that github use it not aware of it and thinks that it is not a valid property.
If the code works, I would just ignore it.

Related

How to hide these yellow warnings in VS Code?

I've found this once like 2 years ago and never again.
I have these waving yellow lines almost everywhere, saying "Return value of index() is expected to be of type blablabla", "Call to a member function controller() on a non-object of type blablabla", the code is literally built and works as it should, but VS Code just throws these warnings around for no reason but to give me a headache...
How am I supposed to completely hide those from my vs code and never see them ever again?
Sure, some actual errors (the red ones) are fine! But these yellow squiggly things that tell me "Oh this is not what you should return" when literally the documentation of Laravel says I do the correct thing?!!
I tried installing "error lens" extension but it just made them prettier.
Every single topic/tutorial I found on the internet are just making those disappear from the "PROBLEMS" tab, but from the actual files/from my face.
Edit #1: Oh yes, forgot that the colors might be different for everyone... Sorry! It looks like this and throws "warnings" like this: https://imgur.com/a/HhWnhI6
The snippet on the screen works well too.

Prevent Visual Studio Code auto-completing incorrectly whilst I type

I'm having an issue with VS Code autocomplete (intellisense?) that seems completely illogical, but I can't figure out how to disable it (partly because I've no idea what to actually search for this.)
My most recent example is illustrated in the screenshot below. I am typing out a media query #media (min-width: 768px)
I then follow this up with and to continue the query, yet VS Code has for some reason decided I must want to insert a random unrelated variable here. It doesn't even have the string and anywhere in the variable names suggested.
I am fine with suggestions - they are useful when I want. But the second I hit the space bar, it automatically replaces my text. It is replacing my text despite me doing nothing other than typing what I want to type.
So many times I have been caught out because my correctly typed code is being replaced without any interaction whatsoever on my part. How do I prevent this happening?
Thanks for any help.
Intellisense does not autocomplete on space, and this is not part of its default config either. Therefore this is either a bug (which could be the case), or a misconfiguration caused by an extension or changes to settings.json.
One solution for it would be to disable autocomplete on commit character altogether with "editor.acceptSuggestionOnCommitCharacter": false in settings.json. If "editor.acceptSuggestionOnEnter": "on" is left untouched, autocomplete will then only be triggered on tab/enter.

can I remove dimmed-colored properties in settings.json file in VSCode?

There are dimmed properties in my settings.json file. Are they dimmed because they are not being used? Can I safely remove them?
Answer:
Yes, it is safe to delete settings that have a dimmed-out color. Just to be sure you can check if you have the Git and Prettier extensions installed/uninstalled as it seems those extensions have dimmed-out settings.json file.
Reasoning:
Well in your case, and as #j D3V mentioned, you've disabled or uninstalled the git extension. This means that any settings related to or needed by the extension will be dimmed-out and are no longer required.
I was surfing the web and testing out stuff in my VSCode, and I found a setting in my settings.json file that too, was dimmed out:
The dimmed out setting is "color-highlight.markerType": "dot-before",. This is because I no longer have the extension that used this setting, the extension was named 'Color Highlight':
In the image above, you can see I no longer have the installed extension, however, I once did. Basically, the settings are dimmed-out because they were related to an extension you no longer have installed. Thus it is safe to delete them. If you keep the settings, that's perfectly fine too!
I seen this question when you first posted it, but something was odd.
So the Properties that are Dimmed, Should Be interpreted as "Unreachable by the Control-flow"
In other words, the are unnecessary, and VS Code cannot make use of them.
The editor can be configured to change how dim — or "how opaque" — the code that is "unnecessary" renders. Its a theme property that changes the dimness. I included the configuration to use in your settings.json file below.
NOTE: _The setting uses a base-16 color format, much like you often will see in CSS, or SVG, however, it must have an 8 or 4 digit hex-color as to properly set the transparency. If an eight digit number is used, the first 6 digits are ignored, if a 4 digit is used then the first 3 are ignored. Below is an example of a properly configured configuration for changing how dim "Unreachable Code" renders (aka "unnecessary code").
{
"workbench.colorCustomizations": {
"editorUnnecessaryCode.opacity": "#00000080"
}
}
Its Important to Know Why Code isn't Being Reached
These types of details should always be obvious, if not, something might be wrong, and it is worth investigating. When I first took a look at the image you included (of your settings.json file) I immediately noticed something was off. There were settings that were part of the core, fundamental features that are built-in to VS Code. The settings are contributed through "built-in extensions". The only way they could be dim, is if you disabled one or more built-in extension.
First Let me state, you should never disable VS Codes core extensions that are built-into the editor. If you do, you can't expect the official VS Code Docs to pertain to your editor, you can't expect that other questions on stack overflow will work as the authors intend for them to work, you will also loose many of the features and abilities that make VS Code such a powerful tool.
You should enable the built-in extensions that you disabled.

Enabling Auto-Complete for custom syntax in Sublime text

I cannot get Sublime auto complete to work properly for custom syntaxes. For example, this is what happens when the syntax is set to Javascript:
When the syntax is set to my custom syntax, these types of suggestions never show up. Custom snippets show up just fine, but variables found in the file do not show up properly. When I click [CTRL+SPACE], this is what I get:
For some reason, single characters will show up, but not whole words. For the syntax, I copied the Completion Rules.tmPreferences, Symbol List.tmPreferences, etc. directly from here so that all should be fine (although messing around with them didn't seem to do anything).
I have tried adding the syntax to auto_complete_selector in settings, but it does not work. I use the package All Autocomplete, and deleting this did not change anything.

Indentation issue after pushing code from Brackets Editor to Github

For my code I'm using Brackets. In editor, code looks proper but after pushing it to github repository, indentations are messed up.
I'm using tab key to make indentation but in preferences there is set "use 2 spaces" after pressing tab key.
I've find out that Github is using 8 spaces for recognised tab keys. But still, it does not give me anything.
The biggest problem is when I use "one var statement".
I've also used jsbeautifier and it doesn't help me at all.
Here you can find an example: My Github code example
Does anybody had such a problem with brackets and github indentations?
Yes I had such problems.
These problems did not reappear when we moved to eslint inside of our IDE. The setup varies for each IDE. You can refer https://eslint.org/docs/rules/indent
If setting eslint is hard for you. Try bracket extensions like https://github.com/brackets-beautify/brackets-beautify . When used correctly it will beautify on save. Caution: Dont beautify code written by others or a team.