-
Notifications
You must be signed in to change notification settings - Fork 47
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
feat: add reference and definition provider #145
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How can I use them? |
liuxy0551
reviewed
Oct 9, 2024
HaydenOrz
reviewed
Oct 21, 2024
deploy website到自己的仓库上,让review的人可以预览 |
@Cythia828 将 |
|
540687d
to
59a541e
Compare
59a541e
to
ee61c06
Compare
JackWang032
reviewed
Nov 26, 2024
liuxy0551
approved these changes
Feb 13, 2025
JackWang032
approved these changes
Feb 13, 2025
mumiao
approved these changes
Feb 13, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
feat
支持 #162 跳转到定义、跳转到引用位置功能
需要注意
Shift+F12
,但由于大家的使用习惯是Command+click
,所以需要关注下当你在 Monaco Editor 中配置 references 为 true 而 definitions 为 false 时,Command + Click (或 Ctrl + Click) 无法跳转到引用,这是因为 Monaco Editor 的默认行为是:Command + Click 主要用于跳转到 定义 (definitions),而不是引用 (references)。 即使你启用了 references 功能,Command + Click 仍然优先处理 DefinitionProvider,因为它被设计为跳转到定义的快捷方式。
ReferenceProvider 提供的是“查找所有引用”的功能,这通常通过右键菜单或自定义命令来触发,而不是 Command + Click。 Command + Click 的行为是由 Monaco Editor 的核心功能决定的,它与 ReferenceProvider 和 DefinitionProvider 的启用状态之间没有直接的逻辑关联。 Command + Click 始终优先尝试跳转到定义,只有当 DefinitionProvider 无法提供定义时,它才可能尝试其他行为。
常规使用跳转到定义、引用功能时,我们都是配套打开的,此时,我们通过Command + Click 可以进行跳转到定义和引用。通常不会只打开跳转到引用,而不打开跳转到定义。如果只打开跳转到引用,而不打开跳转到定义,那么我们通过 右键唤起菜单跳到引用,通过选择某一个具体引用进行跳转,这个操作也是流畅且合理的。
预览
预览地址
https://cythia828.github.io/monaco-sql-languages/