Skip to content

feat: support vue-sfc language in ui-template editor - #426

Merged
Steve-Mcl merged 3 commits into
mainfrom
vue-sfc-support
Oct 15, 2026
Merged

Steve-Mcl merged 3 commits into
mainfrom
vue-sfc-support

Conversation

@Steve-Mcl

Copy link
Copy Markdown
Contributor

Description

Adds vue-sfc support for the ui-template editor. FlowFuse/node-red-dashboard#2290 switches ui-template's Monaco language to vue-sfc when the Vue SFC editor is available. nr-assistant currently only registers its ui-template CodeLens and inline completions for html, so neither appears in that editor.

  • Register the ui-template CodeLens for vue-sfc as well as html
  • Add a vue-sfc entry to supportedInlineCompletions, using the html indentation rules
  • Treat vue-sfc like html in isInsideComment

The html registrations are unchanged, so older dashboard versions keep working. FIM requests from the template part now send languageId: 'vue-sfc', so the FIM backend must accept it before this is released.

Dashboard only uses vue-sfc with nr-assistant 0.21.0 or later (so this needs to be released as a minor version).

Testing

Tested manually with the dashboard PR branch: CodeLens shows, completions work in the template, <script> and <style>, and are skipped inside <!-- -->.

None of this code has test coverage, since it's inline in index.html. I considered moving isInsideComment into sharedUtils.js to test it, but didn't think it was worth it for this change.

Related Issue(s)

FlowFuse/node-red-dashboard#2290

Checklist

  • I have read the contribution guidelines
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated
    • Upgrade instructions
    • Configuration details
    • Concepts
  • Changes flowforge.yml?
    • Issue/PR raised on FlowFuse/helm to update ConfigMap Template
    • Issue/PR raised on FlowFuse/CloudProject to update values for Staging/Production
  • Link to Changelog Entry PR, or note why one is not needed.

Labels

  • Includes a DB migration? -> add the area:migration label

The ui-template code editor uses a "vue-sfc" Monaco language when the
dashboard provides its Vue SFC editor. Register the ui-template CodeLens
and inline completions for vue-sfc alongside html, use the html
indentation rules for it, and treat it like html when checking for
comments.

@n-lark n-lark left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Dashboard keeps ui-template on html unless nr-assistant says it can
handle vue-sfc, so older nr-assistant installs don't lose Expert
completions and the CodeLens. Set supportsVueSfc on the plugin so
Dashboard can switch to vue-sfc.
@Steve-Mcl
Steve-Mcl requested a review from n-lark October 14, 2026 18:14
@Steve-Mcl

Copy link
Copy Markdown
Contributor Author

Added the explicit flag supportsVueSfc so that dashboard doesnt have to jump through hoops to know if support is present.

Please re-approve if OK

@Steve-Mcl
Steve-Mcl requested a review from andypalmi October 15, 2026 08:31
@Steve-Mcl
Steve-Mcl merged commit 7515f07 into main Oct 15, 2026
8 checks passed
@Steve-Mcl
Steve-Mcl deleted the vue-sfc-support branch October 15, 2026 12:45
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.

3 participants