@coldsmirk/inkstone-sql 0.17.1 → 0.19.0

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/index.d.ts CHANGED
@@ -85,9 +85,6 @@ interface SqlDialect {
85
85
  functions: SqlFunction[];
86
86
  }
87
87
  declare const SQL_DIALECTS: Record<SqlKind, SqlDialect>;
88
- /**
89
- * One kind's function by name, however the operator cased it. Hover and signature help both ask.
90
- */
91
88
  /**
92
89
  * A signature's parameters as `[start, end)` offsets into the signature itself — offsets rather
93
90
  * than substrings so a call that repeats a parameter name still marks the right one. Everything
package/dist/index.js CHANGED
@@ -620,6 +620,8 @@ function insideNoise(spans, cursor) {
620
620
  //#region src/reader.ts
621
621
  const TOKENS = /[\w$\u{0080}-\u{FFFF}]+|"(?:[^"]|"")*"|`(?:[^`]|``)*`|\[(?:[^\]]|\]\])*\]|\S/gu;
622
622
  const TOKENS_TSQL = /[\w$#\u{0080}-\u{FFFF}]+|"(?:[^"]|"")*"|`(?:[^`]|``)*`|\[(?:[^\]]|\]\])*\]|\S/gu;
623
+ const WORD_KIND = /^[\w$"`[\u{0080}-\u{FFFF}]/u;
624
+ const WORD_KIND_TSQL = /^[\w$#"`[\u{0080}-\u{FFFF}]/u;
623
625
  function statementBounds(blanked, cursor) {
624
626
  const start = cursor === 0 ? 0 : blanked.lastIndexOf(";", cursor - 1) + 1;
625
627
  const close = blanked.indexOf(";", cursor);
@@ -630,12 +632,14 @@ function statementBounds(blanked, cursor) {
630
632
  }
631
633
  function tokenize(blanked, bounds, kind) {
632
634
  const tokens = [];
633
- const tokensFor = kind === "sqlserver" ? TOKENS_TSQL : TOKENS;
635
+ const tsql = kind === "sqlserver";
636
+ const tokensFor = tsql ? TOKENS_TSQL : TOKENS;
637
+ const wordKind = tsql ? WORD_KIND_TSQL : WORD_KIND;
634
638
  for (const match of blanked.slice(bounds.start, bounds.end).matchAll(tokensFor)) {
635
639
  const value = match[0];
636
640
  tokens.push({
637
641
  value,
638
- kind: /^[\w$#"`[\u{0080}-\u{FFFF}]/u.test(value) ? "word" : "punct",
642
+ kind: wordKind.test(value) ? "word" : "punct",
639
643
  start: bounds.start + match.index,
640
644
  end: bounds.start + match.index + value.length
641
645
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coldsmirk/inkstone-sql",
3
- "version": "0.17.1",
3
+ "version": "0.19.0",
4
4
  "description": "Schema-aware SQL editing intelligence for Monaco: lexical statement reading under per-dialect noise profiles, catalog-driven completion/hover/signature help, unified-placeholder awareness, formatting, and a drop-in React SQL editor.",
5
5
  "keywords": [
6
6
  "sql",
@@ -49,12 +49,12 @@
49
49
  "monaco-editor": "^0.56.0",
50
50
  "react": "^19.2.8",
51
51
  "react-dom": "^19.2.8",
52
- "@coldsmirk/inkstone-react": "^0.17.1"
52
+ "@coldsmirk/inkstone-react": "^0.19.0"
53
53
  },
54
54
  "peerDependencies": {
55
55
  "monaco-editor": "^0.56.0",
56
56
  "react": ">=19",
57
- "@coldsmirk/inkstone-react": "^0.17.1"
57
+ "@coldsmirk/inkstone-react": "^0.19.0"
58
58
  },
59
59
  "peerDependenciesMeta": {
60
60
  "@coldsmirk/inkstone-react": {