Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README-zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ console.log(sqlSlices)
startLine: 1,
endLine: 1,
startColumn: 1,
endColumn: 12,
endColumn: 13,
text: 'SHOW TABLES;'
},
{
Expand All @@ -231,7 +231,7 @@ console.log(sqlSlices)
startLine: 2,
endLine: 2,
startColumn: 1,
endColumn: 17,
endColumn: 18,
text: 'SELECT * FROM tb;'
}
]
Expand All @@ -250,7 +250,7 @@ console.log(sqlSlices)

const flink = new FlinkSQL();
const sql = 'CREATE ';
const pos = { lineNumber: 1, column: 16 }; // 最后一个位置
const pos = { lineNumber: 1, column: sql.length + 1 }; // 最后一个位置
const keywords = flink.getSuggestionAtCaretPosition(sql, pos)?.keywords;

console.log(keywords);
Expand Down Expand Up @@ -297,10 +297,10 @@ console.log(sqlSlices)
{
text: 'tb',
startIndex: 14,
stopIndex: 15,
endIndex: 15,
line: 1,
startColumn: 15,
stopColumn: 16
endColumn: 17
}
]
},
Expand All @@ -310,10 +310,10 @@ console.log(sqlSlices)
{
text: 'tb',
startIndex: 14,
stopIndex: 15,
endIndex: 15,
line: 1,
startColumn: 15,
stopColumn: 16
endColumn: 17
}
]
}
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ console.log(sqlSlices)
startLine: 1,
endLine: 1,
startColumn: 1,
endColumn: 12,
endColumn: 13,
text: 'SHOW TABLES;'
},
{
Expand All @@ -234,7 +234,7 @@ console.log(sqlSlices)
startLine: 2,
endLine: 2,
startColumn: 1,
endColumn: 17,
endColumn: 18,
text: 'SELECT * FROM tb;'
}
]
Expand All @@ -244,15 +244,15 @@ console.log(sqlSlices)
### Code Completion
Obtaining code completion information at a specified position in SQL.

Call the `getAllEntities` method on the SQL instance, pass the SQL content and the row and column numbers indicating the position where code completion is desired. The following are some additional explanations about [CaretPosition](#caretposition-of-code-completion).
Call the `getSuggestionAtCaretPosition` method on the SQL instance, pass the SQL content and the row and column numbers indicating the position where code completion is desired. The following are some additional explanations about [CaretPosition](#caretposition-of-code-completion).
+ **keyword candidates list**

```javascript
import { FlinkSQL } from 'dt-sql-parser';

const flink = new FlinkSQL();
const sql = 'CREATE ';
const pos = { lineNumber: 1, column: 16 }; // the end position
const pos = { lineNumber: 1, column: sql.length + 1 }; // the end position
const keywords = flink.getSuggestionAtCaretPosition(sql, pos)?.keywords;

console.log(keywords);
Expand Down Expand Up @@ -296,10 +296,10 @@ Call the `getAllEntities` method on the SQL instance, pass the SQL content and t
{
text: 'tb',
startIndex: 14,
stopIndex: 15,
endIndex: 15,
line: 1,
startColumn: 15,
stopColumn: 16
endColumn: 17
}
]
},
Expand All @@ -309,10 +309,10 @@ Call the `getAllEntities` method on the SQL instance, pass the SQL content and t
{
text: 'tb',
startIndex: 14,
stopIndex: 15,
endIndex: 15,
line: 1,
startColumn: 15,
stopColumn: 16
endColumn: 17
}
]
}
Expand Down
Loading