如何监控文件的打开与关闭?
#2695
-
我想监控工作空间的文件打开和关闭,用来执行相应的操作,应该怎么做哪? |
Beta Was this translation helpful? Give feedback.
Answered by
erha19
May 11, 2023
Replies: 2 comments 1 reply
-
@hanbingzi 你要监听用户的编辑器操作,可以通过插件,也可以在模块内通过监听这三个事件去获取:
参考用法:#1494 (comment) |
Beta Was this translation helpful? Give feedback.
1 reply
-
@hanbingzi 可以用下面这种方式: @Autowired(WorkbenchEditorService)
private readonly editorService: WorkbenchEditorServiceImpl;
this.editorService.onActiveResourceChange((resource) => {
...
}) 额外的方法可以自己看一下 TS 声明信息 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
hanbingzi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@hanbingzi 可以用下面这种方式:
额外的方法可以自己看一下 TS 声明信息