-
Notifications
You must be signed in to change notification settings - Fork 46
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
替换 Monaco 内置的图标 #105
Labels
new features
New feature or request
Comments
@HaydenOrz 你好,我想提示column的信息,需要获取table的名称,要如何获取啊 |
css覆盖使用svg可以先将content内容清空,再用background设置即可。比如: .codicon-symbol-file:before {
content: '' !important;
width: 16px;
height: 16px;
background: url('../assets/svg/database.svg') no-repeat 0 0/16px 16px;
}
.codicon-symbol-class:before {
content: '' !important;
width: 16px;
height: 16px;
background: url('../assets/svg/table.svg') no-repeat 0 0/16px 16px;
}
.codicon-symbol-field:before {
content: '' !important;
width: 16px;
height: 16px;
background: url('../assets/svg/column.svg') no-repeat 0 0/16px 16px;
} |
你好,我想请问下这种情况下如何判断这个svg是否被选中,需要改变颜色 |
@apankun 选中后的类名区分 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Why?
monaco-sql-languages 支持的 language 都是各种 SQL,与之对应的就会有许多符号/icon是SQL语言特有的,比如 database 、table 等,而monaco 内置并不支持这些符号/icon,目前自动补全项左侧的 icon 问题尤为明显:
方案概述
字体图标风格
与monaco/vscode 的字体图标风格保持一致 https://code.visualstudio.com/api/references/icons-in-labels#icon-listing
字体图标表
SQL 补全项类型与 monaco 内置的 CompletionItemKind 映射表
自动补全项左侧会根据不同的自动补全项的
CompletionItemKind
属性显示不同的 icon,但是内置的类型并不能覆盖所有的 SQL 补全项类型,比如 table、database 等,所以需要一个类型映射同时,monaco-sql-languages 需要新增公开的辅助方法,用于将 dt-sql-parser 中的 实体类型(
EntityContextType
/SyntaxContextType
)转换为CompletionItemKind
覆盖 icon 的 css 文件参考
每一种类型对应的icon 类名格式为:
.codicon-${built-in-icon-name}
内置的 icon 名称看这里: https://code.visualstudio.com/api/references/icons-in-labels#icon-listing
自动补全项的icon名称都是以
symbol-
为前缀的The text was updated successfully, but these errors were encountered: