Skip to content

Commit a3ce51b

Browse files
authored
JSX completions (microsoft#863)
1 parent 29b98d2 commit a3ce51b

File tree

5 files changed

+433
-145
lines changed

5 files changed

+433
-145
lines changed

internal/checker/services.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,3 +468,16 @@ func (c *Checker) GetExportsAndPropertiesOfModule(moduleSymbol *ast.Symbol) []*a
468468
func (c *Checker) getExportsOfModuleAsArray(moduleSymbol *ast.Symbol) []*ast.Symbol {
469469
return symbolsToArray(c.getExportsOfModule(moduleSymbol))
470470
}
471+
472+
// Returns all the properties of the Jsx.IntrinsicElements interface.
473+
func (c *Checker) GetJsxIntrinsicTagNamesAt(location *ast.Node) []*ast.Symbol {
474+
intrinsics := c.getJsxType(JsxNames.IntrinsicElements, location)
475+
if intrinsics == nil {
476+
return nil
477+
}
478+
return c.GetPropertiesOfType(intrinsics)
479+
}
480+
481+
func (c *Checker) GetContextualTypeForJsxAttribute(attribute *ast.JsxAttributeLike) *Type {
482+
return c.getContextualTypeForJsxAttribute(attribute, ContextFlagsNone)
483+
}

0 commit comments

Comments
 (0)