Skip to content

perf(codegen): wrap generated context in a fn - #14457

Merged
Legend-Master merged 2 commits into
tauri-apps:devfrom
Legend-Master:wrap-generate-context
Nov 13, 2025
Merged

perf(codegen): wrap generated context in a fn#14457
Legend-Master merged 2 commits into
tauri-apps:devfrom
Legend-Master:wrap-generate-context

Conversation

@Legend-Master

Copy link
Copy Markdown
Contributor

Wrap the generated context code in a function to make rust analyzer faster, this is probably a hack but it works 😂

Before:

before.mp4

After:

after.mp4

@Legend-Master
Legend-Master requested a review from a team as a code owner November 13, 2025 03:13
@github-actions

github-actions Bot commented Nov 13, 2025

Copy link
Copy Markdown
Contributor

Package Changes Through a1bf4f5

There are 1 changes which include tauri-codegen with patch

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
tauri-codegen 2.5.0 2.5.1
tauri-macros 2.5.0 2.5.1
tauri-build 2.5.1 2.5.2
tauri 2.9.2 2.9.3

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@FabianLars

Copy link
Copy Markdown
Member

How did you come up with the idea to wrap it in a function?

@Legend-Master

Legend-Master commented Nov 13, 2025

Copy link
Copy Markdown
Contributor Author

How did you come up with the idea to wrap it in a function?

It was quite a journey 😂 So basically I was wondering why the completion's so slow in that function a long time ago, and I found out if I remove this macro, the problem goes away, then I tried to poke around all sorts of different methods but nothing worked so I left it until now

The only things I noticed that worked before were

  1. Remove all the capability staffs
  2. Move the entire generate_context macro to a function (by the way, a closure doesn't work here)

I was trying to put up a documentation on how to improve this by letting rust analyzer ignore this macro with rust-analyzer.procMacro.ignored but thought I'd give it a final shot here we are 🙃

@Legend-Master
Legend-Master merged commit 8e3bd63 into tauri-apps:dev Nov 13, 2025
19 checks passed
@Legend-Master
Legend-Master deleted the wrap-generate-context branch November 13, 2025 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants