-
Notifications
You must be signed in to change notification settings - Fork 636
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
DYN-9999 : fix string type regex #15770
base: master
Are you sure you want to change the base?
Conversation
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.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-9999
UI Smoke TestsTest: success. 11 passed, 0 failed. |
src/NodeServices/PythonServices.cs
Outdated
@@ -381,7 +381,7 @@ internal abstract class PythonCodeCompletionProviderCommon : IExternalCodeComple | |||
internal static readonly Regex MATCH_FROM_IMPORT_STATEMENTS = new Regex(@"from\s+?([\w.]+)\s+?import\s+?([\w, *]+)", RegexOptions.Compiled | RegexOptions.Multiline); | |||
internal static readonly Regex MATCH_VARIABLE_ASSIGNMENTS = new Regex(@"^[ \t]*?(\w+(\s*?,\s*?\w+)*)\s*?=\s*(.+)", RegexOptions.Compiled | RegexOptions.Multiline); | |||
|
|||
internal static readonly Regex STRING_VARIABLE = new Regex("[\"']([^\"']*)[\"']", RegexOptions.Compiled); | |||
internal static readonly Regex STRING_VARIABLE = new Regex("^[\"']([^\"']*)[\"']$", RegexOptions.Compiled); | |||
internal static readonly Regex DOUBLE_VARIABLE = new Regex("^-?\\d+\\.\\d+", RegexOptions.Compiled); | |||
internal static readonly Regex INT_VARIABLE = new Regex("^-?\\d+", RegexOptions.Compiled); | |||
internal static readonly Regex LIST_VARIABLE = new Regex("\\[.*\\]", RegexOptions.Compiled); |
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 these other variable regexs also have start and end markers?
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, I guess so, trying to think if there is any reason to be more loose but I can't find any.
Purpose
Improve the autocomplete in the python editor.
We prepare autocomplete based on the variable type and sometimes we do not assign the correct type and the autocomplete is erroneous.
For example aa = HellowWorld("aaa") will be processed as aa being of type string and the autocomplete will be related to string type.
Declarations
Check these if you believe they are true
*.resx
filesReviewers
FYIs