luttje / luttje/glua-api-snippets

Feature request: Analog of diff for custom declared function

Open
#65 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted
Dominant language
TypeScript
Stars
45
Forks
10
PR merge metrics
No merged PRs in 30d

Description

I want to write new declaration for some functions, for example, to add **generics** or some complex types (`@nodiscard` or even `integer`) that the wiki does not allow us to use.

However, if I do this in a "custom directory", then I completely replace the function description and eventually it becomes obsolete.

I would prefer to be able to write a "diff" when I can change the parameter types, but not change the parameter name/desc with a full method info.

```lua
--[[... unchanged info ...]]
---@generic T
---@param metaName `T` --[[... unchanged desc ...]]
---@return T? --[[... unchanged desc ...]]
---@nodiscard
function _G.FindMetaTable(metaName) end
```

Do you have any ideas on how to do this? I don't mean the real `diff` that is used in version control systems - maybe it's too complicated.

p.s. But yes, I don't want to write a `@nodiscard` to everything, it's stupid.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names custom-directory declarations and the example function FindMetaTable, but no source files or tests. Start by tracing how custom declarations are loaded and merged with generated wiki data. Done would mean defining and implementing a selective override mechanism that can change types or add annotations while preserving unspecified names and descriptions.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.