Skip to content

Add <field> and <function> completions in xml interfaces - #1748

Open
chrisdp wants to merge 7 commits into
masterfrom
feature/xml-field-function-completions
Open

Add <field> and <function> completions in xml interfaces#1748
chrisdp wants to merge 7 commits into
masterfrom
feature/xml-field-function-completions

Conversation

@chrisdp

@chrisdp chrisdp commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Extend XML completions to the <interface> block:

  • Inside <interface>, offer <field> and <function> element completions.
  • Inside a <field> start tag, offer its attributes (id, type, value, onChange, alwaysNotify, alias).
  • Inside a <function> start tag, offer name.

Builds on #1741. The existing xml snippets are unchanged.

chrisdp added 3 commits July 7, 2026 12:32
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).
Base automatically changed from feature/xml-completions to master July 8, 2026 12:24
@chrisdp

chrisdp commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

Still need to address the following:

  • completions for the values of type, onChange, alwaysNotify, and aliasinfield` tag
  • completions for name in function tag

@chrisdp chrisdp self-assigned this Jul 16, 2026
TwitchBronBron and others added 2 commits August 10, 2026 14:13
`<` was registered as a server-wide completion trigger for xml element
completions, but it's the less-than operator in brightscript, so every
`<` keystroke in a .brs/.bs file popped the full scope completion list.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Six node entries in the scraped roku-types data have no `extends` key
(MonospaceLabel, InfoPane, ParentalControlPinPad, TimeGrid, ZoomRowList,
and the 'Key Definition File' doc entry), so getSceneGraphNodeFields
stopped walking and returned few or zero fields for them. Every
SceneGraph node ultimately descends from Node, so walk Node when
extends is absent.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…unction-completions

# Conflicts:
#	src/Program.spec.ts
#	src/Program.ts
#	src/files/XmlFile.spec.ts
#	src/files/XmlFile.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants