I am writing a test documentation and would like to have headers that says TestFunction instead of void testfunction(); Is there a way to make this change in Doxygen?
Related
I'm attempting to produce a Message.yml file using Spigot's YAMLConfiguration.
This is my code:
public static void create() {
if(messagesFile.exists()) return;
try {
messagesFile.createNewFile();
messages.options().copyDefaults(true);
messages.addDefault("MESSAGES.PREFIX", "&c[YourServer] ");
messages.addDefault("MESSAGES.DESIGN", "§8§l- ");
messages.addDefault("MESSAGES.NOPERMS", "§c§lDazu hast du keine Rechte!");
messages.addDefault("MESSAGES.ADDMAP.USAGE", "§c§lBitte nutze /addmap [mapname]!");
messages.save(messagesFile);
} catch(Exception e) {
e.printStackTrace();
}
}
However, the config.yml file I received after running it read as follows:
MESSAGES:
PREFIX: '&c[YourServer] '
DESIGN: "\xa78\xa7l- "
NOPERMS: "\xa7c\xa7lDazu hast du keine Rechte!"
ADDMAP:
USAGE: "\xa7c\xa7lBitte nutze /addmap [mapname]!"
Is there any way to fix it?
It thinks the text is a string and not a standalone character.
https://www.spigotmc.org/threads/special-characters-in-config.298138/
Yeah u use special caracter to save the color but it's a String. Don't put your color here just save the String. When you want to resend the text from the config just put for example.
player.sendMessage(ChatColor.RED + config.get("MESSAGES.PREFIX"));
this is just an example
Like #Minecraft said in his answer, the issue is that Java is recognizing the § as a part of your string and translating it to unicode.
What I would do is have your custom config file stored in your plugin resources directory with all the default values you want it to have already defined.
Then when you want to use the custom message, get it from the config file using getConfig()'s returned value's methods. Then, if you want to support color codes, you should use message = ChatColor.translateAlternateColorCodes('&', yourMessage); or something along those lines. Should be plenty to get you going.
Also, be sure and use a unified symbol for these color codes (default is &), but you can set it in the aforementioned method translateAlternativeColorCodes(). You seem to be using & or §, I would stick to &.
Sources:
https://www.spigotmc.org/wiki/config-files/#using-custom-configurations
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/ChatColor.html#translateAlternateColorCodes(char,java.lang.String)
I am trying to generate documentation for some 'Error Codes' implemented in the code.
To start my work, I used the reference from:
Custom tags with Doxygen
Using the \xrefitem and ALIASES option, I did the following.
ALIASES = "error{1}=\ref ErrorCode-\1 \"ErrorCode-\1\" " \
"implement{1}=\xrefitem implement \"Implements ErrorCode\" \"ErrorCode Implementation\" \1" \
In the code I write the comment in FUNC1, for example:
#implement{#error{001}} Error Code 001
Using the above, I can generate a page where it shows the function name and which error codes are implemented in it.
Now, what I have is multiple sources of same Error Code in my project. So, in the documentation I would also like to have a page, where I can see the Error Code and where it is implemented (with links to the function).
What I have on page "ErrorCode Implementation":
FUNC1
Implements ErrorCode-001, ErrorCode-003
FUNC2
Implements ErrorCode-002
What I want on page "ErrorCode Tracing":
ErrorCode-001
Implemented in FUNC1, FUNC3
ErrorCode-002
Implemented in FUNC2
How can this be done in Doxygen?
I have implemented an SEditableText widget in my editor plugin but I can't figure out a reasonable way of accessing the value in the widget. I know there is an SEditableText.OnTextChanged() function but I don't see anyway to override it or set a callback of my own. Is there a standard way to save the content of an SEditableText to a variable?
I am working in the context of FModeToolKit, not sure if that makes a difference.
When you instantiate the slate widget, you should already be making a call to SNew. As part of the property initialiser chain list, initialise SEditableText::OnTextChanged and bind to your container UObject, using BIND_UOBJECT_DELEGATE. The delegate signature should be FOnTextChanged. Your handler will receive an FText which may be stored in a variable as required.
Example:
SEditableText EditableText = SNew(SEditableText)
.OnTextChanged(BIND_UOBJECT_DELEGATE(FOnTextChanged, OnTextChanged);
then:
void UMyUObject::HandleOnTextChanged(const FText& InText)
{
// Do something with text
}
Take a look at it in action in UEditableText::RebuildWidget (EditableText.cpp:50, v4.22.1).
NB. I know you specifically asked about OnTextChanged, but also consider OnTextComitted; this is only fired when the slate widget loses focus.
Ah; BIND_UOBJECT_DELEGATE is in UMG. The macro is however just a helper to create a UObject to which you may bind:
#define BIND_UOBJECT_DELEGATE(Type, Function) \
Type::CreateUObject( this, &ThisClass::Function )
So there's two options, either use <my type>::CreateUObject, or you could bind via a shared pointer. Off the top of my head, SP method should look something like:
Edit (based on comments):
If you're not linked against UMG, you could try manually creating the UObject based on the macro defined in SlateWrapperTypes in UMG:
#define BIND_UOBJECT_DELEGATE(Type, Function) \
Type::CreateUObject( this, &ThisClass::Function )
To instead use a shared pointer, the syntax should be along the following lines:
auto OnTextChangedSP = FOnTextChanged::CreateSP(this, &MyClass::MyOnTextChangedHandler);
SEditableText EditableText = SNew(SEditableText)
.OnTextChanged(OnTextChangedSP);
Is there a way how to use loops or conditionals when creating snippets in VS Code? I am trying to create a snippet that will generate a template for JSDoc documentation syntax for a function. Example (I am using coffeescript):
myFunction: (param1, param2): ->
# some code
return
And I would like a snippet that generates:
###*
* #param {} param1
* #param {} param2
* #return {}
###
myFunction: (param1, param2): ->
# some code
return
I am able to create a snippet, that will simply generate:
###*
* #return {}
###
using this snippet settings:
"JSDocs Template": {
"prefix": "jsdoc",
"body": [
"###*",
" * #return {}",
"###"
],
"description": "create template for JSDocs"
}
But to achieve want I need, I would have to use a loop to go through the param list and that is where I struggle...
I am not sure is that possible using snippets. You can achieve this by writing your own extension using VS Code API.
But you can use this extension
https://marketplace.visualstudio.com/items?itemName=stevencl.addDocComments
to achieve what you trying to achieve in your example.
Update:
You have to modify this extension script a little bit.
Go to C:\Users\%UserProfile%.vscode\extensions\stevencl.adddoccomments-0.0.8\out\
Add this additional logic in the 'extension.js' file.
Right now it only works for the ts and js file. Just added the coffeescript language type.
And it works!!!
Mark it right ans if you agree.
So after some research I found out that such a behaviour is not possible with snippets only, therefore I have create my own extension CoffeeScript JSDoc. Feel free to use it and extend it if necessary...
I am using helhum File Upload Demo to upload the images. But currently i got below error.
Exception while property mapping at property path "images.0":Property "name" was not found in target object of type "XXXX\XXXXX\Domain\Model\FileReference
Please help here.. How can i move forward.
Thanks in advace.
If you followed the example extension, you are maybe missing the registration of UploadedFileReferenceConverter and ObjectStorageConverter in your ext_localconf.php. Took me a day to find that one:
ext_localconf.php
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerTypeConverter('Vendor\\EXT\\Property\\TypeConverter\\UploadedFileReferenceConverter');
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerTypeConverter('Vendor\\EXT\\Property\\TypeConverter\\ObjectStorageConverter');
In the initializeUpdateAction (or initializeCreateAction) you have to use the name of the parameter in the updateAction (or createAction) as argument.
If your updateAction looks like this:
public function updateAction(\Classname $yourObject)
You have to call the helhum function with the argument:
$this->setTypeConverterConfigurationForImageUpload('yourObject');
As a small hint for later problems: In the setTypeConverterConfigurationForImageUpload function you should register your own file attributes if they are not named image and/or imageCollection.0 like in the example.