rokucommunity / rokucommunity/brighterscript

Validation of CDATA script methods inside XML

Open
#318 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
208
Forks
68
Avg merge
8h 39m
Merged PRs (30d)
39

Description

Currently, I have a few components that don't have their own dedicated brs files, but a small CDATA script:

<?xml version="1.0" encoding="UTF-8"?>
<component name="TestComponent" extends="ContentNode" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://devtools.web.roku.com/schema/RokuSceneGraph.xsd">
	<interface>
		<function name="testFunction" />
	</interface>

	<script type="text/brightscript">
		<![CDATA[
			function testFunction()
				print "this is a test"
			end function
		]]>
	</script>
</component>

This is causing validation errors:

Cannot find function with name 'testFunction' in component scope

I'm also not aware of any way to disable bsc validation inside XML files.

It would be great if disabling validation for some XML line is enabled, and if CDATA function detection is working correctly. Thanks.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the supplied XML component with bsc validation enabled, focusing on the CDATA script and its testFunction declaration. Trace how XML CDATA functions are detected and how validation-disable behavior is handled; done means the example validates correctly or has a documented way to suppress the relevant XML validation error.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.