-
Notifications
You must be signed in to change notification settings - Fork 17
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
Update type definition for function
#177
Conversation
108f4ba
to
200eaed
Compare
671f4b3
to
c7f2209
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
denops_std/function/cursor_test.ts
Outdated
@@ -46,6 +46,8 @@ test({ | |||
assertNumber(await cursor.line(denops, ".")); | |||
assertEquals(await cursor.line(denops, "."), 1); | |||
assertEquals(await cursor.line(denops, "$"), 3); | |||
assertNumber(await cursor.line(denops, ".", 1000)); | |||
assertEquals(await cursor.line(denops, ".", 1000), 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should
We have no guarantee that the current winid is 1000
. We need to get a correct one first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
I changed to use bufwinid("%")
to get current winid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems this part is not fixed yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I fixed it.
export type PropAddListItem = [ | ||
lnum: number, | ||
col: number, | ||
end_lnum: number, | ||
end_col: number, | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💭
I didn't know that we can annotate each tuple elements. Could you share the URL for this spec with me if you have one (This is just my interest so just ignore if you don't have it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is from TypeScript 4.0.
https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html#labeled-tuple-elements
c7f2209
to
0ec9c6b
Compare
denops_std/function/cursor_test.ts
Outdated
@@ -46,6 +46,8 @@ test({ | |||
assertNumber(await cursor.line(denops, ".")); | |||
assertEquals(await cursor.line(denops, "."), 1); | |||
assertEquals(await cursor.line(denops, "$"), 3); | |||
assertNumber(await cursor.line(denops, ".", 1000)); | |||
assertEquals(await cursor.line(denops, ".", 1000), 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems this part is not fixed yet.
0ec9c6b
to
99065f8
Compare
#44
The minimum version supported by denops.vim has been raised, resulting in changes to the type definitions and documentation for some functions.
This PR is a update of the type definitions and documentation for those functions that were already typed.