Add <field> and <function> completions in xml interfaces#1748
Open
chrisdp wants to merge 3 commits into
Open
Conversation
Provide IntelliSense in .xml component files, driven by the built-in roku-types node metadata and project components. - Program: getSceneGraphNodeNames/getSceneGraphNodeFields (resolves the extends chain across built-in nodes and project components), hasSceneGraphNode, getSceneGraphNode - XmlFile.getCompletions: element (tag name) completions after `<` and in element content, and field (attribute) completions inside a start tag; adds getTokenAt for token-at-position lookups - LanguageServer: add `<` as a completion trigger character - SGParser: skip malformed child elements with no tag name instead of throwing (a lone `<` while typing) - roku-types: add `extends` to SGNodeData
Node and component element completions were appearing everywhere in element content (the component root, inside <interface>, etc.). Gate them on the enclosing element so they only appear inside a <children> block or nested inside another node; other locations now yield no node completions.
Inside an <interface> block, offer <field> and <function> element completions, and inside a <field>/<function> start tag offer their attributes (id, type, value, onChange, alwaysNotify, alias / name).
Contributor
Author
|
Still need to address the following:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extend XML completions to the
<interface>block:<interface>, offer<field>and<function>element completions.<field>start tag, offer its attributes (id,type,value,onChange,alwaysNotify,alias).<function>start tag, offername.Builds on #1741. The existing xml snippets are unchanged.