-
Notifications
You must be signed in to change notification settings - Fork 635
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
QNTM-5869: Search keywords split mechanism #9271
Conversation
@@ -1855,9 +1855,6 @@ Want to publish a different package?</value> | |||
<data name="PublishPackageViewPackageVersion" xml:space="preserve"> | |||
<value>Version (major minor build)</value> | |||
</data> | |||
<data name="DynamoViewSettingsMenuIsolationMode" xml:space="preserve"> |
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'm not sure where these resource changes are coming from
@@ -45,7 +45,7 @@ | |||
// to distinguish one build from another. AssemblyFileVersion is specified | |||
// in AssemblyVersionInfo.cs so that it can be easily incremented by the | |||
// automated build process. | |||
[assembly: AssemblyVersion("2.1.0.4395")] | |||
[assembly: AssemblyVersion("2.1.0.6957")] |
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.
you should usually not commit this file.
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.
Whoops, reverting this
@@ -15,6 +15,8 @@ public class SearchDictionary<V> | |||
protected readonly Dictionary<V, Dictionary<string, double>> entryDictionary = | |||
new Dictionary<V, Dictionary<string, double>>(); | |||
|
|||
public bool experimentalSearch = false; |
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.
can this be made 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.
I don't think I can make it private here because I need to be able to access it from the DynamoViewModel. Maybe I'm missing something?
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.
one option because this is an internal API is mark this internal and use [internalsVisibleAttribute] to make this property accessible from DynamoCoreWPF assembly.
@@ -291,6 +291,15 @@ public bool EnableTSpline | |||
} | |||
} | |||
|
|||
public bool ExperimentalSearch |
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.
should have a summary /// tag if this a public API - does it need to be public?
@@ -64,4 +64,4 @@ | |||
// You can specify all the values or you can default the Build and Revision Numbers | |||
// by using the '*' as shown below: | |||
// [assembly: AssemblyVersion("1.0.*")] | |||
[assembly: AssemblyFileVersion("2.1.0.4395")] | |||
[assembly: AssemblyFileVersion("2.1.0.6957")] |
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 don't think that this file is usually included in PRs.
get { return model.SearchModel.experimentalSearch; } | ||
set | ||
{ | ||
model.SearchModel.experimentalSearch = value; |
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 guess in this case it's not such a big deal, but you usually would not modify a field from another object - I think instead we usually use a property, in this case I think it makes sense to try and hide this field from external consumers - we don't want anyone to use it - in an extension for example.
@scottmitchell some other thoughts - You could also use an ifdef compile time flag using the debug config. |
@mjkkirschner @scottmitchell Either menu works. Just need it in some menu for testing.... if it looks ok, we will probably just make it the standard. |
If thats the case and its not really for users, but for us, my feeling is that it should go into the debug menu - I would also like to hide the API since it doesn't seem like something we want people using from extensions or packages. |
@mjkkirschner Sounds good to me. Let's put it in the debug menu and make the API private |
I think this is ready to go |
LGTM |
@scottmitchell is this waiting on something? |
@mjkkirschner This is waiting on @Racel 's review in R2020 |
@@ -310,6 +321,15 @@ internal IEnumerable<V> Search(string query, int minResultsForTolerantSearch = 0 | |||
query = query.ToLower(); | |||
|
|||
var subPatterns = SplitOnWhiteSpace(query); | |||
|
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.
Just as a question; should this code be wrapped in #if DEBUG statements? Probably not necessary, but I am doing the same type of code and wanted to get the group thought about if it is needed/wanted or not.
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 think because this code is already in the debug only menu it's fine not to use a compiler flag. On the other hand, for performance impacting code - like Console.WriteLine
I would use a debug flag:
https://stackoverflow.com/questions/18464833/console-writeline-effect-on-performance
{ | ||
get { return experimentalSearch; } | ||
set { experimentalSearch = value; } | ||
} |
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.
When implementing my own debug mode VS suggested;
internal bool ExperimentalSearch { get; set; } = false;
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.
@ColinDayOrg Yep, that's cleaner. Fixed.
@scottmitchell there's now conflicts on this branch from your other PR I think - might making @Racel 's review harder. |
@mjkkirschner Look's like it was caused by @ColinDayOrg 's PR. I'll fix. |
@@ -785,10 +785,15 @@ | |||
Header="{x:Static p:Resources.DynamoViewDebugMenuShowDebugAST}" | |||
IsChecked="{Binding ShowDebugASTs}"></MenuItem> | |||
<MenuItem Focusable="False" | |||
Name="ExperimentalSearch" | |||
Name="TruncateSearchResults" |
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.
@ColinDayOrg FYI I renamed your menu item name
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.
Good catch, thanks. I am assuming that the "TruncateSearchResults" menu has been checked to test if it still works as expected after this change?
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 just did a quick test to verify that the menu still works in the current master codebase after this specific change, so it seems ok to me.
Other than the one question, LGTM. |
Purpose
This PR addresses jira task QNTM-5869: Search keywords split mechanism.
This PR does:
Declarations
Check these if you believe they are true
*.resx
filesReviewers
@mjkkirschner @ColinDayOrg @Racel