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

Add support for C++ #186

Merged
merged 5 commits into from
Aug 9, 2021
Merged

Add support for C++ #186

merged 5 commits into from
Aug 9, 2021

Conversation

dgrunwald
Copy link
Contributor

My first attempt at adding C++ support. No automatic tests yet.

I think it works fairly well except for the type modifier -- that currently selects only the type, not the declarators. (i.e. only int in const int* p = NULL;)

@dgrunwald dgrunwald requested a review from pokey as a code owner August 5, 2021 17:30
@AndreasArvidsson
Copy link
Member

AndreasArvidsson commented Aug 5, 2021

Nice work!

That is how types works in java/ts as well. ie without qualifiers.

Look at the other languages and do similar test for cpp and if they all pass we should be golden :)

Could this be used for plain c as well? Same as our typescript definition is used for javascript? If so then please add plain c to the index file as well.

Copy link
Member

@pokey pokey left a comment

Choose a reason for hiding this comment

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

This looks great modulo minor comment! Let's get some tests in there and merge it in. I added some basic docs that might help

value: valueMatcher("*[declarator][value]", "*[value]"),
collectionItem: argumentMatcher("initializer_list"),
argumentOrParameter: argumentMatcher("parameter_list", "argument_list"),
xmlAttribute: "attribute"
Copy link
Member

Choose a reason for hiding this comment

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

We should either rename xmlAttribute to attribute or add another scope type for this use case. @AndreasArvidsson any opinions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess it makes sense to rename it, since the voice command is just attribute.

Note that I don't have a real use case for selecting attributes -- I just went through the list of scopes in cursorless help and set up all that make sense for C++.

Copy link
Member

Choose a reason for hiding this comment

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

If we want to use this same spoken word for other types of attributes I think we should rename the scope type.

Copy link
Member

Choose a reason for hiding this comment

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

Filed in #198; fine to merge this one in without it

@pokey
Copy link
Member

pokey commented Aug 6, 2021

@dgrunwald ok looking great! last thing:

Could this be used for plain c as well? Same as our typescript definition is used for javascript? If so then please add plain c to the index file as well.

And would prob be worth adding one test for c just to make sure it doesn't break. No need to re-test all scope types I don't think

@pokey pokey merged commit 698f45c into cursorless-dev:master Aug 9, 2021
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