fix: #239 correct suggestion word ranges - #486
Open
liuxy0551 wants to merge 1 commit into
Open
Conversation
Cythia828
reviewed
Aug 12, 2026
Comment on lines
+107
to
+111
| const rangeEndTokenIndex = | ||
| endTokenIndex <= caretTokenIndex && | ||
| (allTokens[endTokenIndex]?.text === '.' || previousVisibleToken?.text === '.') | ||
| ? endTokenIndex + 1 | ||
| : endTokenIndex; |
Collaborator
There was a problem hiding this comment.
+1 只够覆盖单层 db.table。若出现 db.schema.table 且被下一个候选截断在 schema,则 table 会被丢掉。这是未覆盖的边界。看是补一个多层限定名用例确认行为还是说在注释里明确"当前仅支持单层保留"。
This file contains hidden or 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
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.
问题
getSuggestionAtCaretPosition生成表名候选时,table.wordRanges会错误包含表名后的空格、AS或别名。修改内容
BasicSQL中统一计算候选词范围db.等未完成限定表名验证
pnpm run check-types通过pnpm run prettier-check通过git diff --check通过#239 中提到的运行结果会是:
{ "syntax": [ { "syntaxContextType": "table", "wordRanges": [ { "text": "current_catalog_schema1", "line": 1, "startIndex": 14, "endIndex": 36, "startColumn": 15, "endColumn": 38 } ] } ], "keywords": ["FORCE", "IGNORE", "USE", "...", "AS", "..."] }