You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Mac OS下VS Code中PlantUML代码语法错误排查求助

PlantUML语法错误排查

问题描述

我在Mac OS系统的VS Code中使用PlantUML扩展,此前仅使用过app.diagram,无PlantUML使用经验。我的代码如下:

@startuml shortform
title shortform
actor faris as  user
control x as SOA


database Doc MS as Doc service

control miniapps as app

database google
collections EDA
EDA -> SOA : whitelisted data
@enduml

尝试调试后仍出现如下错误:

Error found in diagram shortform
ERROR
3
Syntax Error?
Some diagram description contains errors

错误行及修正方案

  • 第3行:actor faris as user:as后的别名不能有前置空格,修正为actor faris as user
  • 第7行:database Doc MS as Doc service:参与者名称和别名不能包含未包裹的空格,可改为database "Doc MS" as "Doc service"(用引号包裹带空格的名称),或者去掉空格改为database DocMS as DocService
  • 第11行:collections EDA:时序图中没有复数形式的collections关键字,需改为单数collection EDA

内容的提问来源于stack exchange,提问作者Adi Prasetyo

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.19 19:08:10