Skip to content

Commit

Permalink
feat: Add sql language features (#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
gadenbuie authored Jul 22, 2024
1 parent cd96b8b commit 4e12a77
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 18 deletions.
41 changes: 24 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@codemirror/lang-html": "^6.4.2",
"@codemirror/lang-javascript": "^6.1.4",
"@codemirror/lang-python": "^6.1.1",
"@codemirror/lang-sql": "^6.7.0",
"@codemirror/language": "^6.6.0",
"@codemirror/legacy-modes": "^6.3.1",
"@codemirror/lint": "^6.1.1",
Expand Down
2 changes: 2 additions & 0 deletions src/Components/codeMirror/extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { css } from "@codemirror/lang-css";
import { html } from "@codemirror/lang-html";
import { javascript } from "@codemirror/lang-javascript";
import { python } from "@codemirror/lang-python";
import { sql } from "@codemirror/lang-sql";
import {
StreamLanguage,
bracketMatching,
Expand Down Expand Up @@ -115,6 +116,7 @@ const LANG_EXTENSIONS: Record<string, () => Extension> = {
javascript: javascript,
html: html,
css: css,
sql: sql,
r: () => StreamLanguage.define(r),
};

Expand Down
3 changes: 2 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ const FILE_EXTENSIONS: Record<string, string> = {
css: "css",
csv: "csv",
r: "r",
sql: "sql",
};

export function isApplePlatform(): boolean {
Expand Down Expand Up @@ -147,7 +148,7 @@ export function stringToUint8Array(s: string): Uint8Array {
export function engineSwitch(
engine: AppEngine,
rValue: string,
pythonValue: string
pythonValue: string,
): string {
switch (engine) {
case "r":
Expand Down

0 comments on commit 4e12a77

Please sign in to comment.