Skip to content

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

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

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

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

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

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

@LuckyFBB
Copy link
Collaborator

LuckyFBB commented Apr 8, 2025

@LuckyFBB 检查一下 expression 中更改之后,这个功能是否已经支持

@wonghan
Copy link

wonghan commented Apr 22, 2025

在最新版本 v4.1.1 依旧有这个问题

但是在这个DEMO没有问题 @JackWang032
https://jackwang032.github.io/monaco-sql-languages/

请问这个问题有进展了吗?

@mumiao
Copy link
Collaborator

mumiao commented Apr 22, 2025

在最新版本 v4.1.1 依旧有这个问题

但是在这个DEMO没有问题 @JackWang032 https://jackwang032.github.io/monaco-sql-languages/

请问这个问题有进展了吗?

近期业务忙,本周四(4.24) 会发布新版本,期待下哈

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

No branches or pull requests

6 participants