mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -28,8 +28,8 @@ public class VirtualFileWindowImpl extends LightVirtualFile implements VirtualFi
|
||||
private final VirtualFile myDelegate;
|
||||
private final DocumentWindowImpl myDocumentWindow;
|
||||
|
||||
public VirtualFileWindowImpl(@NotNull VirtualFile delegate, @NotNull DocumentWindowImpl window, @NotNull Language language, @NotNull CharSequence text) {
|
||||
super(delegate.getName(), language, text);
|
||||
public VirtualFileWindowImpl(@NotNull String name, @NotNull VirtualFile delegate, @NotNull DocumentWindowImpl window, @NotNull Language language, @NotNull CharSequence text) {
|
||||
super(name, language, text);
|
||||
setCharset(delegate.getCharset());
|
||||
setFileType(language.getAssociatedFileType());
|
||||
|
||||
|
||||
+12
-2
@@ -56,6 +56,7 @@ import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.psi.util.PsiUtilCore;
|
||||
import com.intellij.testFramework.LightVirtualFile;
|
||||
import com.intellij.util.Function;
|
||||
import com.intellij.util.PathUtil;
|
||||
import com.intellij.util.SmartList;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
@@ -77,6 +78,7 @@ public class MultiHostRegistrarImpl implements MultiHostRegistrar, ModificationT
|
||||
private StringBuilder outChars;
|
||||
private boolean isOneLineEditor;
|
||||
private boolean cleared;
|
||||
private String fileExtension;
|
||||
private final Project myProject;
|
||||
private final PsiManager myPsiManager;
|
||||
private final DocumentEx myHostDocument;
|
||||
@@ -128,7 +130,9 @@ public class MultiHostRegistrarImpl implements MultiHostRegistrar, ModificationT
|
||||
myReferenceInjector = injector;
|
||||
}
|
||||
myLanguage = language;
|
||||
|
||||
// todo uncomment
|
||||
//LanguageFileType fileType = myLanguage.getAssociatedFileType();
|
||||
//fileExtension = fileType == null ? null : fileType.getDefaultExtension();
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -137,11 +141,16 @@ public class MultiHostRegistrarImpl implements MultiHostRegistrar, ModificationT
|
||||
shreds.clear();
|
||||
outChars.setLength(0);
|
||||
isOneLineEditor = false;
|
||||
fileExtension = null;
|
||||
myLanguage = null;
|
||||
|
||||
cleared = true;
|
||||
}
|
||||
|
||||
public void setFileExtension(@Nullable String fileExtension) {
|
||||
this.fileExtension = fileExtension;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public MultiHostRegistrar addPlace(@NonNls @Nullable String prefix,
|
||||
@@ -209,7 +218,8 @@ public class MultiHostRegistrarImpl implements MultiHostRegistrar, ModificationT
|
||||
|
||||
Place place = new Place(shreds);
|
||||
DocumentWindowImpl documentWindow = new DocumentWindowImpl(myHostDocument, isOneLineEditor, place);
|
||||
VirtualFileWindowImpl virtualFile = new VirtualFileWindowImpl(myHostVirtualFile, documentWindow, myLanguage, outChars);
|
||||
String fileName = PathUtil.makeFileName(myHostVirtualFile.getName(), fileExtension);
|
||||
VirtualFileWindowImpl virtualFile = new VirtualFileWindowImpl(fileName, myHostVirtualFile, documentWindow, myLanguage, outChars);
|
||||
Language forcedLanguage = myContextElement.getUserData(InjectedFileViewProvider.LANGUAGE_FOR_INJECTED_COPY_KEY);
|
||||
myLanguage = forcedLanguage == null ? LanguageSubstitutors.INSTANCE.substituteLanguage(myLanguage, virtualFile, myProject) : forcedLanguage;
|
||||
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
// This file contains list of broken plugins.
|
||||
// Each line contains plugin ID and list of versions that are broken.
|
||||
// If plugin name or version contains a space you can quote it like in command line.
|
||||
NodeJS 143.444 143.379 142.4426 142.4100 142.3858 142.3224 142.2650 142.2492 142.2481 142.2064 141.1108 140.2045 140.1669 140.642 139.173 139.105 139.496 139.1 139.8 138.2196 138.2254 138.1684 138.1744 138.1879 138.2051 138.1367 138.1495 138.1189 138.1145 138.937 138.1013 138.921 138.447 138.172 138.317 138.21 138.35 138.96 138.85 136.1205 134.1276 134.1163 134.1145 134.1081 134.1039 134.985 134.680 134.31 134.307 134.262 134.198 134.125 136.1141
|
||||
com.jetbrains.php 142.2716 142.3969 142.4491 140.2765 141.332 139.732 139.659 139.496 139.173 139.105 138.2502 138.2000.2262 138.1751 138.1806 138.1505 138.1161 138.826 136.1768 136.1672 134.1456 133.982 133.679 133.51 133.326 131.98 131.374 131.332 131.235 131.205 130.1639 130.1481 130.1176 129.91 129.814 129.672 129.362 127.67 127.100 126.334 123.66 122.875 121.62 121.390 121.215 121.12
|
||||
NodeJS 143.444 143.379.15 143.21 143.110 143.250 142.4426 142.4100 142.3858 142.3224 142.2650 142.2492 142.2481 142.2064 141.1108 140.2045 140.1669 140.642 139.173 139.105 139.496 139.1 139.8 138.2196 138.2254 138.1684 138.1744 138.1879 138.2051 138.1367 138.1495 138.1189 138.1145 138.937 138.1013 138.921 138.447 138.172 138.317 138.21 138.35 138.96 138.85 136.1205 134.1276 134.1163 134.1145 134.1081 134.1039 134.985 134.680 134.31 134.307 134.262 134.198 134.125 136.1141
|
||||
com.jetbrains.php 143.129 142.5282 142.2716 142.3969 142.4491 140.2765 141.332 139.732 139.659 139.496 139.173 139.105 138.2502 138.2000.2262 138.1751 138.1806 138.1505 138.1161 138.826 136.1768 136.1672 134.1456 133.982 133.679 133.51 133.326 131.98 131.374 131.332 131.235 131.205 130.1639 130.1481 130.1176 129.91 129.814 129.672 129.362 127.67 127.100 126.334 123.66 122.875 121.62 121.390 121.215 121.12
|
||||
com.jetbrains.lang.ejs 131.17 131.12
|
||||
com.jetbrains.twig 133.51 130.1639
|
||||
org.jetbrains.plugins.ruby 8.0.0.20180821 8.0.0.20150708 8.0.0.20150624 8.0.0.20150616 7.0.0.20150216 7.0.0.20150204 7.0.0.20141010 7.0.0.20140915 7.0.0.20140901 7.0.0.20140807 6.0.0.20140207 6.5.2.20140512 7.0.0.20140704 7.0.0.20140707 7.0.0.20140724
|
||||
Pythonid "142.176 v4.5" 4.1 "4.1 141.4 EAP" 3.1 4.0.25 4.0.26
|
||||
org.jetbrains.plugins.ruby 8.0.0.20151005 8.0.0.20180821 8.0.0.20150708 8.0.0.20150624 8.0.0.20150616 7.0.0.20150216 7.0.0.20150204 7.0.0.20141010 7.0.0.20140915 7.0.0.20140901 7.0.0.20140807 6.0.0.20140207 6.5.2.20140512 7.0.0.20140704 7.0.0.20140707 7.0.0.20140724
|
||||
Pythonid 5.0.143.53 5.0.142.2 "142.176 v4.5" 4.1 "4.1 141.4 EAP" 3.1 4.0.25 4.0.26
|
||||
Karma 142.3390 142.2492 142.2064 140.2109 138.1684 138.1879 138.317 138.21 134.1163 134.1039 134.686 134.31
|
||||
org.intellij.scala 1.8.5 1.8.0 1.8.2 1.8.4 1.7.4 1.7.2 1.6.2 1.6.1 1.6.0 1.2.67.3.EAP 1.3.2-14.1 1.3.3-14.1 1.0.93.10.EAP 1.0.93.4.EAP 1.0.93.9.EAP 1.0.58 1.0.16 1.0.14 1.0.13 0.42.28 0.42.23 0.40.20 0.40.18 0.40.16 0.32.593 0.32.562 0.32.558 0.32.550 0.32.520 0.32.512
|
||||
org.intellij.scala 1.9.2 1.8.5 1.8.0 1.8.2 1.8.4 1.7.4 1.7.2 1.6.2 1.6.1 1.6.0 1.2.67.3.EAP 1.3.2-14.1 1.3.3-14.1 1.0.93.10.EAP 1.0.93.4.EAP 1.0.93.9.EAP 1.0.58 1.0.16 1.0.14 1.0.13 0.42.28 0.42.23 0.40.20 0.40.18 0.40.16 0.32.593 0.32.562 0.32.558 0.32.550 0.32.520 0.32.512
|
||||
org.jetbrains.kannotator 0.2.420
|
||||
org.jetbrains.kotlin 0.10.555 0.10.4 0.8.1615 0.7.1360 0.7.1376 0.8.7
|
||||
SBT 1.0.0 1.1.0 1.2.0 1.3.0 1.3.1 1.4.0 1.5.0 1.5.1 1.6.0 1.6.1
|
||||
SBT 1.0.0 1.1.0 1.2.0 1.3.0 1.3.1 1.4.0 1.5.0 1.5.1 1.6.0 1.6.1 1.7.0
|
||||
"JSTestDriver Plugin" 142.2492 142.2064 140.2109 140.1669 140.727 138.317 138.21 136.1141 134.1163 134.686 134.31 134.307 134.1039
|
||||
AngularJS 141.1237 141.991 142.2481 142.4081 142.1935 141.2 140.1968 139.1112 139.12 134.1243 134.1341 134.1444 135.1063 135.565 135.831 135.937 138.1242 138.1988 134.1094 0.1.8 0.1.9
|
||||
com.jetbrains.plugins.ini4idea 0.4 0.5 0.6 0.7 0.8 0.8.1 0.9 0.9.1 1.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 130.1176
|
||||
org.jetbrains.plugins.vagrant 0.1 0.2 0.3 0.4 0.5
|
||||
org.jetbrains.plugins.vagrant 0.1 0.2 0.3 0.4 0.5 0.6.143.3
|
||||
org.intellij.clojure 0.2.1.178
|
||||
net.nicoulaj.idea.markdown 0.9.5 0.9.4 0.9.3 0.9.2 0.9.1 0.8.3 0.8.2 0.8.1 0.8 0.7 0.6.1 0.6 0.5.1 0.5 0.4 0.3 0.2 0.1
|
||||
zielu.gittoolbox 13.1.0
|
||||
@@ -26,7 +26,7 @@ copy.on.steroids 3.1
|
||||
"AWS Elastic Beanstalk" 0.7.7 0.7.6 0.7.5 0.7.4 0.7.3 0.7.2 0.7.1 0.7.0 0.6.1 0.6.0 0.5.5 0.5.4 0.5.3 0.5.2 0.5.1 0.5.0
|
||||
AWSCloudFormation 0.3.9
|
||||
com.jetbrains.typoscript 0.1.1 0.1.0
|
||||
Dart 133.239 133.432 133.726 130.1494 130.549 131.17 132.1045 132.207 132.835 130.1494 131.17 0.5.1
|
||||
Dart 143.379.14 143.147 143.294 133.239 133.432 133.726 130.1494 130.549 131.17 132.1045 132.207 132.835 130.1494 131.17 0.5.1
|
||||
IdeaVIM 0.15.59 0.16.60 0.20.75 0.20.80 0.21.86 0.22.90 0.23.111 0.23.115 0.23.93 0.24-148 0.25 0.26 0.27 0.28 0.29 0.30 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39
|
||||
IDETalk 0.5 0.5.1 0.5.2 0.5.3 0.5.5 0.5.6 0.5.6.1 0.5.6.2 0.5.4 0.1.2 0.1.1 141.177.4
|
||||
com.jetbrains.plugins.meteor 142.2481
|
||||
com.jetbrains.plugins.meteor 143.379 143.360 143.88 142.2481
|
||||
+16
-1
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jetbrains.debugger;
|
||||
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
@@ -13,7 +28,7 @@ public final class DebuggerSupportUtils {
|
||||
PsiElement navigationElement = element.getNavigationElement();
|
||||
VirtualFile file = navigationElement.getContainingFile().getVirtualFile();
|
||||
if (file != null) {
|
||||
return XDebuggerUtil.getInstance().createPositionByOffset(file, navigationElement.getTextOffset());
|
||||
return XDebuggerUtil.getInstance().createPositionByElement(navigationElement);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -3016,10 +3016,9 @@ public class StringUtil extends StringUtilRt {
|
||||
return StringUtilRt.toUpperCase(a);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Contract(pure = true)
|
||||
public static String toUpperCase(@NotNull String a) {
|
||||
return StringUtilRt.toUpperCase(a).toString();
|
||||
@Contract(value = "null -> null; !null -> !null", pure = true)
|
||||
public static String toUpperCase(String a) {
|
||||
return a == null ? null : StringUtilRt.toUpperCase(a).toString();
|
||||
}
|
||||
|
||||
@Contract(pure = true)
|
||||
|
||||
+2
-9
@@ -25,7 +25,6 @@ import com.intellij.openapi.util.Trinity;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil;
|
||||
import com.intellij.psi.injection.ReferenceInjector;
|
||||
import com.intellij.psi.search.LocalSearchScope;
|
||||
import com.intellij.psi.search.searches.ReferencesSearch;
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
@@ -334,14 +333,8 @@ public class ConcatenationInjector implements ConcatenationAwareInjector {
|
||||
}
|
||||
|
||||
private void processInjectionWithContext(BaseInjection injection, boolean settingsAvailable) {
|
||||
Language language = InjectedLanguage.findLanguageById(injection.getInjectedLanguageId());
|
||||
if (language == null) {
|
||||
ReferenceInjector injector = ReferenceInjector.findById(injection.getInjectedLanguageId());
|
||||
if (injector != null) {
|
||||
language = injector.toLanguage();
|
||||
}
|
||||
else return;
|
||||
}
|
||||
Language language = InjectorUtils.getLanguage(injection);
|
||||
if (language == null) return;
|
||||
|
||||
final boolean separateFiles = !injection.isSingleFile() && StringUtil.isNotEmpty(injection.getValuePattern());
|
||||
|
||||
|
||||
@@ -20,12 +20,16 @@ import com.intellij.codeInsight.completion.CompletionUtil;
|
||||
import com.intellij.lang.Language;
|
||||
import com.intellij.lang.injection.MultiHostRegistrar;
|
||||
import com.intellij.openapi.extensions.Extensions;
|
||||
import com.intellij.openapi.fileTypes.FileType;
|
||||
import com.intellij.openapi.fileTypes.FileTypeManager;
|
||||
import com.intellij.openapi.fileTypes.LanguageFileType;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.*;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.impl.source.tree.injected.MultiHostRegistrarImpl;
|
||||
import com.intellij.psi.impl.source.tree.injected.Place;
|
||||
import com.intellij.psi.injection.ReferenceInjector;
|
||||
import com.intellij.psi.util.CachedValueProvider;
|
||||
import com.intellij.psi.util.CachedValuesManager;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
@@ -61,12 +65,22 @@ public class InjectorUtils {
|
||||
private InjectorUtils() {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static Language getLanguage(@NotNull BaseInjection injection) {
|
||||
String languageId = injection.getInjectedLanguageId();
|
||||
Language language = InjectedLanguage.findLanguageById(languageId);
|
||||
if (language != null) return language;
|
||||
ReferenceInjector injector = ReferenceInjector.findById(languageId);
|
||||
if (injector != null) return injector.toLanguage();
|
||||
FileType fileType = FileTypeManager.getInstance().getFileTypeByExtension(languageId);
|
||||
return fileType instanceof LanguageFileType? ((LanguageFileType)fileType).getLanguage() : null;
|
||||
}
|
||||
|
||||
public static boolean registerInjectionSimple(@NotNull PsiLanguageInjectionHost host,
|
||||
@NotNull BaseInjection injection,
|
||||
@Nullable LanguageInjectionSupport support,
|
||||
@NotNull MultiHostRegistrar registrar) {
|
||||
Language language = InjectedLanguage.findLanguageById(injection.getInjectedLanguageId());
|
||||
Language language = getLanguage(injection);
|
||||
if (language == null) return false;
|
||||
|
||||
InjectedLanguage injectedLanguage =
|
||||
@@ -88,22 +102,29 @@ public class InjectorUtils {
|
||||
return !ranges.isEmpty();
|
||||
}
|
||||
|
||||
public static void registerInjection(Language language, List<Trinity<PsiLanguageInjectionHost, InjectedLanguage, TextRange>> list, PsiFile containingFile, MultiHostRegistrar registrar) {
|
||||
public static void registerInjection(Language language,
|
||||
List<Trinity<PsiLanguageInjectionHost, InjectedLanguage, TextRange>> list,
|
||||
PsiFile containingFile,
|
||||
MultiHostRegistrar registrar) {
|
||||
// if language isn't injected when length == 0, subsequent edits will not cause the language to be injected as well.
|
||||
// Maybe IDEA core is caching a bit too aggressively here?
|
||||
if (language == null/* && (pair.second.getLength() > 0*/) {
|
||||
return;
|
||||
}
|
||||
boolean injectionStarted = false;
|
||||
for (Trinity<PsiLanguageInjectionHost, InjectedLanguage, TextRange> trinity : list) {
|
||||
final PsiLanguageInjectionHost host = trinity.first;
|
||||
for (Trinity<PsiLanguageInjectionHost, InjectedLanguage, TextRange> t : list) {
|
||||
PsiLanguageInjectionHost host = t.first;
|
||||
if (host.getContainingFile() != containingFile) continue;
|
||||
|
||||
final TextRange textRange = trinity.third;
|
||||
final InjectedLanguage injectedLanguage = trinity.second;
|
||||
TextRange textRange = t.third;
|
||||
InjectedLanguage injectedLanguage = t.second;
|
||||
|
||||
if (!injectionStarted) {
|
||||
registrar.startInjecting(language);
|
||||
// TextMate language requires file extension
|
||||
if (registrar instanceof MultiHostRegistrarImpl && !StringUtil.equalsIgnoreCase(language.getID(), t.second.getID())) {
|
||||
((MultiHostRegistrarImpl)registrar).setFileExtension(StringUtil.toLowerCase(t.second.getID()));
|
||||
}
|
||||
injectionStarted = true;
|
||||
}
|
||||
registrar.addPlace(injectedLanguage.getPrefix(), injectedLanguage.getSuffix(), host, textRange);
|
||||
|
||||
+2
-9
@@ -24,7 +24,6 @@ import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.openapi.util.Trinity;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil;
|
||||
import com.intellij.psi.injection.ReferenceInjector;
|
||||
import com.intellij.psi.search.LocalSearchScope;
|
||||
import com.intellij.psi.search.searches.ReferencesSearch;
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
@@ -356,14 +355,8 @@ public class GrConcatenationAwareInjector implements ConcatenationAwareInjector
|
||||
|
||||
|
||||
private void processInjectionWithContext(BaseInjection injection, boolean settingsAvailable) {
|
||||
Language language = InjectedLanguage.findLanguageById(injection.getInjectedLanguageId());
|
||||
if (language == null) {
|
||||
ReferenceInjector injector = ReferenceInjector.findById(injection.getInjectedLanguageId());
|
||||
if (injector != null) {
|
||||
language = injector.toLanguage();
|
||||
}
|
||||
else return;
|
||||
}
|
||||
Language language = InjectorUtils.getLanguage(injection);
|
||||
if (language == null) return;
|
||||
|
||||
String languageID = language.getID();
|
||||
List<Trinity<PsiLanguageInjectionHost, InjectedLanguage, TextRange>> list = ContainerUtil.newArrayList();
|
||||
|
||||
Reference in New Issue
Block a user