本文整理匯總了Java中com.intellij.lang.Language.ANY屬性的典型用法代碼示例。如果您正苦於以下問題:Java Language.ANY屬性的具體用法?Java Language.ANY怎麽用?Java Language.ANY使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.intellij.lang.Language
的用法示例。
在下文中一共展示了Language.ANY屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: IElementType
protected IElementType(@NotNull @NonNls String debugName, @Nullable Language language, boolean register) {
myDebugName = debugName;
myLanguage = language == null ? Language.ANY : language;
if (register) {
synchronized (lock) {
myIndex = size++;
LOG.assertTrue(myIndex < MAX_INDEXED_TYPES, "Too many element types registered. Out of (short) range.");
IElementType[] newRegistry =
myIndex >= ourRegistry.length ? ArrayUtil.realloc(ourRegistry, ourRegistry.length * 3 / 2 + 1, FACTORY) : ourRegistry;
newRegistry[myIndex] = this;
ourRegistry = newRegistry;
}
}
else {
myIndex = -1;
}
}
示例2: calcBaseLanguage
private static Language calcBaseLanguage(@NotNull VirtualFile file, @NotNull Project project, @NotNull final FileType fileType) {
if (file instanceof LightVirtualFile) {
final Language language = ((LightVirtualFile)file).getLanguage();
if (language != null) {
return language;
}
}
if (fileType.isBinary()) return Language.ANY;
if (isTooLargeForIntelligence(file)) return PlainTextLanguage.INSTANCE;
if (fileType instanceof LanguageFileType) {
return LanguageSubstitutors.INSTANCE.substituteLanguage(((LanguageFileType)fileType).getLanguage(), file, project);
}
return PlainTextLanguage.INSTANCE;
}
示例3: PsiReferenceRegistrarImpl
public PsiReferenceRegistrarImpl(final Language language) {
myBindingCache = new ConcurrentFactoryMap<Class, ProviderBinding[]>() {
@Nullable
@Override
protected ProviderBinding[] create(Class key) {
List<ProviderBinding> result = ContainerUtil.newSmartList();
for (Class<?> bindingClass : myBindingsMap.keySet()) {
if (bindingClass.isAssignableFrom(key)) {
result.add(myBindingsMap.get(bindingClass));
}
}
for (Class<?> bindingClass : myNamedBindingsMap.keySet()) {
if (bindingClass.isAssignableFrom(key)) {
result.add(myNamedBindingsMap.get(bindingClass));
}
}
if (language != Language.ANY) {
final PsiReferenceRegistrar anyRegistrar = ReferenceProvidersRegistry.getInstance().getRegistrar(Language.ANY);
Collections.addAll(result, ((PsiReferenceRegistrarImpl)anyRegistrar).myBindingCache.get(key));
}
//noinspection unchecked
return result.toArray(new ProviderBinding[result.size()]);
}
};
}
示例4: setUp
@BeforeClass
public static void setUp() {
T1 = new IElementType("T1", Language.ANY);
T2 = new IElementType("T2", Language.ANY);
fakeElements(1, 128);
T3 = new IElementType("T3", Language.ANY);
T4 = new IElementType("T4", Language.ANY);
fakeElements(201, 204);
T5 = new IElementType("T5", Language.ANY);
T6 = new IElementType("T6", Language.ANY);
}
示例5: getLanguage
@Override
@NotNull
public Language getLanguage() {
if (myTarget instanceof PsiTarget) {
return ((PsiTarget)myTarget).getNavigationElement().getLanguage();
}
return Language.ANY;
}
示例6: getScriptLanguageToInject
/**
* Finds language to be injected into <script> tag
*
* @param xmlTag <script> tag
* @return language to inject or null if no language found or not a script tag at all
*/
@Nullable
public static Language getScriptLanguageToInject(@NotNull XmlTag xmlTag) {
if (!HtmlUtil.isScriptTag(xmlTag)) {
return null;
}
String mimeType = xmlTag.getAttributeValue("type");
Collection<Language> languages = Language.findInstancesByMimeType(mimeType);
return !languages.isEmpty() ? languages.iterator().next() : Language.ANY;
}
示例7: getAllFilterValues
@NotNull
@Override
protected Collection<Language> getAllFilterValues() {
final Collection<Language> registeredLanguages = Language.getRegisteredLanguages();
List<Language> accepted = new ArrayList<Language>();
for (Language language : registeredLanguages) {
if (language != Language.ANY && !(language instanceof DependentLanguage)) {
accepted.add(language);
}
}
Collections.sort(accepted, LanguageUtil.LANGUAGE_COMPARATOR);
return accepted;
}
示例8: advance
@Override
public void advance() {
final IElementType tokenType = myDelegate.getTokenType();
if (tokenType == XmlTokenType.XML_COMMENT_CHARACTERS) {
scanWordsInToken(UsageSearchContext.IN_COMMENTS, false, false);
advanceTodoItemCountsInToken();
} else if (tokenType == XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN ||
tokenType == XmlTokenType.XML_NAME ||
tokenType == XmlTokenType.XML_TAG_NAME
) {
scanWordsInToken(UsageSearchContext.IN_PLAIN_TEXT | UsageSearchContext.IN_FOREIGN_LANGUAGES, tokenType ==
XmlTokenType.XML_ATTRIBUTE_VALUE_TOKEN,
false);
} else if (tokenType.getLanguage() != XMLLanguage.INSTANCE &&
tokenType.getLanguage() != Language.ANY
) {
boolean inComments = CacheUtil.isInComments(tokenType);
scanWordsInToken((inComments)?UsageSearchContext.IN_COMMENTS:UsageSearchContext.IN_PLAIN_TEXT | UsageSearchContext.IN_FOREIGN_LANGUAGES, true,
false);
if (inComments) advanceTodoItemCountsInToken();
}
else if (!XmlFilterLexer.ourNoWordsTokenSet.contains(tokenType)) {
scanWordsInToken(UsageSearchContext.IN_PLAIN_TEXT, false, false);
}
myDelegate.advance();
}
示例9: getLanguage
@NotNull
@Override
public Language getLanguage() {
return Language.ANY;
}
示例10: getLanguage
@Override
@NotNull
public Language getLanguage() {
return Language.ANY;
}
示例11: MockLanguageFileType
private MockLanguageFileType() {
super(Language.ANY);
}
示例12: getNotAnyLanguage
public static Language getNotAnyLanguage(ASTNode node) {
if (node == null) return Language.ANY;
final Language lang = node.getElementType().getLanguage();
return lang == Language.ANY ? getNotAnyLanguage(node.getTreeParent()) : lang;
}
示例13: fakeElements
private static void fakeElements(int from, int to) {
for (int i = from; i <= to; i++) {
new IElementType("Test element #" + i, Language.ANY);
}
}
示例14: MultiplePsiFilesPerDocumentFileViewProvider
public MultiplePsiFilesPerDocumentFileViewProvider(PsiManager manager, VirtualFile virtualFile, boolean eventSystemEnabled) {
super(manager, virtualFile, eventSystemEnabled, Language.ANY);
}
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:3,代碼來源:MultiplePsiFilesPerDocumentFileViewProvider.java
示例15: ScopeTokenType
public ScopeTokenType(@NotNull @NonNls final String debugName) {
super(debugName, Language.ANY);
}