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

Wrong type on getMarkers #4404

Closed
MysterAitch opened this issue Oct 29, 2020 · 1 comment
Closed

Wrong type on getMarkers #4404

MysterAitch opened this issue Oct 29, 2020 · 1 comment

Comments

@MysterAitch
Copy link

Hi,

getMarkers is typed as returning an array, but what it actually returns is an object which uses numbers as keys (i.e. Record<number, MarkerLike>).

Links to the relevant source code snippets are linked to below.

ace/ace.d.ts

Line 448 in a505922

getMarkers(inFront?: boolean): MarkerLike[];

ace/lib/ace/edit_session.js

Lines 664 to 672 in a505922

/**
* Returns an object containing all of the markers, either front or back.
* @param {Boolean} inFront If `true`, indicates you only want front markers; `false` indicates only back markers
*
* @returns {Object}
**/
this.getMarkers = function(inFront) {
return inFront ? this.$frontMarkers : this.$backMarkers;
};

ace/lib/ace/edit_session.js

Lines 146 to 147 in a505922

this.$frontMarkers = {};
this.$backMarkers = {};

This is then, somehow, filtering through into brace as any[] (also with bad/wrong documentation), but that is perhaps a separate issue to place either there or at the definitelytyped repo:

https://github.com/thlorenz/brace/blob/032404bee863470d8fd81a860c227466d48206e2/index.d.ts#L679-L683

        /**
         * Returns an array containing the IDs of all the markers, either front or back.
         * @param inFront If `true`, indicates you only want front markers; `false` indicates only back markers
        **/
        getMarkers(inFront: boolean): any[];
@github-actions
Copy link

github-actions bot commented May 9, 2022

This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

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

No branches or pull requests

1 participant