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

Draft method motions #230

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Ddedalus
Copy link
Contributor

This one is a bit trickier. I've figured out a way of obtaining information on which methods are where right from the vscode (so the upside is it works for any language which end user has support for).

The problem is it involves an async call and I don't understand the rest of the code well enough to know where to put it. Once a file is loaded, the list is returned really quickly but is still a Thenable :/
It may be reasonable to put a callback when for example the first character of ]m is recognised.

Please have a look and tell if this code is of any use.

@Ddedalus
Copy link
Contributor Author

You can see how the motions would work by placing a breakpoing somewhere in the async by looking at the debug log. Method numeration starts at 1.

@aioutecism
Copy link
Owner

Will look into this later.

private n: number;

constructor(args: { direction: Direction, n?: number }) {
args.n = args.n === undefined ? 1 : args.n;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be solved a bit cleaner with nullish coalescing, assuming you're using TS 3.7+.

args.n = args.n ?? 1;

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.

3 participants