Skip to content

fix(web-console): fix #40 #100

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

Closed
wants to merge 7 commits into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,24 @@ describe("errors", () => {
it("should mark date position as error", () => {
const query = `select * from long_sequence(1) where cast(x as timestamp) = '2012-04-12T12:00:00A'`;
cy.runQuery(query);
cy.matchErrorMarkerPosition({ left: 506, width: 42 });
cy.matchErrorMarkerPosition({ left: 506, width: 185 });

cy.getNotifications().should("contain", "Invalid date");
});

it("should mark string in quotes that has dashes as error", () => {
cy.runQuery(
`select * from long_sequence(1) where cast(x as timestamp) = '2012-04-12T12:00:0A'`
);
cy.matchErrorMarkerPosition({ left: 506, width: 177 });

cy.clearEditor();
cy.runQuery(`select * from 'table-that-doesnt-exist'`);
cy.matchErrorMarkerPosition({ left: 118, width: 211 });

cy.runQuery(`select * from "double-quotes"`);
cy.matchErrorMarkerPosition({ left: 118, width: 126 });
});
});

describe("running query with F9", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ export const conf: monaco.languages.LanguageConfiguration = {
* This way we can highlight table names escaped with quotes and the ones created from CSV files.
* An additional example is a "bad integer" error, i.e. (20000) - needs brackets to be allowed as well.
*/
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#\$\%\^\&\*\-\=\+\[\{\]\}\\\|\;\:\"\,\<\>\/\?\s]+)/g,
wordPattern:
/(-?\d*\.\d\w*)|(['"][\w\d-:]*['"])|([^\`\~\!\@\#\$\%\^\&\*\-\=\+\[\{\]\}\\\|\;\:\"\,\<\>\/\?\s]+)/g,
comments: {
lineComment: "--",
blockComment: ["/*", "*/"],
Expand Down