godotengine / godotengine/godot-cpp

SyntaxHighlighter cache use seems to not be possible

Open
#1,276 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
2.7k
Forks
809
Avg merge
1d 3h
Merged PRs (30d)
8

Description

### Godot version

4.1.2-stable

### godot-cpp version

4.1

### System information

Arch linux: 6.3.2-arch1-1

### Issue description

The current godot-cpp codegen generates the following definition for _get_line_syntax_highlighting
```cpp
virtual Dictionary _get_line_syntax_highlighting(int32_t line) const;
```

In the base engine it is
```cpp
virtual Dictionary _get_line_syntax_highlighting_impl(int p_line) { return Dictionary(); }
```

The issue I am running into is I am basing my SyntaxHighlighter implementation on the built in CodeHlighter. It caches color using a HashMap as a private member. But if _get_line_syntax_highlighting is const then we cannot modify the cache as we compute the color.

### Steps to reproduce

Generate the header files for the current 4.1 branch

### 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.