godotengine / godotengine/godot-cpp

Output parameters generated as `const` references

Open
#1,471 5 comments 1 reaction 0 assignees View on GitHub
breaks compat bug topic:gdextension
Dominant language
C++
Stars
2.7k
Forks
809
Avg merge
1d 3h
Merged PRs (30d)
8

Description

### Godot version

4.2-stable

### godot-cpp version

4.2-stable

### System information

Godot v4.2.1.stable - macOS 14.4.1 - Vulkan (Forward+) - integrated Apple M1 - Apple M1 (8 Threads)

### Issue description

The generated interface for both `EditorImportPlugin::_import` and `EditorResourcePreviewGenerator::_generate` have const-qualified parameters that are actually intended to be modified.

In the docs for `EditorImportPlugin::_import`, the `platform_variants` and `gen_files` parameters are suppose to be lists that can be used to inform the editor of additional files related to the import. Because they're const-qualified in the godot-cpp interface they can't be updated without a `const_cast`.

![image](https://github.com/godotengine/godot-cpp/assets/28452108/99381a06-4705-4caa-9bc5-c1aebb69d75c)

Same goes for `EditorResourcePreviewGenerator::_generate`'s `metadata ` parameter which is suppose to updated by the preview generator to provide any applicable metadata to `EditorResourceTooltipPlugin::_make_tooltip_for_path` for the editor tooltip.

![image](https://github.com/godotengine/godot-cpp/assets/28452108/e4ca8d0a-aab5-4d95-b7cd-2b7f4fc55881)

### Steps to reproduce

N/A

### Minimal reproduction project

N/A

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.