VSCode not recognizing all .clang-format options - visual-studio-code

I'm the kind of person who would systematically go through every single option available to toggle, and this time it's with clang-format in VSCode. I found this, which I'm assuming lists every single thing available to cram into a .clang-format file for VSCode to use. Unfortunately, VSCode seems to not recognize a handful of them:
BitFieldColonSpacing
BreakBeforeConceptDeclarations
EmptyLineBeforeAccessModifier
IndentAccessModifier
IndentRequires
SortIncludes
SpaceAroundPointerQualifiers
SpaceBeforeCaseColon
Out of the handful of options that VSCode fails to load, only SortIncludes is recognized at all, but it only accepts a bool, not the options that the reference says are available. The rest of the options are outright not recognized:
YAML:xxx:xxx: error: unknown key 'xxx'
Error reading /path/to/.clang-format: Invalid argument
Could I be missing something, or does VSCode not support those options? I'm using the C/C++ extension by Microsoft, using VSCode on Linux.
Thank you for your time.

Quickish answer: This is not a bug. At least some of those options (IndentAccessModifiers) are still in the "Work In Progress" clang 13. You would need to (download and) replace the underlying clang-format binary in order to use these new features.
For whatever reason, the clang-format page describing the various options defaults to showing you everything in version 13, but does not actually warn you that these are not official release versions. Nor does it at least tell you what version a feature was introduced. It's not until you do a little digging that you find out that the main documentation page is not what you want. The most recent VSCode uses version 11.1.0, and you can find the matching options here: ClangFormatStyleOptions version 11.1.0
FUTURE NOTE: This answer mostly only applies today May 27, 2021. This may not apply 6 years down the line and VS Code is now at version 22 of clang. That said, you may find this useful if you come across this same type of issue in version discrepancy.

Related

VSCode SCSS extension with better error checking

I recently started writing SCSS in VSCode. VSCode itself along with vscode-scss extension provides relatively good support for SCSS, but an important feature seems missing - error checking.
Though VSCode and vscode-scss can offer suggestions through Intellisense based on scanning, no errors will be prompted if I misspelled a variable, or used a mixin that hadn't been imported yet. Also, no auto refactoring takes place after renaming an SCSS file that has been used by other sources.
Is there any VSCode extension that provides such validations? Or maybe they can be turned on through some options in extension settings?
Note: I do have noticed the scss.showErrors option of vscode-scss, but no errors get prompted in scenarios mentioned above after turning this option on.

How to make VSCode's python debugger skip stepping into some modules when debugging

In vscode's python (ms-python) extension, is there a way to make the debugger (debugpy) not to step-into functions defined in specific modules. I have found justMyCode but it will skip entering into external modules only (like members of stdlib) while I need to skip my own modules sometimes.
I saw some debug adaptors for some other languages implement skipFiles property. Is there anything similar for python?
Going thru debugpy code I found this undocumented feature which works like a charm: in launch.json's debug configuration add
"rules" : [{"module":"*xxx*", "include":false}]. Make sure the xxx is the full module name like a.b.module
There are more working options. They can be seen here
A word of warning. This feature is undocumented (at least I did not find it anywhere) so use with caution as it might disappear one day. At the other hand, this feature is properly tested as part of the code uni-testing (as you can see from the link)

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

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.

Test for compatibility in Matlab

I'm working with an open source Matlab toolbox which, according to its creators, is compatible for versions of Matlab over 7.6, i.e., R2008a. I tried to run it in R2011b and it threw the exception: Undefined variable "Simulink" or class "Simulink.Mask.create"
Since:
1- Simulink is installed and functional in this R2011b;
2- I have already run the same code in a R2014b successfully;
I conclude that this is a problem of compatibility -In contrast to their claim, their code is compatible for some version later than R2011b-.
I wish I could contribute with them by directly telling them, not only that their code is not compatible with Matlab 7.6, but also the earliest version in which the statement associated with Simulink.Mask.create would run.
So, in precise terms, MY QUESTION IS: Given a command, built-in function, namespace resolution sequence, or whatever feature that I can find in some version of Matlab, what is the way of knowing what is the earliest version in which that feature is active?
I have tried http://www.mathworks.com/help/simulink/release-notes.html which is not searchable or navigable the way I wish it was.
This is a common problem. This page talks of the same problem - claiming that there is no good solution... It does however come with a smart way of searching through the release notes:
Click on the bottommost unexpanded release, to expand the it.
Click on "expand all" all link to expand all link just below.
If any unexpanded releases remain goto 1.
Now use the browser search functionality (often ctrl+f) to search the fully expanded page.
Good luck!
EDIT:
To see older releases too you need to start with the following step:
0: Click the link in the bottom saying "View release notes for older releases".
And then continue like above.
I don't think there is a straightforward way to find what you want.
In my opinion you have to do it manually for each version of MATLAB
in order to find is certain feature supported or not.
Some feature may be obsolete or may exist a bug.
So the best way to do is :
A) Look at particular version of relase notes, for example ,let say R2011a
New Features, Bug Fixes, Compatibility Considerations
click on "expand all", then use find "your keyword" in your browser
( be careful about case sensitivity)
You also have "Compatibility Summary", search it, too.
B) If something is very important and you are sure there is an issue
just email to customer service and ask for further steps
and who may contact further.

How to overwrite pypi package when doing upload from command line?

I want to automate the upload process bug in some cases the python setup.py upload fails because pypi server already have the save version uploaded.
How can I force it to upload, from the script (i know I can remove the old variant using the web interface).
A late answer, but: it seems everybody agrees you can't overwrite existing pypi uploads, or re-upload a fixed version after you delete a broken version. However, it seems actually possible and officially supported: "build numbers" are a feature that nobody has ever used or remembers they exist, but that seems to work, at least for me.
The trick is to rename the files in the following pattern:
mypackage-0.31.0-py2.py3-none-any.whl
mypackage-0.31.0-1-py2.py3-none-any.whl
mypackage-0.31.0-2-py2.py3-none-any.whl
The "-1" or "-2" are build numbers. If pip finds all these files for the same release, it will pick the one with the highest build number. It also seems to work if it finds only a single file with a non-zero build number, so you can use that after you deleted the original.
(This is very quickly mentioned in the documentation at https://www.python.org/dev/peps/pep-0427/#file-name-convention but I wouldn't have guessed its use without Daniel Holth pointing it out to me. Thanks Daniel!)
I have no idea why the internet contains so many people convinced it can't be done. I myself only learned about it yesterday and thought I should try to pass on that information.
Insert here the usual warning about not to abuse that feature. A typical example for when I think you should use this is after one of the wheels was badly built and you need to replace it with a correctly-built wheel from the same sources
Here's an actual answer, not just me adding more pontification in the comments. Found this thread:
https://www.reddit.com/r/Python/comments/35xr2q/howto_overwrite_package_when_reupload_to_pypi/
That refers to this:
http://comments.gmane.org/gmane.comp.python.distutils.devel/22739
Saying it can't be done.
Also note the comment in the reddit thread about reading semver.org and incrementing the micro version for patches.