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

Extended marks support #170

Closed
hoschi opened this issue Apr 27, 2021 · 9 comments
Closed

Extended marks support #170

hoschi opened this issue Apr 27, 2021 · 9 comments

Comments

@hoschi
Copy link

hoschi commented Apr 27, 2021

Do I miss something or is the support for extended marks missing?
From the Neovim docs I would expect that Buffer gets new methods/properties, e.g. setExtmark().

@mhinz

This comment was marked as outdated.

@hoschi

This comment was marked as outdated.

@smolck
Copy link
Contributor

smolck commented Jun 1, 2021

@mhartington Are you familiar with how new APIs like this are generated with this library? I'd like to update this but can't seem to find how that's done.

@mhartington
Copy link
Contributor

APIs from the library have a mapping back to the original nvim API.

so things like nvim_buf_set_extmark(0, g:mark_ns, 0, 0, 2, {})

Would probably be implemented like setLines

https://github.com/neovim/node-client/blob/master/packages/neovim/src/api/Buffer.ts#L103-L125

 setExtMark(nameSpace, line, col, opts = {}) {
    return this.request(`${this.prefix}set_extmark`, [
      this,
      nameSpace,
      line,
      col,
      opts,
    ]);
  }

The main take away is that each method in the classes must map back to an API from neovim.

@smolck
Copy link
Contributor

smolck commented Jun 1, 2021

Right, but are those written by hand and not generated (via reading the output from $ nvim --api-info)?

@mhartington
Copy link
Contributor

Correct, they are written by hand. I'm not sure there was ever a way to generate the API programmatically.

@smolck
Copy link
Contributor

smolck commented Jun 1, 2021

Okay, thank you! I think I might write something to generate them then . . .

@billyvg
Copy link
Member

billyvg commented Jun 1, 2021

I think there is (or was) a script to generate the TS interfaces.

I haven't had much time to work on this, but I wanted to have some automation to compare against the neovim API and create GH issues for missing methods.

@justinmk
Copy link
Member

justinmk commented Jul 10, 2023

See #199 (comment)

Nvim APIs from node-client should be auto-generated. Anything else is not sustainable.

Meanwhile, clients can use neovim.request('nvim_buf_get_extmarks', [...]) and any other :help api function using neovim.request().

@justinmk justinmk closed this as not planned Won't fix, can't repro, duplicate, stale Feb 8, 2024
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 a pull request may close this issue.

6 participants