-
Notifications
You must be signed in to change notification settings - Fork 114
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
Add a case sensitive variant of IContentType.isAssociatedWith #673 #1235
base: master
Are you sure you want to change the base?
Add a case sensitive variant of IContentType.isAssociatedWith #673 #1235
Conversation
d023d11
to
9b1f3c0
Compare
Test Results 424 files - 212 424 suites - 212 29m 14s ⏱️ - 10m 46s Results for commit 9b1f3c0. ± Comparison against base commit 31e1ef4. This pull request skips 18 tests.
|
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.
As discussed in #673
Would something like this be acceptable?
maybe @jonahgraham can review as he was involved in the discussion?
What is the advised way to add tests?
Copy and paste existing tests and adapt them. I typically find related tests in the call hierarchy.
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 the deprecations in the API are necessary or helpful. They're certainly not properly documented.
* @see #isAssociatedWith(String, IScopeContext) | ||
*/ | ||
@Deprecated |
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.
If you deprecate it, there should be javadoc explaining what to use instead.
I wonder though, why deprecate it instead of having a default method that calls the new method with true, which has been the behavior of the past? But then, you've deprecated two methods and replaced them with a single method, so if I have a string but not a scope context, what will I do to fix the deprecation warning?
* @since 3.1 | ||
*/ | ||
@Deprecated |
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.
If you deprecate it, there should be javadoc explaining what to use instead.
What would be responsible of defining whether we want |
That's also a very good question! I see these callers: But that's mostly in the type hierarchy. It's not at all clear how the following usage would decide true versus false and in fact there isn't good non-deprecated method for it to call: I would have expect the flag to be defined by the content type provider/definition such that this decision is not even something you see in the API. I.e., just because CDT wants .c and .C to be the same, doesn't mean JDT should also .Java, .JaVa, and all variations there of... |
@@ -377,15 +392,15 @@ boolean hasBuiltInAssociations() { | |||
return builtInAssociations; | |||
} | |||
|
|||
boolean hasFileSpec(IScopeContext context, String text, int typeMask) { | |||
boolean hasFileSpec(IScopeContext context, String text, int typeMask, boolean caseStrict) { |
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.
As we already have a typeMask, why not having a new flag controlling the behavior?
As discussed in #673
Would something like this be acceptable?
I could not test the change so I do not know this will work yet so please do not yet accept this.
What is the advised way to add tests?