-
Notifications
You must be signed in to change notification settings - Fork 1.6k
✨ Marker support for Rust file extension .rs #4827
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
Open
mabulgu
wants to merge
3
commits into
kubernetes-sigs:master
Choose a base branch
from
mabulgu:rust-lang
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We cannot add a file that we do not support have officially
Could the extension not be added in your code using the lib?
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.
Yeah no problem, I got that:) What I meant: I will try what you suggest above, and actually the way I had implemented it was like what you suggested above. Let me revert to what I had before and compare with your suggestion and see if that works. I dont remember why I avoided that approach, maybe just not to duplicate things (thinking I can have the
rs
extension definition in kubebuilder)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.
@camilamacedo86 ok I've tried and remembered the reason as I tried to use the same approach. Here it is:
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.
So in other words, if we can make the marker struct use public fields instead of private ones, any other plugins can use their own custom markers.
I can create a PR for this if this sounds good to you?
Uh oh!
There was an error while loading. Please reload this page.
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.
Making the fields public worked for me: mabulgu@4a61855
I can create a PR for this (not via the above branch of course, with a new one) because without this change I dont think anyone can use a custom marker.
Here is the implementation on the plugin: https://github.com/SystemCraftsman/rust-operator-plugins/blob/main/pkg/plugins/rust/marker.go
This might help us create the documentation for the custom marker. I can help with that as well.
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.
Yes, sure. Thank you a lot !!!
Yes, we need to allow people does that and create their own markers for their own extensions.
Please, feel free to raise the PR.