rawsql-ts 0.11.28-beta → 0.11.30-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.min.js +14 -14
- package/dist/esm/index.min.js.map +4 -4
- package/dist/esm/src/index.d.ts +2 -0
- package/dist/esm/src/index.js +1 -0
- package/dist/esm/src/index.js.map +1 -1
- package/dist/esm/src/transformers/SchemaCollector.d.ts +7 -0
- package/dist/esm/src/transformers/SchemaCollector.js +99 -52
- package/dist/esm/src/transformers/SchemaCollector.js.map +1 -1
- package/dist/esm/src/utils/CTERegionDetector.d.ts +188 -0
- package/dist/esm/src/utils/CTERegionDetector.js +309 -0
- package/dist/esm/src/utils/CTERegionDetector.js.map +1 -0
- package/dist/esm/src/utils/LexemeCursor.d.ts +41 -10
- package/dist/esm/src/utils/LexemeCursor.js +46 -16
- package/dist/esm/src/utils/LexemeCursor.js.map +1 -1
- package/dist/esm/tsconfig.browser.tsbuildinfo +1 -1
- package/dist/index.min.js +16 -16
- package/dist/index.min.js.map +4 -4
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/transformers/SchemaCollector.d.ts +7 -0
- package/dist/src/transformers/SchemaCollector.js +99 -52
- package/dist/src/transformers/SchemaCollector.js.map +1 -1
- package/dist/src/utils/CTERegionDetector.d.ts +188 -0
- package/dist/src/utils/CTERegionDetector.js +313 -0
- package/dist/src/utils/CTERegionDetector.js.map +1 -0
- package/dist/src/utils/LexemeCursor.d.ts +41 -10
- package/dist/src/utils/LexemeCursor.js +46 -16
- package/dist/src/utils/LexemeCursor.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
@@ -0,0 +1,313 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.CTERegionDetector = void 0;
|
4
|
+
const Lexeme_1 = require("../models/Lexeme");
|
5
|
+
const LexemeCursor_1 = require("./LexemeCursor");
|
6
|
+
/**
|
7
|
+
* Utility class for detecting CTE (Common Table Expression) regions and extracting executable SQL.
|
8
|
+
*
|
9
|
+
* Designed for SQL editor features where users want to execute specific CTE parts based on cursor position.
|
10
|
+
* This enables editors to provide "run current section" functionality that intelligently executes
|
11
|
+
* either the CTE the cursor is in, or the main query.
|
12
|
+
*
|
13
|
+
* @example Basic usage - Analyze cursor position
|
14
|
+
* ```typescript
|
15
|
+
* const sql = `
|
16
|
+
* WITH users_cte AS (
|
17
|
+
* SELECT id, name FROM users WHERE active = true
|
18
|
+
* )
|
19
|
+
* SELECT * FROM users_cte ORDER BY name
|
20
|
+
* `;
|
21
|
+
*
|
22
|
+
* const cursorPosition = 50; // Inside the CTE
|
23
|
+
* const analysis = CTERegionDetector.analyzeCursorPosition(sql, cursorPosition);
|
24
|
+
*
|
25
|
+
* if (analysis.isInCTE) {
|
26
|
+
* console.log(`Execute CTE: ${analysis.cteRegion.name}`);
|
27
|
+
* executeSQL(analysis.executableSQL); // Runs just the CTE SELECT
|
28
|
+
* }
|
29
|
+
* ```
|
30
|
+
*
|
31
|
+
* @example Get all executable sections
|
32
|
+
* ```typescript
|
33
|
+
* const positions = CTERegionDetector.getCTEPositions(sql);
|
34
|
+
* // Returns: [
|
35
|
+
* // { name: 'users_cte', startPosition: 17, type: 'CTE' },
|
36
|
+
* // { name: 'MAIN_QUERY', startPosition: 120, type: 'MAIN_QUERY' }
|
37
|
+
* // ]
|
38
|
+
* ```
|
39
|
+
*/
|
40
|
+
class CTERegionDetector {
|
41
|
+
/**
|
42
|
+
* Analyze cursor position and return information about the current context.
|
43
|
+
*
|
44
|
+
* This is the main method for SQL editor integration. It determines whether the cursor
|
45
|
+
* is inside a CTE or the main query, and provides the appropriate executable SQL.
|
46
|
+
*
|
47
|
+
* @param sql - The complete SQL string to analyze
|
48
|
+
* @param cursorPosition - The cursor position (0-based character offset)
|
49
|
+
* @returns Analysis result containing context information and executable SQL
|
50
|
+
*
|
51
|
+
* @example
|
52
|
+
* ```typescript
|
53
|
+
* const sql = `WITH users AS (SELECT * FROM table) SELECT * FROM users`;
|
54
|
+
* const analysis = CTERegionDetector.analyzeCursorPosition(sql, 25);
|
55
|
+
*
|
56
|
+
* if (analysis.isInCTE) {
|
57
|
+
* console.log(`Cursor is in CTE: ${analysis.cteRegion.name}`);
|
58
|
+
* executeSQL(analysis.executableSQL); // Execute just the CTE
|
59
|
+
* } else {
|
60
|
+
* console.log('Cursor is in main query');
|
61
|
+
* executeSQL(analysis.executableSQL); // Execute the full query
|
62
|
+
* }
|
63
|
+
* ```
|
64
|
+
*/
|
65
|
+
static analyzeCursorPosition(sql, cursorPosition) {
|
66
|
+
const cteRegions = this.extractCTERegions(sql);
|
67
|
+
// Find which CTE region contains the cursor
|
68
|
+
const currentCTE = cteRegions.find(region => cursorPosition >= region.startPosition && cursorPosition <= region.endPosition);
|
69
|
+
if (currentCTE) {
|
70
|
+
return {
|
71
|
+
isInCTE: true,
|
72
|
+
cteRegion: currentCTE,
|
73
|
+
executableSQL: currentCTE.sqlContent
|
74
|
+
};
|
75
|
+
}
|
76
|
+
else {
|
77
|
+
// Cursor is in main query - return full SQL or main SELECT part
|
78
|
+
const mainSQL = this.extractMainQuery(sql, cteRegions);
|
79
|
+
return {
|
80
|
+
isInCTE: false,
|
81
|
+
cteRegion: null,
|
82
|
+
executableSQL: mainSQL
|
83
|
+
};
|
84
|
+
}
|
85
|
+
}
|
86
|
+
/**
|
87
|
+
* Extract all CTE regions from SQL text with their boundaries and executable content.
|
88
|
+
*
|
89
|
+
* Parses the SQL to identify all Common Table Expressions and their locations,
|
90
|
+
* providing the information needed for syntax highlighting, code folding, and selective execution.
|
91
|
+
*
|
92
|
+
* @param sql - The SQL string to analyze
|
93
|
+
* @returns Array of CTE regions with their boundaries and content
|
94
|
+
*
|
95
|
+
* @example
|
96
|
+
* ```typescript
|
97
|
+
* const sql = `
|
98
|
+
* WITH
|
99
|
+
* users AS (SELECT * FROM people),
|
100
|
+
* orders AS (SELECT * FROM purchases)
|
101
|
+
* SELECT * FROM users JOIN orders
|
102
|
+
* `;
|
103
|
+
*
|
104
|
+
* const regions = CTERegionDetector.extractCTERegions(sql);
|
105
|
+
* // Returns: [
|
106
|
+
* // { name: 'users', startPosition: 23, endPosition: 45, sqlContent: 'SELECT * FROM people' },
|
107
|
+
* // { name: 'orders', startPosition: 55, endPosition: 80, sqlContent: 'SELECT * FROM purchases' }
|
108
|
+
* // ]
|
109
|
+
* ```
|
110
|
+
*/
|
111
|
+
static extractCTERegions(sql) {
|
112
|
+
const lexemes = LexemeCursor_1.LexemeCursor.getAllLexemesWithPosition(sql);
|
113
|
+
const cteRegions = [];
|
114
|
+
let i = 0;
|
115
|
+
let inWithClause = false;
|
116
|
+
while (i < lexemes.length) {
|
117
|
+
const lexeme = lexemes[i];
|
118
|
+
// Detect WITH clause start
|
119
|
+
if (lexeme.value.toLowerCase() === 'with' && !inWithClause) {
|
120
|
+
inWithClause = true;
|
121
|
+
i++;
|
122
|
+
continue;
|
123
|
+
}
|
124
|
+
// Skip RECURSIVE keyword if present
|
125
|
+
if (inWithClause && lexeme.value.toLowerCase() === 'recursive') {
|
126
|
+
i++;
|
127
|
+
continue;
|
128
|
+
}
|
129
|
+
// Detect CTE definition (identifier followed by AS)
|
130
|
+
if (inWithClause &&
|
131
|
+
lexeme.type === Lexeme_1.TokenType.Identifier &&
|
132
|
+
i + 1 < lexemes.length &&
|
133
|
+
lexemes[i + 1].value.toLowerCase() === 'as') {
|
134
|
+
const cteName = lexeme.value;
|
135
|
+
const cteStartPos = lexeme.position.startPosition;
|
136
|
+
// Find the opening parenthesis after AS
|
137
|
+
let parenIndex = i + 2;
|
138
|
+
while (parenIndex < lexemes.length && lexemes[parenIndex].value !== '(') {
|
139
|
+
parenIndex++;
|
140
|
+
}
|
141
|
+
if (parenIndex < lexemes.length) {
|
142
|
+
// Find matching closing parenthesis
|
143
|
+
const cteEndInfo = this.findMatchingParen(lexemes, parenIndex);
|
144
|
+
if (cteEndInfo) {
|
145
|
+
const cteEndPos = cteEndInfo.endPosition;
|
146
|
+
const sqlContent = this.extractCTESQL(sql, lexemes, parenIndex, cteEndInfo.index);
|
147
|
+
cteRegions.push({
|
148
|
+
name: cteName,
|
149
|
+
startPosition: cteStartPos,
|
150
|
+
endPosition: cteEndPos,
|
151
|
+
sqlContent: sqlContent
|
152
|
+
});
|
153
|
+
i = cteEndInfo.index + 1;
|
154
|
+
continue;
|
155
|
+
}
|
156
|
+
}
|
157
|
+
}
|
158
|
+
// Check if we've reached the main SELECT (end of WITH clause)
|
159
|
+
if (inWithClause && lexeme.value.toLowerCase() === 'select') {
|
160
|
+
// Verify this is not a SELECT inside a CTE by checking context
|
161
|
+
if (this.isMainQuerySelect(lexemes, i)) {
|
162
|
+
break;
|
163
|
+
}
|
164
|
+
}
|
165
|
+
i++;
|
166
|
+
}
|
167
|
+
return cteRegions;
|
168
|
+
}
|
169
|
+
/**
|
170
|
+
* Find matching closing parenthesis for CTE definition
|
171
|
+
*/
|
172
|
+
static findMatchingParen(lexemes, openParenIndex) {
|
173
|
+
let depth = 1;
|
174
|
+
let i = openParenIndex + 1;
|
175
|
+
while (i < lexemes.length && depth > 0) {
|
176
|
+
if (lexemes[i].value === '(') {
|
177
|
+
depth++;
|
178
|
+
}
|
179
|
+
else if (lexemes[i].value === ')') {
|
180
|
+
depth--;
|
181
|
+
}
|
182
|
+
if (depth === 0) {
|
183
|
+
return {
|
184
|
+
index: i,
|
185
|
+
endPosition: lexemes[i].position.endPosition
|
186
|
+
};
|
187
|
+
}
|
188
|
+
i++;
|
189
|
+
}
|
190
|
+
return null;
|
191
|
+
}
|
192
|
+
/**
|
193
|
+
* Extract the SQL content of a CTE (the SELECT statement inside parentheses)
|
194
|
+
*/
|
195
|
+
static extractCTESQL(sql, lexemes, openParenIndex, closeParenIndex) {
|
196
|
+
const startPos = lexemes[openParenIndex + 1].position.startPosition;
|
197
|
+
const endPos = lexemes[closeParenIndex - 1].position.endPosition;
|
198
|
+
return sql.substring(startPos, endPos).trim();
|
199
|
+
}
|
200
|
+
/**
|
201
|
+
* Check if a SELECT lexeme is the main query SELECT (not inside a CTE)
|
202
|
+
*/
|
203
|
+
static isMainQuerySelect(lexemes, selectIndex) {
|
204
|
+
// Look backwards to see if we're still in a parenthesized context
|
205
|
+
let depth = 0;
|
206
|
+
for (let i = selectIndex - 1; i >= 0; i--) {
|
207
|
+
if (lexemes[i].value === ')') {
|
208
|
+
depth++;
|
209
|
+
}
|
210
|
+
else if (lexemes[i].value === '(') {
|
211
|
+
depth--;
|
212
|
+
}
|
213
|
+
}
|
214
|
+
return depth === 0; // We're at top level if depth is 0
|
215
|
+
}
|
216
|
+
/**
|
217
|
+
* Extract the main query part (non-CTE SQL)
|
218
|
+
*/
|
219
|
+
static extractMainQuery(sql, cteRegions) {
|
220
|
+
if (cteRegions.length === 0) {
|
221
|
+
return sql.trim();
|
222
|
+
}
|
223
|
+
// Find the end of the last CTE
|
224
|
+
const lastCTE = cteRegions[cteRegions.length - 1];
|
225
|
+
const mainQueryStart = lastCTE.endPosition;
|
226
|
+
// Find the main SELECT
|
227
|
+
let selectPos = mainQueryStart;
|
228
|
+
while (selectPos < sql.length) {
|
229
|
+
const remaining = sql.substring(selectPos).toLowerCase().trim();
|
230
|
+
if (remaining.startsWith('select')) {
|
231
|
+
break;
|
232
|
+
}
|
233
|
+
selectPos++;
|
234
|
+
}
|
235
|
+
return sql.substring(selectPos).trim();
|
236
|
+
}
|
237
|
+
/**
|
238
|
+
* Get a list of all executable sections (CTEs and main query) with their start positions.
|
239
|
+
*
|
240
|
+
* This method is particularly useful for building editor UI features such as:
|
241
|
+
* - Dropdown menus for section selection
|
242
|
+
* - Sidebar navigation for large queries
|
243
|
+
* - Quick jump functionality
|
244
|
+
* - "Run section" buttons
|
245
|
+
*
|
246
|
+
* @param sql - The SQL string to analyze
|
247
|
+
* @returns Array of executable sections with their names, positions, and types
|
248
|
+
*
|
249
|
+
* @example
|
250
|
+
* ```typescript
|
251
|
+
* const sql = `
|
252
|
+
* WITH monthly_sales AS (SELECT ...),
|
253
|
+
* yearly_summary AS (SELECT ...)
|
254
|
+
* SELECT * FROM yearly_summary
|
255
|
+
* `;
|
256
|
+
*
|
257
|
+
* const positions = CTERegionDetector.getCTEPositions(sql);
|
258
|
+
* // Returns: [
|
259
|
+
* // { name: 'monthly_sales', startPosition: 17, type: 'CTE' },
|
260
|
+
* // { name: 'yearly_summary', startPosition: 55, type: 'CTE' },
|
261
|
+
* // { name: 'MAIN_QUERY', startPosition: 120, type: 'MAIN_QUERY' }
|
262
|
+
* // ]
|
263
|
+
*
|
264
|
+
* // Use for editor UI
|
265
|
+
* positions.forEach(section => {
|
266
|
+
* addMenuItem(`${section.type}: ${section.name}`, () => {
|
267
|
+
* jumpToPosition(section.startPosition);
|
268
|
+
* });
|
269
|
+
* });
|
270
|
+
* ```
|
271
|
+
*/
|
272
|
+
static getCTEPositions(sql) {
|
273
|
+
const cteRegions = this.extractCTERegions(sql);
|
274
|
+
const results = [];
|
275
|
+
// Add CTE regions
|
276
|
+
cteRegions.forEach(region => {
|
277
|
+
results.push({
|
278
|
+
name: region.name,
|
279
|
+
startPosition: region.startPosition,
|
280
|
+
type: 'CTE'
|
281
|
+
});
|
282
|
+
});
|
283
|
+
// Add main query position
|
284
|
+
if (cteRegions.length > 0) {
|
285
|
+
const lastCTE = cteRegions[cteRegions.length - 1];
|
286
|
+
let mainQueryPos = lastCTE.endPosition;
|
287
|
+
// Find the SELECT keyword
|
288
|
+
while (mainQueryPos < sql.length) {
|
289
|
+
const remaining = sql.substring(mainQueryPos).toLowerCase().trim();
|
290
|
+
if (remaining.startsWith('select')) {
|
291
|
+
results.push({
|
292
|
+
name: 'MAIN_QUERY',
|
293
|
+
startPosition: mainQueryPos,
|
294
|
+
type: 'MAIN_QUERY'
|
295
|
+
});
|
296
|
+
break;
|
297
|
+
}
|
298
|
+
mainQueryPos++;
|
299
|
+
}
|
300
|
+
}
|
301
|
+
else {
|
302
|
+
// No CTEs, entire SQL is main query
|
303
|
+
results.push({
|
304
|
+
name: 'MAIN_QUERY',
|
305
|
+
startPosition: 0,
|
306
|
+
type: 'MAIN_QUERY'
|
307
|
+
});
|
308
|
+
}
|
309
|
+
return results;
|
310
|
+
}
|
311
|
+
}
|
312
|
+
exports.CTERegionDetector = CTERegionDetector;
|
313
|
+
//# sourceMappingURL=CTERegionDetector.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"CTERegionDetector.js","sourceRoot":"","sources":["../../../src/utils/CTERegionDetector.ts"],"names":[],"mappings":";;;AAAA,6CAAqD;AACrD,iDAA8C;AAiD9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAa,iBAAiB;IAC1B;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACI,MAAM,CAAC,qBAAqB,CAAC,GAAW,EAAE,cAAsB;QACnE,MAAM,UAAU,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;QAE/C,4CAA4C;QAC5C,MAAM,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CACxC,cAAc,IAAI,MAAM,CAAC,aAAa,IAAI,cAAc,IAAI,MAAM,CAAC,WAAW,CACjF,CAAC;QAEF,IAAI,UAAU,EAAE,CAAC;YACb,OAAO;gBACH,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,UAAU;gBACrB,aAAa,EAAE,UAAU,CAAC,UAAU;aACvC,CAAC;QACN,CAAC;aAAM,CAAC;YACJ,gEAAgE;YAChE,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;YACvD,OAAO;gBACH,OAAO,EAAE,KAAK;gBACd,SAAS,EAAE,IAAI;gBACf,aAAa,EAAE,OAAO;aACzB,CAAC;QACN,CAAC;IACL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AAG,CAAC,EAAE,CAAC;YACxB,MAAM,OAAO,GAAG,UAAU,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;YAClD,IAAI,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC;YAEvC,0BAA0B;YAC1B,OAAO,YAAY,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC;gBAC/B,MAAM,SAAS,GAAG,GAAG,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;gBACnE,IAAI,SAAS,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;oBACjC,OAAO,CAAC,IAAI,CAAC;wBACT,IAAI,EAAE,YAAY;wBAClB,aAAa,EAAE,YAAY;wBAC3B,IAAI,EAAE,YAAY;qBACrB,CAAC,CAAC;oBACH,MAAM;gBACV,CAAC;gBACD,YAAY,EAAE,CAAC;YACnB,CAAC;QACL,CAAC;aAAM,CAAC;YACJ,oCAAoC;YACpC,OAAO,CAAC,IAAI,CAAC;gBACT,IAAI,EAAE,YAAY;gBAClB,aAAa,EAAE,CAAC;gBAChB,IAAI,EAAE,YAAY;aACrB,CAAC,CAAC;QACP,CAAC;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ;AA9SD,8CA8SC"}
|
@@ -1,27 +1,58 @@
|
|
1
1
|
import { Lexeme } from '../models/Lexeme';
|
2
2
|
/**
|
3
|
-
* Utility class for cursor-to-lexeme mapping in SQL text
|
4
|
-
*
|
3
|
+
* Utility class for cursor-to-lexeme mapping in SQL text.
|
4
|
+
*
|
5
|
+
* Provides functionality to find lexemes at specific cursor positions for IDE integration.
|
6
|
+
* Handles SQL parsing with proper comment and whitespace handling for editor features.
|
7
|
+
*
|
8
|
+
* @example Basic usage
|
9
|
+
* ```typescript
|
10
|
+
* const sql = "SELECT id FROM users WHERE active = true";
|
11
|
+
* const lexeme = LexemeCursor.findLexemeAtPosition(sql, 7); // position at 'id'
|
12
|
+
* console.log(lexeme?.value); // 'id'
|
13
|
+
* ```
|
5
14
|
*/
|
6
15
|
export declare class LexemeCursor {
|
7
16
|
private static readonly SQL_COMMANDS;
|
8
17
|
/**
|
9
|
-
* Find the lexeme at the specified cursor position
|
10
|
-
*
|
11
|
-
*
|
18
|
+
* Find the lexeme at the specified cursor position.
|
19
|
+
*
|
20
|
+
* Performs intelligent SQL parsing with proper comment and whitespace handling.
|
21
|
+
* Returns null if cursor is in whitespace or comments.
|
22
|
+
*
|
23
|
+
* @param sql - The SQL string to analyze
|
24
|
+
* @param cursorPosition - The cursor position (0-based character offset)
|
12
25
|
* @returns The lexeme at the position, or null if not found
|
26
|
+
*
|
27
|
+
* @example
|
28
|
+
* ```typescript
|
29
|
+
* const sql = "SELECT user_id FROM orders";
|
30
|
+
* const lexeme = LexemeCursor.findLexemeAtPosition(sql, 7);
|
31
|
+
* console.log(lexeme?.value); // 'user_id'
|
32
|
+
* ```
|
13
33
|
*/
|
14
34
|
static findLexemeAtPosition(sql: string, cursorPosition: number): Lexeme | null;
|
15
35
|
/**
|
16
|
-
* Get all lexemes with position information
|
17
|
-
*
|
18
|
-
*
|
36
|
+
* Get all lexemes with position information from SQL text.
|
37
|
+
*
|
38
|
+
* Tokenizes the entire SQL string with precise position information.
|
39
|
+
* Useful for syntax highlighting, code analysis, and editor features.
|
40
|
+
*
|
41
|
+
* @param sql - The SQL string to tokenize
|
42
|
+
* @returns Array of lexemes with position information (excludes comments/whitespace)
|
43
|
+
*
|
44
|
+
* @example
|
45
|
+
* ```typescript
|
46
|
+
* const sql = "SELECT id FROM users";
|
47
|
+
* const lexemes = LexemeCursor.getAllLexemesWithPosition(sql);
|
48
|
+
* lexemes.forEach(l => console.log(`${l.value} at ${l.position.startPosition}`));
|
49
|
+
* ```
|
19
50
|
*/
|
20
51
|
static getAllLexemesWithPosition(sql: string): Lexeme[];
|
21
52
|
/**
|
22
|
-
* Skip whitespace
|
53
|
+
* Skip whitespace and comments, returning new position
|
23
54
|
*/
|
24
|
-
private static
|
55
|
+
private static skipWhitespaceAndComments;
|
25
56
|
/**
|
26
57
|
* Parse the next token starting at the given position
|
27
58
|
*/
|
@@ -2,16 +2,37 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.LexemeCursor = void 0;
|
4
4
|
const Lexeme_1 = require("../models/Lexeme");
|
5
|
+
const stringUtils_1 = require("./stringUtils");
|
5
6
|
/**
|
6
|
-
* Utility class for cursor-to-lexeme mapping in SQL text
|
7
|
-
*
|
7
|
+
* Utility class for cursor-to-lexeme mapping in SQL text.
|
8
|
+
*
|
9
|
+
* Provides functionality to find lexemes at specific cursor positions for IDE integration.
|
10
|
+
* Handles SQL parsing with proper comment and whitespace handling for editor features.
|
11
|
+
*
|
12
|
+
* @example Basic usage
|
13
|
+
* ```typescript
|
14
|
+
* const sql = "SELECT id FROM users WHERE active = true";
|
15
|
+
* const lexeme = LexemeCursor.findLexemeAtPosition(sql, 7); // position at 'id'
|
16
|
+
* console.log(lexeme?.value); // 'id'
|
17
|
+
* ```
|
8
18
|
*/
|
9
19
|
class LexemeCursor {
|
10
20
|
/**
|
11
|
-
* Find the lexeme at the specified cursor position
|
12
|
-
*
|
13
|
-
*
|
21
|
+
* Find the lexeme at the specified cursor position.
|
22
|
+
*
|
23
|
+
* Performs intelligent SQL parsing with proper comment and whitespace handling.
|
24
|
+
* Returns null if cursor is in whitespace or comments.
|
25
|
+
*
|
26
|
+
* @param sql - The SQL string to analyze
|
27
|
+
* @param cursorPosition - The cursor position (0-based character offset)
|
14
28
|
* @returns The lexeme at the position, or null if not found
|
29
|
+
*
|
30
|
+
* @example
|
31
|
+
* ```typescript
|
32
|
+
* const sql = "SELECT user_id FROM orders";
|
33
|
+
* const lexeme = LexemeCursor.findLexemeAtPosition(sql, 7);
|
34
|
+
* console.log(lexeme?.value); // 'user_id'
|
35
|
+
* ```
|
15
36
|
*/
|
16
37
|
static findLexemeAtPosition(sql, cursorPosition) {
|
17
38
|
if (cursorPosition < 0 || cursorPosition >= sql.length) {
|
@@ -28,9 +49,20 @@ class LexemeCursor {
|
|
28
49
|
return null;
|
29
50
|
}
|
30
51
|
/**
|
31
|
-
* Get all lexemes with position information
|
32
|
-
*
|
33
|
-
*
|
52
|
+
* Get all lexemes with position information from SQL text.
|
53
|
+
*
|
54
|
+
* Tokenizes the entire SQL string with precise position information.
|
55
|
+
* Useful for syntax highlighting, code analysis, and editor features.
|
56
|
+
*
|
57
|
+
* @param sql - The SQL string to tokenize
|
58
|
+
* @returns Array of lexemes with position information (excludes comments/whitespace)
|
59
|
+
*
|
60
|
+
* @example
|
61
|
+
* ```typescript
|
62
|
+
* const sql = "SELECT id FROM users";
|
63
|
+
* const lexemes = LexemeCursor.getAllLexemesWithPosition(sql);
|
64
|
+
* lexemes.forEach(l => console.log(`${l.value} at ${l.position.startPosition}`));
|
65
|
+
* ```
|
34
66
|
*/
|
35
67
|
static getAllLexemesWithPosition(sql) {
|
36
68
|
if (!(sql === null || sql === void 0 ? void 0 : sql.trim())) {
|
@@ -40,7 +72,7 @@ class LexemeCursor {
|
|
40
72
|
const lexemes = [];
|
41
73
|
let position = 0;
|
42
74
|
while (position < sql.length) {
|
43
|
-
position = this.
|
75
|
+
position = this.skipWhitespaceAndComments(sql, position);
|
44
76
|
if (position >= sql.length) {
|
45
77
|
break;
|
46
78
|
}
|
@@ -60,13 +92,11 @@ class LexemeCursor {
|
|
60
92
|
}
|
61
93
|
}
|
62
94
|
/**
|
63
|
-
* Skip whitespace
|
95
|
+
* Skip whitespace and comments, returning new position
|
64
96
|
*/
|
65
|
-
static
|
66
|
-
|
67
|
-
|
68
|
-
}
|
69
|
-
return position;
|
97
|
+
static skipWhitespaceAndComments(sql, position) {
|
98
|
+
const result = stringUtils_1.StringUtils.readWhiteSpaceAndComment(sql, position);
|
99
|
+
return result.position;
|
70
100
|
}
|
71
101
|
/**
|
72
102
|
* Parse the next token starting at the given position
|
@@ -153,7 +183,7 @@ class LexemeCursor {
|
|
153
183
|
return Lexeme_1.TokenType.Command;
|
154
184
|
}
|
155
185
|
// Check if it's followed by parentheses (function)
|
156
|
-
const nextNonWhitespacePos = this.
|
186
|
+
const nextNonWhitespacePos = this.skipWhitespaceAndComments(sql, position);
|
157
187
|
if (nextNonWhitespacePos < sql.length && sql[nextNonWhitespacePos] === '(') {
|
158
188
|
return Lexeme_1.TokenType.Function;
|
159
189
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"LexemeCursor.js","sourceRoot":"","sources":["../../../src/utils/LexemeCursor.ts"],"names":[],"mappings":";;;AAAA,6CAAqD;
|
1
|
+
{"version":3,"file":"LexemeCursor.js","sourceRoot":"","sources":["../../../src/utils/LexemeCursor.ts"],"names":[],"mappings":";;;AAAA,6CAAqD;AACrD,+CAA4C;AAE5C;;;;;;;;;;;;GAYG;AACH,MAAa,YAAY;IAMrB;;;;;;;;;;;;;;;;OAgBG;IACI,MAAM,CAAC,oBAAoB,CAAC,GAAW,EAAE,cAAsB;QAClE,IAAI,cAAc,GAAG,CAAC,IAAI,cAAc,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC;YACrD,OAAO,IAAI,CAAC;QAChB,CAAC;QAED,MAAM,OAAO,GAAG,IAAI,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC;QAEpD,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC3B,IAAI,MAAM,CAAC,QAAQ;gBACf,cAAc,IAAI,MAAM,CAAC,QAAQ,CAAC,aAAa;gBAC/C,cAAc,GAAG,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC;gBAC/C,OAAO,MAAM,CAAC;YAClB,CAAC;QACL,CAAC;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACI,MAAM,CAAC,yBAAyB,CAAC,GAAW;QAC/C,IAAI,CAAC,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,IAAI,EAAE,CAAA,EAAE,CAAC;YAC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