Replace TemplateContextType.isInContext deprecated method - #545
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request updates DartTemplateContextType.java to override the newer signature of isInContext that accepts a TemplateActionContext instead of PsiFile and int offset. It extracts the file and start offset from the context object to perform the language and element checks. There are no review comments, so I have no feedback to provide.
|
The testing steps are great. Thanks! |
Description
Replaced deprecated method
isInContextfromTemplateContextTypeclass inDartTemplateContextType.javafileNote: Work of this PR was originally here, but it was closed due to CLA problems.
Testing steps:
1. Run the IDE in Sandbox mode with the plugin
2. Prepare a Live Template for testing
Inside the Sandbox IDE window:
Editor>Live Templates.Live Template.dtest) and some template code (e.g.,print('hello');).Dartoption (which matches thecontextIdregistered in theplugin.xml) and check it.3. Test the "Happy Path" (It should work)
file.getLanguage() instanceof DartLanguageevaluated to true.4. Test the "Negative Path" (It should not work)
Review the contribution guidelines below:
CHANGELOG.mdif appropriate (i.e. user-facing change) (N/A)Contribution guidelines:
dart format.practices (discussion).