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

basic auto completion for maven version properties. #5823

Merged
merged 1 commit into from
Apr 14, 2023

Conversation

mbien
Copy link
Member

@mbien mbien commented Apr 13, 2023

It is somewhat common to use properties for artifact versions, esp when several artifacts share the same version.

This implements basic auto completion for properties which are used as version field.

In contrast to hints, completion is implemented in the grammar and doesn't have the full context. This will only take properties into account which are in the same pom file as their usage.

property-version-completion

@mbien mbien added the Maven [ci] enable "build tools" tests label Apr 13, 2023
@mbien mbien added this to the NB18 milestone Apr 13, 2023
Comment on lines 471 to 472
// version property completion
if (path.startsWith("/project/properties/") && path.indexOf("/", 20) == -1) {
Copy link
Member Author

Choose a reason for hiding this comment

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

this should make it hopefully fairly safe for inclusion. The code path is guarded by the xpath (basically), so it doesn't affect any other completion code.

Copy link
Member

Choose a reason for hiding this comment

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

Nitpick: I would store the string to variable/constant, then would use length() or leave a comment for 20. I would add // NOI18N if possible.

@mbien mbien added the ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) label Apr 13, 2023
@apache apache locked and limited conversation to collaborators Apr 13, 2023
@apache apache unlocked this conversation Apr 13, 2023
@mbien mbien force-pushed the maven-version-property-completion branch from 55f8cc9 to 15e1fbc Compare April 14, 2023 02:05
Copy link
Contributor

@ebarboni ebarboni left a comment

Choose a reason for hiding this comment

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

looks good to me

Copy link
Contributor

@matthiasblaesing matthiasblaesing left a comment

Choose a reason for hiding this comment

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

Tested and worked. Eyeballed the code and it looks sane. Thank you.

It is somewhat common to use properties for artifact versions, esp
when several artifacts share the same version.

This implements basic auto completion for properties which are used
as version field.

In contrast to hints, completion is implemented in the grammar
and doesn't have the full context. This will only take properties
into account which are in the same pom file as their usage.
@mbien mbien force-pushed the maven-version-property-completion branch from 15e1fbc to 34cecee Compare April 14, 2023 21:07
@mbien
Copy link
Member Author

mbien commented Apr 14, 2023

thanks for the reviews. added //NOI18N everywhere, no other changes.

going to merge once green again

@mbien mbien merged commit 5cb46cf into apache:master Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) Maven [ci] enable "build tools" tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants