Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

completions for re-exported functions #1656

Merged
merged 7 commits into from
Dec 10, 2023

Conversation

nolanderc
Copy link
Contributor

closes #423

I encountered this bug while using https://github.com/ziglibs/zgl, which has many types that look like the following:

pub const VertexArray = enum(UInt) {
    invalid = 0,
    _,

    pub const create = gl.createVertexArray;
    pub const delete = gl.deleteVertexArray;
    pub const gen = gl.genVertexArray;
    pub const bind = gl.bindVertexArray;
    pub const enableVertexAttribute = gl.enableVertexArrayAttrib;
    pub const disableVertexAttribute = gl.disableVertexArrayAttrib;

    pub const attribFormat = gl.vertexArrayAttribFormat;
    pub const attribIFormat = gl.vertexArrayAttribIFormat;
    pub const attribLFormat = gl.vertexArrayAttribLFormat;

    pub const attribBinding = gl.vertexArrayAttribBinding;

    pub const vertexBuffer = gl.vertexArrayVertexBuffer;
    pub const elementBuffer = gl.vertexArrayElementBuffer;
};

Previously, there were no completions for any of the re-exported functions. But with this patch we yield completions for all re-exported functions which accept the container (VertexArray in the case above) as their first argument.

Copy link

codecov bot commented Dec 7, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a4c568d) 75.22% compared to head (5cc8cfa) 75.55%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1656      +/-   ##
==========================================
+ Coverage   75.22%   75.55%   +0.33%     
==========================================
  Files          33       33              
  Lines        9054     9067      +13     
==========================================
+ Hits         6811     6851      +40     
+ Misses       2243     2216      -27     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nolanderc nolanderc requested a review from Techatrix December 9, 2023 11:50
@nolanderc nolanderc requested a review from Techatrix December 10, 2023 15:41
@Techatrix Techatrix merged commit d1ad449 into zigtools:master Dec 10, 2023
@nolanderc nolanderc deleted the delegated-functions branch December 11, 2023 07:27
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.

Feature Request: Add completions for re-exported functions
2 participants