Skip to content

Commit 4033e21

Browse files
committed
- fix: correctly resolve internal ember components
1 parent b6423fb commit 4033e21

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
Changelog
44
===============================================================================
5+
## v2020.3.29
6+
- fix: correctly resolve internal ember components
7+
58
## v2020.3.28
69
- fix: correctly resolve paths from args and fix completion
710

src/main/kotlin/com/emberjs/EmberXmlElementDescriptor.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ class EmberXmlElementDescriptor(private val tag: XmlTag, private val declaration
8181
f = EmberUtils.followReferences(target)?.containingFile?.originalFile
8282
val file = f ?: target.containingFile.originalFile
8383

84+
if (file.name == "intellij-emberjs/internal/components-stub") {
85+
return EmberUtils.getComponentReferenceData(target)
86+
}
87+
8488
return EmberUtils.getComponentReferenceData(file)
8589
}
8690

src/main/kotlin/com/emberjs/utils/EmberUtils.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,9 @@ class EmberUtils {
362362
return null
363363
}
364364

365-
fun getComponentReferenceData(file: PsiFile): ComponentReferenceData {
366-
var name = file.name.split(".").first()
367-
val dir = file.parent as PsiDirectoryImpl?
365+
fun getComponentReferenceData(file: PsiElement): ComponentReferenceData {
366+
var name = file.containingFile.name.split(".").first()
367+
val dir = file.containingFile.parent as PsiDirectoryImpl?
368368
var template: PsiFile? = null
369369
var path = ""
370370
var parentModule: PsiDirectory? = null

src/main/resources/com/emberjs/external/ember-components.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ class InputComponent extends Component<{
279279
/**
280280
* This argument is used to control which Ember component is used under the hood
281281
*/
282-
type?: 'checkbox|button|color|date|datetime-local|email|file|hidden|image|month|number|password|radio|range|reset|search|submit|tel|text|time|url|week'
282+
type?: 'checkbox'|'button'|'color'|'date'|'datetime-local'|'email'|'file'|'hidden'|'image'|'month'|'number'|'password'|'radio'|'range'|'reset'|'search'|'submit'|'tel'|'text'|'time'|'url'|'week'
283283
'enter'?: Function,
284284
'insert-newline'?: Function,
285285
'escape-press'?: Function,

0 commit comments

Comments
 (0)