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]: 为什么函数参数的 syntaxContextType 没有 column ? #379

Open
defghy opened this issue Dec 29, 2024 · 2 comments
Open

[Bug]: 为什么函数参数的 syntaxContextType 没有 column ? #379

defghy opened this issue Dec 29, 2024 · 2 comments
Assignees
Labels
improvement Improve existing feature

Comments

@defghy
Copy link

defghy commented Dec 29, 2024

Version

v4.0.2

Which SQL?

Hive

SQL content

SELECT concat(<cursor_pos>as c from tb -- 这里<cursor_pos>是游标位置;

SELECT concat(a, b) as c from tb -- 正常的语句

JavaScript/TypeScript code

No response

What happened?

这里我觉得 syntaxContextType 应该是 'function' 或者 'column',但是 getSuggestionAtCaretPosition 返回的结果没有column
image

这样我就没办法给用户提示出 tb 下的列名了

官方demo页面可以复现:https://dtstack.github.io/monaco-sql-languages/

Relevant log output

No response

@liuxy0551 liuxy0551 self-assigned this Dec 30, 2024
@JackWang032
Copy link
Collaborator

函数参数的语法树结构里并没有包含columnList, 所以收集到的上下文中不会是column,要解决需要额外为函数参数添加一个上下文类型。
image

@JackWang032 JackWang032 added the improvement Improve existing feature label Jan 8, 2025
@liuxy0551
Copy link
Collaborator

同时涉及到其他语言,需要同步处理。初步判断可以添加一个 functionParams 的规则,该规则支持 columnName

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improve existing feature
Projects
None yet
Development

No branches or pull requests

3 participants