Skip to content

feat(KeywordCompletor): complete match and throw expressions#2819

Open
przepompownia wants to merge 1 commit intophpactor:masterfrom
przepompownia:keyword-complete-expressions
Open

feat(KeywordCompletor): complete match and throw expressions#2819
przepompownia wants to merge 1 commit intophpactor:masterfrom
przepompownia:keyword-complete-expressions

Conversation

@przepompownia
Copy link
Contributor

@przepompownia przepompownia commented Jan 4, 2025

Complete match and throw expression keywords and provide snippets when submitted.

@przepompownia przepompownia changed the title KeywordCompletor: support match and possible other keyword expressions KeywordCompletor: support match and other possible keyword expressions Jan 4, 2025
@przepompownia
Copy link
Contributor Author

It's yet another side effect of working on #2622 that could be applied separately.

@przepompownia przepompownia changed the title KeywordCompletor: support match and other possible keyword expressions KeywordCompletor: support match and throw expressions Jan 4, 2025
@przepompownia przepompownia changed the title KeywordCompletor: support match and throw expressions feat(KeywordCompletor): support match and throw expressions Jan 4, 2025
@przepompownia przepompownia marked this pull request as draft January 13, 2025 14:45
@przepompownia przepompownia marked this pull request as ready for review January 16, 2025 00:09
@dantleech
Copy link
Collaborator

dantleech commented Jan 16, 2025

it's not immediately clear what this PR does... in what way does it support match and throw expressions? (i.e. a PR description would be appreciated 😉 )

@przepompownia
Copy link
Contributor Author

Isn't KeywordCompletor enough in the title?

I guess CHANGELOG.md should be updated too in this case.

@przepompownia przepompownia changed the title feat(KeywordCompletor): support match and throw expressions feat(KeywordCompletor): complete match and throw expressions Jan 16, 2025
@dantleech
Copy link
Collaborator

dantleech commented Jan 16, 2025

Isn't KeywordCompletor enough in the title?

not really - for example:

This MR will ensure that the match and throw keywords are suggested in completion results,

or

This MR will ensure that match and throw keywords are recognised as expressions and allow subsequent expression completions.

or whatever - I had no idea this had anything to do with snippets 🙂 basically I don't want to have to reverse engineer (and guess) what the intent of the PR is from looking at the code.

@przepompownia
Copy link
Contributor Author

Isn't KeywordCompletor enough in the title?

not really - for example:

This MR will ensure that the match and throw keywords are suggested in completion results,

or

This MR will ensure that match and throw keywords are recognised as expressions and allow subsequent expression completions.

or whatever - I had no idea this had anything to do with snippets 🙂 basically I don't want to have to reverse engineer (and guess) what the intent of the PR is from looking at the code.

I appreciate this idea and try to keep it in mind and apply, but it is not always clear for me what user the commit is addressed for, especially when I look at the previous commit titles from the master branch 😉. On the other side my (still poor) English may cause additional confusion - please don't hesitate to correct my possibly strange language constructions.

@dantleech
Copy link
Collaborator

dantleech commented Jan 16, 2025

but it is not always clear for me what user the commit is addressed for

well you can assume that they're aimed at me or otherwise the person that's reviewing the PR 🙂 My own PRs often don't feature extensive descriptions but I'm the one merging and reviewing them so have the maintainer's privilege there.

If my PR breaks Phpactor it's my fault - if your PR breaks Phpactor it's also my fault 😄 so the clearer the intent of the PRs the better

@dantleech
Copy link
Collaborator

dantleech commented Jan 16, 2025

so with this MR using an open parenthesis ( results in throw and match being suggested, which is why I'm reluctant to merge these types of changes. the code is very fragile and it's difficult to know what the consequences are.

@przepompownia
Copy link
Contributor Author

Yes, I see that the case of cursor placed right after open parenthesis ( is often not directly recognized by tolerant parser and requires to be expressed in an indirect, a bit hacky way. Thus the need to be guarded by enough tests.

@dantleech
Copy link
Collaborator

@przepompownia (not sure how else to contact you) if you like stickers let me know your address via. my git email and I'll send you a couple of Phactor ones :)

@przepompownia
Copy link
Contributor Author

przepompownia commented Nov 30, 2025

@przepompownia (not sure how else to contact you) if you like stickers let me know your address via. my git email and I'll send you a couple of Phactor ones :)

Nice to have a gadget promoting Phpactor and maybe keep to share with a few people potentially interested in :)

@przepompownia przepompownia force-pushed the keyword-complete-expressions branch 3 times, most recently from 8bda3b4 to eecd514 Compare December 3, 2025 01:36
@przepompownia przepompownia force-pushed the keyword-complete-expressions branch 7 times, most recently from 02b3ddd to 7fefba6 Compare December 26, 2025 00:33
@przepompownia przepompownia force-pushed the keyword-complete-expressions branch 2 times, most recently from 9107c5a to 2d0284e Compare December 29, 2025 08:21
@przepompownia przepompownia force-pushed the keyword-complete-expressions branch from 2d0284e to 063d935 Compare January 14, 2026 09:28
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.

2 participants