Why does the syntax color code of Visual Studio Code act weird on me? - layout

I am using Visual Studio Code 2022:
Information on my VS code version
Up until now, I have had the colors appearing correctly in the default theme of VS code Dark+ (default dark).
I am currently using it for unity, so for C#, but sometimes use it for HTML CSS.
Those are the extensions that I have currently installed:
List of Extensions
I just noticed recently that right after clicking on a different .CS file, the color code doesn't work anymore. I can't figure out why, but it's super annoying. Classes used to be green, and their names used to be blue. Now, they are All blue.
Here is what it looks like when things are working fine:
Working Fine
And this is what it looks like as soon as I click on another .CS file in the file explorer:
Not Working
The only way to get my colors back, is to close VS code and re-open it.. but it's useless because I am eventually going to select a different .CS file in the explorer, and the problem arises again.
I have been coding for only 4 months, so forgive me if this is actually something simple, but I could not find the exact same issue somewhere else.
Thank you!

Related

How to set up the correct 'View' for VBA Project in Microsoft Excel?

Not sure if this is the correct place to post this but this issue is driving me insane....
The Issue:
I have come to use my PC after the weekend and for some reason the layout of the VBA Project stuff is completely messed up...
Usually when my VBA is set up very nicely in what I believe is the standard viewing mode IE the Project box to the left and the code to right and the intermediate window at the bottom...
For some reason now I get the following:
As you can see it is just the code...
I then click on the project explorer window and the project details appear, but as one ridiculously large page....
Then I minimise the window and alter its shape to try and get it at least look like it used to...
I can live with this to an extent although everything is floating and annoying... But now, every time I click onto a module (to view the code). It opens each module as its own seperate window!
This as you can imagine is unsustainable when working with as lot of code and having to flick between different modules
What I have Tried:
I have tried looking in different settings and I can not see anything different...
I have restarted my PC and it is still the same...
I have tired opening a different spreadsheet and still the same....
Does anyone have any suggestions? I just want it to be back to the simple layout of everything joined together etc...

visual layout editor does not allow drag&drop

I'am a newby in android studio and learning a lot, but now have a problem where i cannot seem to find the answer to.
In android studio you can visualy drag&drop your screen.
I have seen it can do al lot (although you sometimes need the xml) but for me it is not working at all.
I mean i cannot drag&drop any widgets on the screen at all.
Tried changing the theme: no help (really tried a lot of them)
Tried a complete new project: same story
Tried other APK verion: same story
Tried Invalidatd caches / restart: no help
Even with a new project (EmptyActivity) it add's a android.support.v4.widget.NestedScrollView and then gives error's on that
(Failed to find style 'coordinatorLayoutStyle' in current theme).
It also gives an error on layout_height/layout_with not being there. But they are there for each widget.
Please do not missunderstand: when i execute the project i runs just fine (both on phone and emulator) but the visual builder for the screen.....:-(
Does somebody knows how to solve this.
If more info is needed please ask.
Any help is more than welcome.
There are several things that could be causing this:
Your caches could be messed up. Try going to
File > Invalidate Caches / Restart ... (I know that you already tried this, but posting for future views.)
Also, make sure that you don't have Drag-n-Drop with ALT pressed only checked in your Settings (Appearance & Behavior - Appearance).
Finally, in a default project created in Android Studio, there are two XML files created for each layout. For example, content_main.xml is embedded within activity_main.xml. Make sure that you are using content_main.xml for your design work.
In the end i fixed it by changing the SDK version in de gradle file.
still do not understand why it was wrong as studio genereded it that way but now it works so.... for me: case closed.

Android Studio 3.1.2 0 - no longer see errors in all files (red underlined)

I feel like I'm going crazy, but since updating to the new version of Android Studio, I can no longer tell which files have errors in them.
Previously, if I made a change in one class, like to a method signature, then all other classes that were calling that method would suddenly be highlighted in red (at that section along the top that shows the path). Now it shows nothing as though my code is good, except when I go to compile, I now get a load of errors in the build tab at the bottom, in a really unhelpful way to navigate through.
Is this something I can switch back to through a setting somewhere? I'm really not sure what to search for, but I've been through almost all of them.
UPDATE :
Following another SO post, I turned on and off PowerSave mode, at the bottom of File menu (in Android Studio). This, temporarily at least, seems to have solved things.
This may be what you are looking for?
Either that or it may be in preferences.

Content_Main and Activity_Main in Android Studio 1.4: If I put a button in activity_main, but not content_main, will the java file know about it?

I'm a beginner to android but have done a little with an older version of Android Studio, and in the new version I'm having a lot of trouble getting the java file to find buttons or ImageViews. I'm not sure if it's related to the content_main vs activity_main thing. I'm having trouble finding any answers as to how this works on Google, so I'm just starting here, I want to put a button on the main page of my app and have the java file that correlates to the XML file find it. How do I do this?
Answers online are very vague to me, things like "activity_main.xml will determine how the look of the main activity should be. And on the other hand content_main.xml will determine the contents in the activity_main.xml" does not mean anything to me. Please tell me where to put the button!
If you are adding a button in activity_main rather than content_main it cannot be recognized by your Java file. Not only that is will even not be visible on your app.

Syntax highlight fail on Classes in Visual Studio 2012

I recently installed Visual Studio on a laptop and the syntax highlight fails to change Classes colors.
I tried exporting and importing the full, complete set of settings and it is still looking like that.
EDIT
I tried those websites with schemes and decided to try one, the Humane scheme, and this is how the sample code looks in my laptop after installing those settings:
However, this is how it is supposed to look:
Note the lack of highlight in class names.
What could it be causing this?
I'm starting to think that's another setting at another place which causes this.
Finally, it worked by resetting user data, running this from the Visual Studio Command Prompt
devenv /Resetuserdata
Found the hint here:
https://stackoverflow.com/a/11988265/1213246
Changin syntax highlight could be done through the menu Tools - Options - Environment - Font & Colors. It's a try and test approach that is not much improved from earlier versions of Visual Studio.
Fortunately, today there are entire sites with themes that simply need to be choosen and installed
I suggest you to visit http://studiostyl.es/ where you can find thousands themes or, for more generic go to http://www.hanselman.com/blog/VisualStudioProgrammerThemesGallery.aspx

Resources