File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
idea/idea-analysis/src/org/jetbrains/kotlin/idea/project Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 11
11
12
12
### IDE
13
13
14
+ - Do not spam idea.log with "Using default platform" message during debug
15
+
14
16
#### Debugger
15
17
16
18
- Do not cast to runtime type unavailable in current scope
Original file line number Diff line number Diff line change 22
22
import com .intellij .openapi .vfs .VirtualFile ;
23
23
import org .jetbrains .annotations .NotNull ;
24
24
import org .jetbrains .kotlin .js .resolve .JsPlatform ;
25
+ import org .jetbrains .kotlin .psi .KtCodeFragment ;
25
26
import org .jetbrains .kotlin .psi .KtFile ;
26
27
import org .jetbrains .kotlin .resolve .TargetPlatform ;
27
28
import org .jetbrains .kotlin .resolve .jvm .platform .JvmPlatform ;
@@ -35,6 +36,13 @@ private TargetPlatformDetector() {
35
36
36
37
@ NotNull
37
38
public static TargetPlatform getPlatform (@ NotNull KtFile file ) {
39
+ if (file instanceof KtCodeFragment ) {
40
+ KtFile contextFile = ((KtCodeFragment ) file ).getContextContainingFile ();
41
+ if (contextFile != null ) {
42
+ return getPlatform (contextFile );
43
+ }
44
+ }
45
+
38
46
VirtualFile virtualFile = file .getOriginalFile ().getVirtualFile ();
39
47
if (virtualFile == null ) {
40
48
return getDefaultPlatform ();
You can’t perform that action at this time.
0 commit comments