When a segment has a key that appears in the Comment area (like the key of a property in a .properties file), this segment cannot be found using the key. This occurs regardless even if the checkbox In Comments is checked in the Search dialog.
You are correct, the ENTRY_COMMENT_PROVIDER add the Id, file path, source translation and comment to the panel Area.
I think it would make sense to append the segment Id to the comment during searching -- I'm not sure the path and translation are useful.
Here's a proposed patch for this issue, it should be good and not incur too much performance penalties (or do you prefer I make a Pull request on Github?)
The Comments pane is weirdly overloaded to show non-comment metadata in addition to actual comments. That's a historical problem caused by a lack of a better place to show metadata (now we have the Segment Properties pane, but that's relatively recent). But let's agree that user expectations are that "anything in the Comments pane is a comment and should be searchable".
The searcher currently looks at SourceTextEntry.getComment(), but it's pretty hacky to search against a \n-concatenated string of property values. The search should be done against each value separately to avoid false positives.
Thus I would prefer a solution that added a SourceTextEntry.searchableMetadata() method that returned a list or array of property values that should be searchable. The contents should probably be the values in props plus what is exposed by CommentsTextArea.ENTRY_COMMENT_PROVIDER. Searcher.checkEntry() should accept a list or array instead of the current comment string, and match against each entry.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There are two concepts of "comment" that are not in sync:
SourceTextEntry.getComment()CommentsTextArea.ENTRY_COMMENT_PROVIDERThe searcher only looks at #1, not #2.
You are correct, the ENTRY_COMMENT_PROVIDER add the Id, file path, source translation and comment to the panel Area.
I think it would make sense to append the segment Id to the comment during searching -- I'm not sure the path and translation are useful.
Here's a proposed patch for this issue, it should be good and not incur too much performance penalties (or do you prefer I make a Pull request on Github?)
The Comments pane is weirdly overloaded to show non-comment metadata in addition to actual comments. That's a historical problem caused by a lack of a better place to show metadata (now we have the Segment Properties pane, but that's relatively recent). But let's agree that user expectations are that "anything in the Comments pane is a comment and should be searchable".
The searcher currently looks at
SourceTextEntry.getComment(), but it's pretty hacky to search against a\n-concatenated string of property values. The search should be done against each value separately to avoid false positives.Thus I would prefer a solution that added a
SourceTextEntry.searchableMetadata()method that returned a list or array of property values that should be searchable. The contents should probably be the values inpropsplus what is exposed byCommentsTextArea.ENTRY_COMMENT_PROVIDER.Searcher.checkEntry()should accept a list or array instead of the currentcommentstring, and match against each entry.