Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ scripts/**.js
dist
.DS_Store
!.vscode
__marimo__
6 changes: 6 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[default]
# Use typos:ignore-next-line to ignore the next line in the codebase
extend-ignore-re = ["(#|//)\\s*typos:ignore-next-line\\n.*"]

[files]
extend-exclude = ["src/data/duckdb-keywords.json"]
4 changes: 2 additions & 2 deletions demo/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ function initializeEditor() {
enableTables: true, // Show table information
enableColumns: true, // Show column information
keywords: async () => {
const keywords = await import("../src/data/common-keywords.json");
return keywords.default.keywords;
const keywords = await import("../src/data/duckdb-keywords.json");
return keywords.default;
},
},
}),
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
},
"files": [
"dist",
"src/data"
"src/data/*.json"
],
"exports": {
"./package.json": "./package.json",
Expand All @@ -54,7 +54,8 @@
"default": "./dist/index.js"
}
},
"./data/common-keywords.json": "./src/data/common-keywords.json"
"./data/common-keywords.json": "./src/data/common-keywords.json",
"./data/duckdb-keywords.json": "./src/data/duckdb-keywords.json"
},
"types": "./dist/index.d.ts",
"type": "module",
Expand All @@ -67,4 +68,4 @@
"@codemirror/lint": "^6.8.5",
"node-sql-parser": "^5.3.10"
}
}
}
21 changes: 21 additions & 0 deletions src/data/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# SQL Keywords

This directory contains the SQL keywords for the different dialects. Keywords are stored here so they can be lazily loaded.

## Structure

By default, we use the `SqlKeywordInfo` type to define the keywords.

```json
{
"keyword": {
"description": "Description of the keyword",
"syntax": "Syntax of the keyword",
"example": "Example of the keyword",
"metadata": {
"tag1": "value1",
"tag2": "value2"
}
}
}
```
478 changes: 238 additions & 240 deletions src/data/common-keywords.json

Large diffs are not rendered by default.

Loading