clang-format - omitting styles from a parent configuration style - code-formatting

A clang-format configuration style can inherit from another style using the BasedOnStyle option, and then override some of the options from that style.
For example, the predefined Google style sets AccessModifierOffset to -1, and I can override it in my style like this:
BasedOnStyle: Google
AccessModifierOffset: -2 # for example
But what if I wanted to remove that option altogether? Any specific value (even zero) will behave differently than no value at all.
Is there a way to "delete" a setting specified in a based-on style?
(I am aware that I can dump a style into a file and remove the line(s) in question but it's ugly).
Using clang-format 14.0.0.6 on a Mac.

Related

How to style notifications in Vaadin Flow

I would like to style notifications in Vaadin Flow (19+), in Java, exactly as shown here in typescript, by assigning a theme and not setting the color of the elements (as shown in the java example). Apart the fact that setting the color is troublesome (foreground, background...) and fragile (e.g. switching to dark mode), the Java example shows setting a CSS color, I would expect to be allowed to use Lumo color variables (e.g. --lumo-success-color). Is this possible? Can anybody show an example?
You can use the addThemeVariants() method to define the variant you want to use:
Notification notification = new Notification();
notification.addThemeVariants(NotificationVariant.LUMO_PRIMARY);
The Java examples have not been moved over to the new docs site yet, you can find them here https://vaadin.com/components/vaadin-notification/java-examples/theme-variants

Vuetify - Customizations

Vuetify allows us to change the default themes and presets by using a variables.scss/sass file in our project.
But I am unable to figure out how to change the font-style/font-weight (or any other global properties except the color) for the entire app, dynamically on the fly.
For Example:
We have a vue application running and the global font is currently set to Roboto,
What I want to do is provide a list of available fonts in a v-select and dynamically feed the selected value(suppose Raleway) in the variables.scss file or somehow trigger Vuetify to pick up the updated font-family (even other customizations), and change the default font to Raleway for the entire application.
I don't want to add classes everywhere. It won't be maintainable.
Any ideas on how can this be achieved?
Thanks in advance!
Changing the font app-wide is possible through the variables file as you mention, but this is a build-time decision. If you're wanting the user to swap out the font in the running app, there isn't any mechanism for this as far as I know, because the app is already compiled and running.

Removing Sublime syntax highlight for just '#apply'

I'm using Tailwindcss for my scss files which introduces a new command #apply. But the problem is Sublime highlights this (presumably as an error or unrecognized syntax). How do I just turn off that single highlight so it won't appear as a glaring error for all my #apply rules?
Syntax highlighting in Sublime is driven by syntax definitions that allow Sublime to recognize the language and highlight it as appropriate. This is done either in a tmLanguage (older TextMate compatible) XML PLIST file or a sublime-syntax (new form with more capabilities) JSON file.
Essentially the syntax definition boils down to a list of regular expression rules and a description of how and when to apply them in order to recognize the language. The syntax that you're using is for SCSS which doesn't recognize the #apply directive and thus marks it as invalid.
So there's no simple setting or toggle that you can make that will stop this from happening and you have to instead do one of three things:
Modify the syntax definition to know that #apply is valid so that it doesn't highlight as invalid code
Modify your color scheme to not use obnoxious colors for invalid code in SCSS files.
Use an alternate syntax that either knows about #apply or doesn't mark code as invalid with a specific scope
The first of these is not particularly straight forward because it requires knowledge of how the #apply syntax works and how to write and modify syntax definitions in Sublime.
The second option is fairly simple to pull off; basically you would add a color scheme rule that matches the scope source.css invalid.illegal and color it like plain text instead of the colors that your color scheme is using. However it's not possible to target this only to the #apply type lines, so you would lose being told about other invalid code that's actually invalid.
For the third option, there is the Syntax Highlighting for Sass package, which also includes a syntax definition for SCSS which doesn't have a problem with the #apply directive:
This package is much newer than the one you're currently using so you may see some things visually change colors from what you're used to seeing since this syntax may use different scopes than the old package does for the same constructs; the guidelines for what scopes to use have evolved a lot in the last couple of years, for example.
You may also want to peek at the README for the package as well, which outlines things that may require additional setup if you're coming from the older package.

How do I reliably style object layout in apache isis wicket viewer?

I have created a module by copying module-simple. I have everything working well. However, the layout does not follow the layout.xml specification - I did not change anything except to rename the file.
This is the SimpleObject view.
This is my ZiemObject view - only the name is changed.
When I remove the layout.xml and try to use #MemberOrder(name=..,sequence = .. ) I get nothing but the basic object view.
What am I doing wrong?
It isn't clear to me from your question, did you rename the layout file to ZiemObject.layout.xml ? I guess it must be because a layout is the only way to specify tabs. Could you paste a copy of it here?
Even better, perhaps you could upload your app to a github repo so we can take a deeper look?
UPDATE:
I downloaded the sample app from the github repo, and what's there works as expected...
the ZiemObject.layout.xml controls the member order of the ZiemObject, and because it is present the #MemberOrder annotation in that class are ignored
Also, the notes property is no longer shown as multi-line because that metadata is only provided in the .layout.xml file
if I rename the layout file, eg mv ZiemObject.layout.xml ZiemObject.layout.xml.MOVED then the default layout is honoured. In particular, the (framework-defined) id and version fields are no longer shown in tabs.
(Also, the notes is no longer shown as multi-line because that metadata is only provided in the .layout.xml file).
If I change the #MemberOrder#sequence attribute for the name and notes properties to "2" and "1" respectively, then the order of these fields is inverted, as shown below:
Hope that helps
Dan

Removing Doxygen code fragments/references

I'm using Doxygen for generating documentation in my programming projects. And while I find it quite easy to configure and use I can't seem to find a way to hide the source references it adds to the HTML output.
I'm using these two directives in the configuration file:
SOURCE_BROWSER = NO
VERBATIM_HEADERS = NO
But it only seems to hide the "Definition at line of file ."
What I want removed is what's in the red rectangle below:
Is there a directive to also hide the source code it references? (Other than doing the hack'ish thing and remove it with CSS or jQuery)
Make sure your setting on INLINE_SOURCES is set to NO.
Description from the manual - it looks like you have this YES
Setting the INLINE_SOURCES tag to YES will include the body of functions, classes and enums directly into the documentation.