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

MatLab: return appropriate tags for set get methods + unit #3773

Merged
merged 2 commits into from
Jul 17, 2023

Conversation

portalgun
Copy link

@portalgun portalgun commented Jul 14, 2023

Update function regexps for 'get.' and 'set.' methods. For example:
function get.myproperty(obj)
...
Otherwise function tag returned is just 'get' instead of 'get.myproperty'.

Replaces #3772

@portalgun portalgun mentioned this pull request Jul 14, 2023
@portalgun portalgun closed this Jul 14, 2023
@portalgun portalgun reopened this Jul 14, 2023
@codecov
Copy link

codecov bot commented Jul 15, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (983cab5) 83.04% compared to head (f50ea5c) 83.04%.

❗ Current head f50ea5c differs from pull request most recent head a53c1e2. Consider uploading reports for the commit a53c1e2 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3773   +/-   ##
=======================================
  Coverage   83.04%   83.04%           
=======================================
  Files         227      227           
  Lines       55184    55184           
=======================================
  Hits        45828    45828           
  Misses       9356     9356           
Impacted Files Coverage Δ
parsers/matlab.c 100.00% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@masatake
Copy link
Member

I'll merge this. Let me rearrange some commits before merging.

@masatake masatake self-assigned this Jul 16, 2023
@masatake masatake added this to the 6.1 milestone Jul 16, 2023
Dave added 2 commits July 17, 2023 21:56
For example:
    function get.myproperty(obj)
    ...
    Otherwise function tag returned is just 'get' instead of 'get.myproperty'.

See matlab property set methods documentation [https://www.mathworks.com/help/matlab/matlab_oop/property-set-methods.html]]

(@masatake updated this commit log.)
Tag returned should be
   get.myproperty f
   set.myproperty f

(@masatake added --sort=no.)
@masatake
Copy link
Member

After thinking, I dropped the man page.

The VERSIONS section is for describing the change adding a kind, a role, a field, or an extra.
The original change in the pull request doesn't fit VERSIONS.

@masatake
Copy link
Member

I will merge this but I have some comments.

classdef input < handle
    properties
        myproperty
    end
    properties(Hidden)
        myproperty_
    end
    function out=get.myproperty(obj)
        out=myproperty_;
    end
    function out=set.myproperty(obj,val)
        myproperty_=val;
    end

For the input, I think the parser should make a tag for myproperty.
I don't know MatLab well but an ideal parser may emits:

input      input.m      /^classdef input/;"     kind:class      inherits:handle
myproperty      input.m      /^        myproperty$/;"      kind:property      scope:class:input
myproperty      input.m      /^    function out=get.myproperty/;"      kind:getter      scope:class:input
myproperty      input.m      /^    function out=set.myproperty/;"      kind:setter      scope:class:input

A class input should have inherits column.
The 1st myproperty should be tagged as a property. It should have the scope field.
The 2nd myproperty should be tagged as a getter. It should have the scope field.
The 34d myproperty should be tagged as a setter. It should have the scope field.

end: field is another field all the tags should have.

@portalgun
Copy link
Author

After thinking, I dropped the man page.

The VERSIONS section is for describing the change adding a kind, a role, a field, or an extra. The original change in the pull request doesn't fit VERSIONS.

That's fair. If there is somewhere else you would like me to put that information, or add anything else to the docs, I'm happy to do that.

Also, the changes you've made are great!

@masatake masatake changed the title matlab: return appropriate tags for set get methods + unit + docs MatLab: return appropriate tags for set get methods + unit + docs Jul 17, 2023
@masatake masatake changed the title MatLab: return appropriate tags for set get methods + unit + docs MatLab: return appropriate tags for set get methods + unit Jul 17, 2023
@masatake masatake merged commit caeb22a into universal-ctags:master Jul 17, 2023
38 checks passed
@masatake
Copy link
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants