feat: support hover provider feat #194
Open
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.
功能
支持
HoverProvider的开发描述
在我们dt-sql-parser内部,
CommonEntityContext实体被收集的时候,区分了是新建还是使用,如果是新建的情况下,会从当前CREATE语句中捞到columns挂在当前实体上,而我们当前功能就是当用户使用通过SQL新建出来的表时,使用表的地方hover到表名上方,可以展示出对应的字段列表,字段列表里包含字段名以及字段类型。preview
https://cythia828.github.io/monaco-sql-languages/
自测
demo
CREATE TABLE postgresql.public.employees ( emp_id BIGINT COMMENT 'sfsf', name VARCHAR, department VARCHAR ) WITH ( connector = 'postgresql', connection_url = 'jdbc:postgresql://localhost:5432/company', connection_user = 'user', connection_password = 'password' ); select emp_id from postgresql.public.employees as tb1 select id from "postgresql.public.employees" select name from 'postgresql.public.employees' select name frompostgresql.public.employees``