-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
Create use alias setting from third party plugin #97
Comments
Found it. I can simply write into your application settings. Neat! For those who are searching: package com.cedricziel.idea.typo3.optional.annotation;
import com.intellij.openapi.components.ProjectComponent;
import de.espend.idea.php.annotation.ApplicationSettings;
import de.espend.idea.php.annotation.dict.UseAliasOption;
import java.util.List;
public class UseAliasProvider implements ProjectComponent {
@Override
public void projectOpened() {
String className = "TYPO3\\CMS\\Extbase\\Annotation\\Inject";
String alias = "inject";
UseAliasOption injectUseAlias = new UseAliasOption(className, alias, true);
List<UseAliasOption> useAliasOptions = ApplicationSettings.getInstance().useAliasOptions;
boolean isAlreadyPresent = false;
for (UseAliasOption option : useAliasOptions) {
if (option.getClassName() != null && option.getClassName().equals(className)) {
option.setAlias(alias);
isAlreadyPresent = true;
}
}
if (!isAlreadyPresent) {
useAliasOptions.add(injectUseAlias);
}
}
} |
wtf? @cedricziel i will better provide you an extension point :) |
That would be perfect, but I didn't want to steal your time ;) |
Haehnchen
added a commit
that referenced
this issue
Nov 28, 2017
already in ;) |
Neat, thx a bunch! |
Haehnchen
added a commit
that referenced
this issue
Nov 28, 2017
create use alias setting from third party plugin #97
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
Can I create a new
UseAliasOption
programmatically from a third-party plugin?The text was updated successfully, but these errors were encountered: