parent
8baabd027b
commit
25358ec653
@ -5556,7 +5556,6 @@ plsql_unreserved_keyword
|
|||||||
| KW_SLICE
|
| KW_SLICE
|
||||||
| KW_SQLSTATE
|
| KW_SQLSTATE
|
||||||
| KW_STACKED
|
| KW_STACKED
|
||||||
| KW_TABLE
|
|
||||||
//| TABLE_NAME
|
//| TABLE_NAME
|
||||||
| KW_TYPE
|
| KW_TYPE
|
||||||
| KW_USE_COLUMN
|
| KW_USE_COLUMN
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@ -75,3 +75,7 @@ UPDATE tablename SET columnname = a + b, (col1, col2) = (a+3, b+4);
|
|||||||
VACUUM tablename (col1, col2);
|
VACUUM tablename (col1, col2);
|
||||||
|
|
||||||
SELECT * FROM db.tbs GROUP BY (col1, col2) ORDER BY col3;
|
SELECT * FROM db.tbs GROUP BY (col1, col2) ORDER BY col3;
|
||||||
|
|
||||||
|
TRUNCATE TABLE ;
|
||||||
|
|
||||||
|
TRUNCATE TABLE t1;
|
||||||
|
@ -970,4 +970,36 @@ describe('Postgre SQL Syntax Suggestion', () => {
|
|||||||
expect(suggestion3).not.toBeUndefined();
|
expect(suggestion3).not.toBeUndefined();
|
||||||
expect(suggestion3?.wordRanges.map((token) => token.text)).toEqual(['col3']);
|
expect(suggestion3?.wordRanges.map((token) => token.text)).toEqual(['col3']);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('TRUNCATE TABLE', () => {
|
||||||
|
const pos1: CaretPosition = {
|
||||||
|
lineNumber: 79,
|
||||||
|
column: 16,
|
||||||
|
};
|
||||||
|
const pos2: CaretPosition = {
|
||||||
|
lineNumber: 81,
|
||||||
|
column: 18,
|
||||||
|
};
|
||||||
|
|
||||||
|
const syntaxes1 = postgresql.getSuggestionAtCaretPosition(
|
||||||
|
commentOtherLine(syntaxSql, pos1.lineNumber),
|
||||||
|
pos1
|
||||||
|
)?.syntax;
|
||||||
|
const syntaxes2 = postgresql.getSuggestionAtCaretPosition(
|
||||||
|
commentOtherLine(syntaxSql, pos2.lineNumber),
|
||||||
|
pos2
|
||||||
|
)?.syntax;
|
||||||
|
|
||||||
|
const suggestion1 = syntaxes1?.find(
|
||||||
|
(syn) => syn.syntaxContextType === EntityContextType.TABLE
|
||||||
|
);
|
||||||
|
const suggestion2 = syntaxes2?.find(
|
||||||
|
(syn) => syn.syntaxContextType === EntityContextType.TABLE
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(suggestion1).not.toBeUndefined();
|
||||||
|
expect(suggestion1?.wordRanges.map((token) => token.text)).toEqual([]);
|
||||||
|
expect(suggestion2).not.toBeUndefined();
|
||||||
|
expect(suggestion2?.wordRanges.map((token) => token.text)).toEqual(['t1']);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user