-
Notifications
You must be signed in to change notification settings - Fork 326
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
Exclude components with a "PRIVATE" tag from the component browser #4085
Exclude components with a "PRIVATE" tag from the component browser #4085
Conversation
match &component.data { | ||
component::Data::FromDatabase { entry, .. } => | ||
entry.documentation.iter().any(|doc| match doc { | ||
DocSection::Tag { name, .. } => name == "PRIVATE", |
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.
extrct that as const. We are extracting all literals as consts. Plus, check if itdoesnt exists anywhere in the app. Put it in a module with language construct definitions pls.
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.
extrct that as const. We are extracting all literals as consts. Plus, check if itdoesnt exists anywhere in the app. Put it in a module with language construct definitions pls.
@wdanilo Are you aware that this is not a language construct, but the documentation tag? I'd put it in the documentation-related crate instead. Or just here.
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.
Documentation is IMO part of language specification. It affects how these things are also accessible from code. IMO this is language-binding thing.
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.
Documentation is IMO part of language specification. It affects how these things are also accessible from code. > IMO this is language-binding thing.
This is not true AFAIK. You can happily access those methods from the code. The tag just hides them in the Component Browser.
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, you can for now. But we want to introduce a mode where you could not from external modules if you are not enabling "allow unsafe access" or something like that in the language. It is not supported in Engine yet, but it is part of the language.
@@ -185,6 +186,9 @@ impl List { | |||
for (id, entry) in ids_and_entries { | |||
self.allowed_favorites.insert(id); | |||
let component = Component::new_from_database_entry(id, entry.clone_ref()); | |||
if component_is_private(&component) { |
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.
I know this was not part of this task, but we should display private components after key-stroke. Can we add ctrl + option + p
here? Just like ctrl + option + <number>
changes debug view.
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.
The flag readable by controllers could be stored in the IDE controller, because it's accessible from the searcher controller.
Anyway, I would prefer to do it in a separate PR (not necessarily separate task: tasks can be done in more than one PR.
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.
I'll open a new PR for this addition.
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.
Nothing more than @wdanilo comments, see also discussions.
match &component.data { | ||
component::Data::FromDatabase { entry, .. } => | ||
entry.documentation.iter().any(|doc| match doc { | ||
DocSection::Tag { name, .. } => name == "PRIVATE", |
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.
extrct that as const. We are extracting all literals as consts. Plus, check if itdoesnt exists anywhere in the app. Put it in a module with language construct definitions pls.
@wdanilo Are you aware that this is not a language construct, but the documentation tag? I'd put it in the documentation-related crate instead. Or just here.
…0' of github.com:enso-org/enso into wip/galin-enso/exclude-private-methods-from-cb-184215360
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.
This PR contains binary files. Please be sure to check what files are committed before making PR requests :)
Oops, that was definitely not my intention. Fixed. |
QA: No issues spotted. However, I started to wonder if PRIVATE methods from the current module/project should be actually hidden? @wdanilo the question to you: I guess we should display PRIVATE method from the entire currently opened project. |
@farmaazon thanks for spotting it. You are right, they should not. |
QA green. Although, I found one more issue: we still display private methods in the method list inside documentation. But let's not do it as a part of this task, please make another issue for it instead. |
Added separate issue: #5635 |
First part of #4962
Pull Request Description
This PR removes components from the component browser if they contain a "PRIVATE" tag. Private components from the current module or project are not hidden.
Important Notes
Checklist
Please include the following checklist in your PR:
Scala,
Java,
and
Rust
style guides.
./run ide build
and./run ide watch
.