How to check built-in formatter/beautifier version? and does it auto-update? - visual-studio-code

Somebody from stackoverflow asked me to check if I have the latest js-beautify in my vscode. But I don't know how to check it. Can you please help?
I read from one of the threads in VS Code that it uses js-beautify as the formatter (it's the one doing the 'formatonsave' etc.). Please correct me if I'm wrong.
If it uses js-beautify, how do I know what version it is in? and does it auto-update to the latest version whenever there's a new one?
Thank you.
I already tried going through documentations and I also checked the preferences thoroughly, but I can't seem to find how to (manually) check for updates about plugins, especially the built-in ones like js-beautify.

The default setting for extensions.autoUpdate in VS Code enables auto-updating for all extensions. You can confirm this in your user settings or simply bring up the Command Palette (CTRL+SHIFT+P) and type 'auto update' to enable or disable it.
In the Command Palette you can also update extension mannually.
The current version of every installed extension is listed right next to its name in the extension panel or under the Changelog panel.

Related

What extension is causing my custom php snippets to get overwritten, and how can I fix this?

If this is due to an extension, how can I remove that extension?
It overwrites my custom snippet, which bothers me.
I disabled many extensions, but nothing changed.
What you're seeing in your screenshot (suggestions for dba_<etc.>) are not coming from any extension. One can verify that by running the command Developer: Reload With Extensions Disabled and trying triggering suggestions again. So this is just functionality that comes out-of-box with a standard VS Code installation. You don't even need to install any PHP extension to get this.
As for your custom snippets getting "overwritten", it's hard to tell without more detail why this is happening. If you're on version 1.75, it might just be due to a bug that will be fixed later (Ex. As was the case in this other recent Q&A: Visual Studio Code's recent update is disrupting autocompletion).
As #Mark showed in their answer, these are function suggestions. You can disable function suggestions with the following setting:
"[php]": {
"editor.suggest.showFunctions": false
}
Those icons indicate that those are Methods and Functions (not Snippets). See What do the Intellisense icons mean.
So you can try to disable two settings in your Settings UI:
Editor > Suggest: Show Methods
Editor > Suggest: Show Functions - this looks like the right one to disable
Of course, there might be situations where you want to see Function suggestions, so you will have to see if disabling the setting is acceptable.
You can disable those Function suggestions for php files only with this setting (in your settings.json):
"[php]": {
"editor.suggest.showFunctions": false
}

How I can save my layout on Visual Studio Code

The idea behind this question, is have my document upfront, right on the sidebar, a split between files and upload to GitHub, and down below the terminal, in all projects starting now, I open every time my projects! I saw different questions on the platform, but didn't accurate answer to that, I thought.
Thanks,
Miguel.
You should take a look at documentation which explains that in VS Code there are 2 modes for saving a setup of IDE - user settings and workspace settings.
Your modifications were probably saved in current workspace so when you open a fresh instance of VS Code by default you are using global user settings.
By default, it keeps the same screen.

Xcode 7.3 autocomplete is so frustrating

There is a new autocomplete in Xcode. Probably might be useful because it checks not only beginning of names etc. But I found that very often it doesn't find a class name or a const name at all etc. I need to type in entire name by myself. Over all I found it makes my life harder and coding more time consuming. Is there a way to switch to the old way it used to work?
Xcode 7.3.1
In Xcode > Preferences > Text Editing
uncheck Enable type-over completions
restart Xcode
It seems that clearing the checkbox "Enable type-over completions" in XCode -> Preferences -> Text Editing does the trick. At least in my case autocompletion fell back to a sort of old way, so it could autocomplete the class name that I had to type in manually before that.
This is by no means an adequate solution, BUT it has allowed me to (barely) maintain my sanity the past few days:
After every build, you need to trash your Derived Data folder. You can find this folder in Xcode > Preferences > Locations > Derived Data. Just trash the whole thing and it'll kick off a re-indexing step that should restore proper autocomplete functionality.
Unfortunately, I've found that once I build, the autocomplete behavior reverts to its broken state.
just open Xcode derived data folder and delete the folder
/Users/yourUserName/Library/Developer/Xcode/DerivedData
then restart Xcode, now autocompletion works like a charm
I have the impression that some 'parts' of autocompletion simply fail after a while. I use to restart the Mac to get it back working. But sometimes it fails quite soon again.
Maybe the answer of #Alex Bykov combined with a restart will do the trick.
Anyway: auto-completion of Xcode always was crap. AppCode used to get it much better. Unfortunately not yet with swift.
Closed Xcode, opened Xcode, let it index, it worked.
it doesn't find a class name
As a work-around, you can try to press
Command + Shift + K and Command + B
Several times,it works temporarily.
Xcode 7.3.1
I will share another posible reason, that after couple of days we found out. We have multiple schemes, and in one of them, the bridging header was importing a file that didn't exist anymore. So, it didn't break while compiling and running (the header belongs to another scheme) but it caused the autocompletion to break (couldn't find any objective-c class).
Hope it would help someone!
After having tried different methods:
Delete Derived Data
Switching Module Enabled off in Build Settings
Full Clean
Relaunch
Only this worked:
Find any commented out (/* abc */) code after #end in your files and delete.
Credit to Max_B:
https://forums.developer.apple.com/thread/7439
In my case, other projects were auto-completing correctly. If all your projects fail to correctly predict code, then it might be a different issue, and the other answers might work.
I ran into this issue while trying to make an OS X app and I was able to fix this issue by making sure that the Xcode 7.3 documentation and the OS X 10.11.4 documentation was actually downloaded. Doing this fully restored my autocomplete functionality. My full instructions are below as well as in my answer to a similar question: https://stackoverflow.com/a/39420664/3444925
I had this problem myself and after looking through all the other similar questions & answers about this, I couldn't find a solution. However, I finally found what worked for me.
Go to Xcode -> Preferences -> Components. There you will probably find a screen that looks like the following:
This shows that the documentation has not has not been downloaded and therefore, any attempts to re-index or re-build the application without downloading the documentation would prevent you from being able to use the autocompletion functionality.
Once I downloaded the Xcode 7.3 Documentation and the OSX 10.11.4 Documentation, this was enough for me to get the autocomplete functionality back (I was trying to build an OS X app, so feel free to download as much documentation as is relevant for you).
I didn't run into this until I created a couple of new class files. Other classes worked fine, but autocomplete would NOT work for anything in the new files...
FIX (for me) - I had to add those files to ALL of my targets, including the unit test targets even though I wasn't using them yet.

qgis preferences in a python plugin

I'm developing a qgis python plugin. This plugin changes the default UI windows displayed (which I've already managed to do) and creates a few new tabs and such. Recently, it was requested that I modify some of the options within qgis. These are what they want me to modify:
Under Settings -> Options -> CRS ... modify the preference to Always start new projects with this CRS. They want me to change that to a specific CRS. They also want me to change several settings under the general tab and the map tools tab.
I have no idea where these preferences live in the API and/or how I can change them. I don't think I need specifics, but if you could give me a general idea of where to look, it would be much appreciated. Thanks!
I figured out the answer here. This mailing list entry: http://lists.osgeo.org/pipermail/qgis-developer/2012-October/022627.html and this http://qt-project.org/doc/qt-5.0/qtcore/qsettings.html were helpful. I ended up going into the windows registry to figure out the names of the options (since that's where they're set when you use store QSettings natively in Windows. It was under HKEY_USERS/myid/Software/QuantumGIS. In there, I just experimented by turning things on and off to figure out what needed to be changed in the plugin. I did that like this.
settings = QSettings(QSettings.NativeFormat, QSettings.UserScope, 'QuantumGIS', 'QGis')
settings.setValue('/Projections/projectDefaultCrs', 'EPSG:2278')
Hope this helps someone else.

how modify the already installed content-assist?

First of, how can I see what plugin manages the CTRL + SPACE content-assist? And how can I modify it in other to add my own stuff. Any help/idea is gladly welcome.
Thanks.
I think you're looking for "Templates". Assuming you're using Java, this is in the Windows -> Preferences menu, then Java->Editor->Templates. For example, the screenshot below shows the CTRL-SPACE content assist when you type "sysout".
If i would have this task, I would go to preferences. Look for content assist settings. Write down some specific text you see in dialog box. Then go to plugins folder, and start to search inside archives. When match is present, open the plugin.xml of that plugin, and you will see the extension points of the plugin. Based on its name, I am pretty sure you will find the appropiate one. Then you can either google it, or look for plugins extending the extension point. Using JDGui or fetching source code of the extension example plugin will help you in disassembling. Eclipse usually not well documented as for extension points, so i do it this way.