Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] 自定义yaml语言的DocumentModel,在monaco实例下编辑,问题面板错误提示badge是错误的 #3678

Open
yinyinfurongzmr opened this issue May 15, 2024 · 4 comments
Labels
🐞 bug Something isn't working

Comments

@yinyinfurongzmr
Copy link

自定义yaml语言的documentModel,创建monaco实例, 在这个实例下编辑,输入错误的格式,插件redhat.yaml报错,底部问题面板(@opensumi/ide-markers)有错误提示信息, 但badge提示是错误的,

使用自定义documentModel的编辑器实例下编辑,问题面板bade错误,但常规yaml文件可以提示
image
image

复现路径(To Reproduce)
代码使用ide-electron 2.26.4.,使用redhat.yaml 编辑, 去掉了之前项目默认的vscode.yaml,代码在modules/demoError下

  1. 安装redhat.yaml
  2. 运行pnpm watch、pnpm start后,打开electron后,新建个rui为后缀的文件
  3. 点击rui后缀文件,展示there is other contents
  4. 点击右上角代码图标,在there is other contents 后,展示monaco编辑器
  5. 在“# RUI Yaml 格式”这行下面写入错误的yaml eg:dd:1, (无空格),
  6. 点击底部问题面板,可以看到错误提示信息,但没有错误提示badge

偶尔会有提示信息慢的场景

预期表现(Expected behavior)

  • 问题面板正常提示错误badge
  • 错误提示及时

环境信息(Environment)

  • OS: Windows10
  • Browser: electron
  • OpenSumi Version: 2.26.4
@yinyinfurongzmr yinyinfurongzmr added the 🐞 bug Something isn't working label May 15, 2024
@yinyinfurongzmr
Copy link
Author

自定义documentModelProvider
image
contribution里
`
import { TokenCustomEditorDocumentContentProvider, CustomEditorDocumentContentProvider } from './document-provider';
@Domain(BrowserEditorContribution)
class EtReactUiContribution implements BrowserEditorContribution {
@Autowired(TokenCustomEditorDocumentContentProvider)
private readonly customEditorDocumentContentProvider: IEditorDocumentModelContentProvider;

// 注册自定义的 DocumentModelContentProvider
registerEditorDocumentModelContentProvider(registry: IEditorDocumentModelContentRegistry): void {
registry.registerEditorDocumentModelContentProvider(this.customEditorDocumentContentProvider);
}
`
editorDomRef是view内一个div
editorCollectionService是依赖注入的EditorCollectionService的实例
docManager是依赖注入的IEditorDocumentModelService类型的实例
image

@yinyinfurongzmr
Copy link
Author

断点
image
marker为空数组,没找到marker

@Ricbet
Copy link
Member

Ricbet commented May 15, 2024

我本地 main 分支没有复现这个问题

或许你可以排查一下 markers-manager.ts 的 updateMarkers 方法有没有被触发

@yinyinfurongzmr
Copy link
Author

yinyinfurongzmr commented May 16, 2024

确定被触发,我是用ide-electron 2.26.4 写的,可提供可复现demo https://gitee.com/zhangmeirong/opensumi-electron-demo @Ricbet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants