@dbml/parse 10.0.0-optional-ref.0 → 10.1.0-alpha.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/dbml-parse.js +33 -19
- package/dist/dbml-parse.mjs +6154 -4683
- package/dist/src/compiler/index.d.ts +11 -7
- package/dist/src/compiler/queries/transform/index.d.ts +3 -1
- package/dist/src/compiler/queries/transform/renameTable.d.ts +2 -2
- package/dist/src/compiler/queries/transform/syncDep.d.ts +54 -0
- package/dist/src/compiler/queries/transform/types.d.ts +48 -0
- package/dist/src/compiler/queries/transform/updateElementSetting.d.ts +6 -0
- package/dist/src/compiler/queries/transform/utils/index.d.ts +26 -0
- package/dist/src/compiler/queries/transform/utils/ref.d.ts +15 -0
- package/dist/src/compiler/queries/utils.d.ts +6 -0
- package/dist/src/compiler/types.d.ts +9 -7
- package/dist/src/core/global_modules/dep/bind.d.ts +18 -0
- package/dist/src/core/global_modules/dep/index.d.ts +2 -0
- package/dist/src/core/global_modules/dep/interpret.d.ts +18 -0
- package/dist/src/core/global_modules/metadata/bind.d.ts +11 -0
- package/dist/src/core/global_modules/metadata/index.d.ts +2 -0
- package/dist/src/core/global_modules/metadata/interpret.d.ts +14 -0
- package/dist/src/core/global_modules/metadata/utils.d.ts +29 -0
- package/dist/src/core/global_modules/note/interpret.d.ts +3 -1
- package/dist/src/core/global_modules/program/utils/dep.d.ts +4 -0
- package/dist/src/core/global_modules/program/utils/external.d.ts +3 -0
- package/dist/src/core/global_modules/program/utils/index.d.ts +3 -0
- package/dist/src/core/global_modules/program/utils/records.d.ts +6 -0
- package/dist/src/core/global_modules/records/utils/constraints/fk.d.ts +2 -2
- package/dist/src/core/global_modules/records/utils/constraints/helper.d.ts +1 -2
- package/dist/src/core/global_modules/records/utils/constraints/pk.d.ts +2 -2
- package/dist/src/core/global_modules/records/utils/constraints/unique.d.ts +2 -2
- package/dist/src/core/global_modules/table/bind.d.ts +2 -0
- package/dist/src/core/global_modules/table/interpret.d.ts +12 -1
- package/dist/src/core/global_modules/tableGroup/interpret.d.ts +3 -1
- package/dist/src/core/global_modules/utils.d.ts +5 -1
- package/dist/src/core/local_modules/dep/index.d.ts +2 -0
- package/dist/src/core/local_modules/dep/validate.d.ts +19 -0
- package/dist/src/core/local_modules/metadata/index.d.ts +2 -0
- package/dist/src/core/local_modules/metadata/utils.d.ts +7 -0
- package/dist/src/core/local_modules/metadata/validate.d.ts +14 -0
- package/dist/src/core/types/errors.d.ts +99 -67
- package/dist/src/core/types/keywords.d.ts +4 -1
- package/dist/src/core/types/nodes.d.ts +14 -3
- package/dist/src/core/types/relation.d.ts +6 -2
- package/dist/src/core/types/schemaJson/types.d.ts +45 -1
- package/dist/src/core/types/symbol/metadata.d.ts +30 -11
- package/dist/src/core/types/symbol/symbols.d.ts +10 -1
- package/dist/src/core/utils/diagnostics_reporter/index.d.ts +2 -0
- package/dist/src/core/utils/diagnostics_reporter/records.d.ts +87 -0
- package/dist/src/core/utils/diagnostics_reporter/ref.d.ts +30 -0
- package/dist/src/core/utils/expression.d.ts +2 -1
- package/dist/src/core/utils/interpret.d.ts +12 -2
- package/dist/src/core/utils/note.d.ts +18 -0
- package/dist/src/core/utils/setting.d.ts +13 -14
- package/dist/src/core/utils/span.d.ts +2 -0
- package/dist/src/core/utils/tokens.d.ts +3 -0
- package/dist/src/core/utils/validate.d.ts +16 -2
- package/dist/src/index.d.ts +7 -3
- package/dist/src/services/diagnostics/provider.d.ts +13 -0
- package/dist/src/services/index.d.ts +1 -1
- package/dist/src/services/suggestions/provider.d.ts +19 -0
- package/package.json +4 -3
- package/dist/src/compiler/queries/transform/utils.d.ts +0 -23
- package/dist/src/core/global_modules/program/utils.d.ts +0 -3
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
import { default as Compiler } from '../../compiler';
|
|
2
|
-
import { Color, ColumnType, TokenPosition } from '../types/schemaJson';
|
|
2
|
+
import { Color, ColumnType, CustomMetadata, TokenPosition } from '../types/schemaJson';
|
|
3
3
|
import { SyntaxNode } from '../types/nodes';
|
|
4
4
|
import { default as Report } from '../types/report';
|
|
5
|
+
import { Settings } from './validate';
|
|
6
|
+
import { SettingName } from '../types';
|
|
5
7
|
export declare function getTokenPosition(node: SyntaxNode): TokenPosition;
|
|
6
8
|
export declare function normalizeNote(content: string): string;
|
|
7
9
|
export declare function extractElementName(nameNode: SyntaxNode): {
|
|
8
10
|
schemaName: string[];
|
|
9
11
|
name: string;
|
|
10
12
|
};
|
|
11
|
-
export declare function extractColor(node
|
|
13
|
+
export declare function extractColor(node?: SyntaxNode): Color | undefined;
|
|
12
14
|
export declare function processDefaultValue(valueNode?: SyntaxNode): {
|
|
13
15
|
type: 'number' | 'string' | 'boolean' | 'expression';
|
|
14
16
|
value: string | number;
|
|
15
17
|
} | undefined;
|
|
16
18
|
export declare function processColumnType(compiler: Compiler, typeNode: SyntaxNode): Report<ColumnType>;
|
|
19
|
+
/**
|
|
20
|
+
* Extract inline custom metadata from an aggregated setting list,
|
|
21
|
+
* excluding keys that are natively attached to the element (headercolor and note in `table`, color in `tablegroup`, .etc).
|
|
22
|
+
*
|
|
23
|
+
* NOTE: This is used during interpret phase, so no need to validate values, just extract them
|
|
24
|
+
*/
|
|
25
|
+
export declare function extractCustomInlineMetadata(settingMap: Settings, builtinSettings: readonly SettingName[]): CustomMetadata;
|
|
26
|
+
export declare function extractMetadataValue(node?: SyntaxNode): string | Color | undefined;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SyntaxNode } from '../types/nodes';
|
|
2
|
+
import { TextEdit } from '../../compiler/queries/transform/applyTextEdits';
|
|
3
|
+
/**
|
|
4
|
+
* Produces a TextEdit that updates an existing note's value.
|
|
5
|
+
* Returns undefined if no note exists.
|
|
6
|
+
*/
|
|
7
|
+
export declare function updateNoteEdit(declaration: SyntaxNode, newValue: string): TextEdit | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* Produces a TextEdit that removes an existing note.
|
|
10
|
+
* Returns undefined if no note exists.
|
|
11
|
+
*/
|
|
12
|
+
export declare function removeNoteEdit(declaration: SyntaxNode): TextEdit | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Produces a TextEdit that adds a note to an element.
|
|
15
|
+
* Prioritizes body note form for block elements, falls back to setting attribute.
|
|
16
|
+
* Returns undefined if a note already exists.
|
|
17
|
+
*/
|
|
18
|
+
export declare function addNoteEdit(declaration: SyntaxNode, value: string): TextEdit | undefined;
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { SyntaxNode } from '../types/nodes';
|
|
1
|
+
import { ListExpressionNode, AttributeNode, ElementDeclarationNode, SyntaxNode } from '../types/nodes';
|
|
2
2
|
import { TextEdit } from '../../compiler/queries/transform/applyTextEdits';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
export type SettingLocation = {
|
|
4
|
+
kind: 'attribute';
|
|
5
|
+
settingsList: ListExpressionNode;
|
|
6
|
+
settingNode: AttributeNode;
|
|
7
|
+
settingIndex: number;
|
|
8
|
+
} | {
|
|
9
|
+
kind: 'body';
|
|
10
|
+
declaration: ElementDeclarationNode;
|
|
11
|
+
} | undefined;
|
|
12
|
+
export declare function findSetting(declaration: SyntaxNode, settingName: string): SettingLocation;
|
|
8
13
|
export declare function addSettingEdit(declaration: SyntaxNode, setting: string): TextEdit | undefined;
|
|
9
|
-
|
|
10
|
-
* Produces a TextEdit that updates an existing setting's value in a declaration.
|
|
11
|
-
*/
|
|
12
|
-
export declare function updateSettingEdit(declaration: SyntaxNode, settingName: string, newValue: string, source: string): TextEdit | undefined;
|
|
13
|
-
/**
|
|
14
|
-
* Produces a TextEdit that removes a setting from a declaration.
|
|
15
|
-
* If it's the only setting, removes the entire settings block [...].
|
|
16
|
-
*/
|
|
14
|
+
export declare function updateSettingEdit(declaration: SyntaxNode, settingName: string, value: string | null | undefined, source: string): TextEdit | undefined;
|
|
17
15
|
export declare function removeSettingEdit(declaration: SyntaxNode, settingName: string, source: string): TextEdit | undefined;
|
|
16
|
+
export declare function findBodySetting(declaration: ElementDeclarationNode, settingName: string): ElementDeclarationNode | undefined;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { default as Compiler } from '../../compiler';
|
|
1
2
|
import { ElementDeclarationNode, SyntaxNode } from '../types/nodes';
|
|
2
3
|
import { SyntaxToken } from '../types/tokens';
|
|
3
4
|
export declare function isOffsetWithinSpan(offset: number, nodeOrToken: SyntaxNode | SyntaxToken): boolean;
|
|
4
5
|
export declare function isOffsetWithinElementHeader(offset: number, element: ElementDeclarationNode): boolean;
|
|
6
|
+
export declare function getSourceSnippet(compiler: Compiler, node: SyntaxNode | SyntaxToken): string | undefined;
|
|
@@ -6,6 +6,9 @@ export declare function isAsKeyword(token?: SyntaxToken): token is SyntaxToken &
|
|
|
6
6
|
export declare function isUseKeyword(token?: SyntaxToken): token is SyntaxToken & {
|
|
7
7
|
kind: SyntaxTokenKind.IDENTIFIER;
|
|
8
8
|
};
|
|
9
|
+
export declare function isMetadataKeyword(token?: SyntaxToken): token is SyntaxToken & {
|
|
10
|
+
kind: SyntaxTokenKind.IDENTIFIER;
|
|
11
|
+
};
|
|
9
12
|
export declare function isFromKeyword(token?: SyntaxToken): token is SyntaxToken & {
|
|
10
13
|
kind: SyntaxTokenKind.IDENTIFIER;
|
|
11
14
|
};
|
|
@@ -24,7 +24,15 @@ export declare function isValidPartialInjection(node?: SyntaxNode): node is Pref
|
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
26
|
export declare function isRelationshipOp(op?: string): boolean;
|
|
27
|
-
export declare function
|
|
27
|
+
export declare function isDependencyOp(op?: string): boolean;
|
|
28
|
+
export declare function isValidHexColor(value?: SyntaxNode): value is PrimaryExpressionNode & {
|
|
29
|
+
expression: LiteralNode & {
|
|
30
|
+
literal: {
|
|
31
|
+
kind: SyntaxTokenKind.COLOR_LITERAL;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export declare function isValidColorOrNone(value?: SyntaxNode): boolean;
|
|
28
36
|
export declare function isValidDefaultValue(value?: SyntaxNode): boolean;
|
|
29
37
|
export type SignedNumberExpression = (PrimaryExpressionNode & {
|
|
30
38
|
expression: LiteralNode & {
|
|
@@ -38,6 +46,7 @@ export type SignedNumberExpression = (PrimaryExpressionNode & {
|
|
|
38
46
|
});
|
|
39
47
|
export declare function isExpressionASignedNumberExpression(value?: SyntaxNode): value is SignedNumberExpression;
|
|
40
48
|
export declare function isUnaryRelationship(value?: SyntaxNode): value is PrefixExpressionNode;
|
|
49
|
+
export declare function isUnaryDependency(value?: SyntaxNode): value is PrefixExpressionNode;
|
|
41
50
|
export declare function isTupleOfVariables(value?: SyntaxNode): value is TupleExpressionNode & {
|
|
42
51
|
elementList: (PrimaryExpressionNode & {
|
|
43
52
|
expression: VariableNode;
|
|
@@ -45,6 +54,7 @@ export declare function isTupleOfVariables(value?: SyntaxNode): value is TupleEx
|
|
|
45
54
|
};
|
|
46
55
|
export declare function isValidColumnType(type: SyntaxNode): boolean;
|
|
47
56
|
export type Settings = Record<SettingName | string, AttributeNode[]>;
|
|
57
|
+
export declare function isValidMetadataValue(value?: SyntaxNode): boolean;
|
|
48
58
|
export declare function aggregateSettingList(settingList?: ListExpressionNode): Report<Settings>;
|
|
49
59
|
export declare function isExpressionAQuotedString(value?: unknown): value is PrimaryExpressionNode & ({
|
|
50
60
|
expression: VariableNode & {
|
|
@@ -84,7 +94,11 @@ type DotDelimitedIdentifier = PrimaryExpressionNode | (AccessExpression & {
|
|
|
84
94
|
});
|
|
85
95
|
export declare function isAccessExpression(node?: SyntaxNode): node is AccessExpression;
|
|
86
96
|
export declare function isDotDelimitedIdentifier(node?: SyntaxNode): node is DotDelimitedIdentifier;
|
|
87
|
-
export declare function isElementNode(node: SyntaxNode | undefined, kind:
|
|
97
|
+
export declare function isElementNode<T extends ElementKind>(node: SyntaxNode | undefined, kind: T): node is ElementDeclarationNode & {
|
|
98
|
+
type: {
|
|
99
|
+
value: T;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
88
102
|
export declare function isUseDeclaration(node: SyntaxNode): node is UseDeclarationNode;
|
|
89
103
|
export declare function isUseSpecifier(node: SyntaxNode, kind?: ImportKind): node is UseSpecifierNode;
|
|
90
104
|
export declare function isWildcardSpecifier(node: SyntaxNode): node is WildcardNode;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -4,15 +4,19 @@ export { Filepath } from './core/types/filepath';
|
|
|
4
4
|
export { UNHANDLED, type Unhandled, } from './core/types/module';
|
|
5
5
|
export { ElementKind } from './core/types/keywords';
|
|
6
6
|
export { type NodeSymbol, SymbolKind, } from './core/types/symbol';
|
|
7
|
+
export { MetadataKind } from './core/types/symbol/metadata';
|
|
7
8
|
export * from './core/global_modules/records/utils';
|
|
8
9
|
export * from './core/types/nodes';
|
|
9
10
|
export { SyntaxToken, SyntaxTokenKind, isTriviaToken, isOp, isOpToken, } from './core/types/tokens';
|
|
10
11
|
export { CompileError, CompileErrorCode, } from './core/types/errors';
|
|
11
12
|
export type { Position, } from './core/types';
|
|
12
|
-
export { ScopeKind, splitQualifiedIdentifier, unescapeString, escapeString, formatRecordValue, isValidIdentifier, addDoubleQuoteIfNeeded, } from './compiler/index';
|
|
13
|
-
export { type Database, type MasterDatabase, type Table, type Note, type Column, type ColumnType, type Index, type Check, type InlineRef, type Ref, type RefEndpointPair, type RefEndpoint, type Enum, type EnumField, type TableGroup, type TableGroupField, type Alias, type AliasKind, type TablePartial, type TablePartialInjection, type RecordValue, type RecordValueType, type TableRecord, type Project, type SchemaElement, type TokenPosition, type ElementRef, type FilterConfig, type DiagramView, } from './core/types/schemaJson';
|
|
14
|
-
export { type RelationCardinality, type RelationshipOp, getRelationshipOp, getMultiplicities, parseCardinality, makeCardinalityRequired, makeCardinalityOptional, CARDINALITY_ONE, CARDINALITY_MAYBE, CARDINALITY_SOME, CARDINALITY_MANY, } from './core/types/relation';
|
|
13
|
+
export { ScopeKind, splitQualifiedIdentifier, unescapeString, escapeString, formatRecordValue, isValidIdentifier, addDoubleQuoteIfNeeded, normalizeQualifiedName, } from './compiler/index';
|
|
14
|
+
export { type Database, type MasterDatabase, type Table, type Note, type Column, type ColumnType, type Index, type Check, type InlineRef, type Ref, type RefEndpointPair, type RefEndpoint, type Enum, type EnumField, type TableGroup, type TableGroupField, type Alias, type AliasKind, type TablePartial, type TablePartialInjection, type RecordValue, type RecordValueType, type TableRecord, type Project, type SchemaElement, type TokenPosition, type ElementRef, type FilterConfig, type DiagramView, type CustomMetadata, } from './core/types/schemaJson';
|
|
15
|
+
export { type RelationCardinality, type RelationshipOp, getRelationshipOp, getMultiplicities, parseCardinality, makeCardinalityRequired, makeCardinalityOptional, makeRelationshipRequired, isEndpointOneSide, isEndpointManySide, isEndpointOptional, isEndpointRequired, CARDINALITY_ONE, CARDINALITY_MAYBE, CARDINALITY_SOME, CARDINALITY_MANY, } from './core/types/relation';
|
|
15
16
|
export type { DiagramViewSyncOperation, DiagramViewBlock, TextEdit, } from './compiler/queries/transform';
|
|
17
|
+
export { findDiagramViewBlocks, findDepBlocks } from './compiler/queries/transform';
|
|
18
|
+
export type { DepSyncOperation, DepSyncEdge, DepEndpointRef, DepBlock, } from './compiler/queries/transform';
|
|
19
|
+
export type { ElementIdentifier, SchemaIdentifier, TableIdentifier, ColumnIdentifier, EnumIdentifier, EndpointRef, RefIdentifier, DepIdentifier, NoteIdentifier, TableGroupIdentifier, } from './compiler/queries/transform';
|
|
16
20
|
export { dbmlLanguageConfig, dbmlMonarchTokensProvider, } from './services/monarch';
|
|
17
21
|
export * from './compiler/projectLayout/layout';
|
|
18
22
|
export { Compiler };
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import { default as Compiler } from '../../compiler';
|
|
2
2
|
import { Filepath } from '../../core/types/filepath';
|
|
3
3
|
import { MarkerData } from '../types';
|
|
4
|
+
export interface DiagnosticQuickFix {
|
|
5
|
+
title: string;
|
|
6
|
+
shortTitle?: string;
|
|
7
|
+
edits: {
|
|
8
|
+
start: number;
|
|
9
|
+
end: number;
|
|
10
|
+
newText: string;
|
|
11
|
+
}[];
|
|
12
|
+
isPreferred?: boolean;
|
|
13
|
+
}
|
|
4
14
|
export interface Diagnostic {
|
|
5
15
|
type: 'error' | 'warning' | 'info';
|
|
6
16
|
text: string;
|
|
@@ -9,7 +19,10 @@ export interface Diagnostic {
|
|
|
9
19
|
endRow: number;
|
|
10
20
|
endColumn: number;
|
|
11
21
|
code?: string | number;
|
|
22
|
+
category?: string;
|
|
23
|
+
explanation?: string;
|
|
12
24
|
filepath: Filepath;
|
|
25
|
+
quickFixes?: DiagnosticQuickFix[];
|
|
13
26
|
}
|
|
14
27
|
export default class DBMLDiagnosticsProvider {
|
|
15
28
|
private compiler;
|
|
@@ -3,7 +3,7 @@ import { default as DBMLDefinitionProvider } from './definition/provider';
|
|
|
3
3
|
import { default as DBMLDiagnosticsProvider } from './diagnostics/provider';
|
|
4
4
|
import { default as DBMLReferencesProvider } from './references/provider';
|
|
5
5
|
import { default as DBMLCompletionItemProvider } from './suggestions/provider';
|
|
6
|
-
export type { Diagnostic } from './diagnostics/provider';
|
|
6
|
+
export type { Diagnostic, DiagnosticQuickFix } from './diagnostics/provider';
|
|
7
7
|
export * from './types';
|
|
8
8
|
export { DBMLCodeActionProvider, DBMLCompletionItemProvider, DBMLDefinitionProvider, DBMLReferencesProvider, DBMLDiagnosticsProvider, };
|
|
9
9
|
export { dbmlMonarchTokensProvider } from './monarch';
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
import { default as Compiler } from '../../compiler';
|
|
2
|
+
import { SettingName } from '../../core/types/keywords';
|
|
2
3
|
import { CompletionItemProvider, CompletionList, Position, TextModel } from '../types';
|
|
4
|
+
export declare const COLUMN_TYPE_SUGGESTION_LABELS: readonly ["integer", "int", "tinyint", "smallint", "mediumint", "bigint", "bit", "bool", "binary", "varbinary", "logical", "char", "nchar", "varchar", "varchar2", "nvarchar", "nvarchar2", "binary_float", "binary_double", "float", "double", "decimal", "dec", "real", "money", "smallmoney", "enum", "tinyblob", "tinytext", "blob", "text", "mediumblob", "mediumtext", "longblob", "longtext", "ntext", "set", "inet6", "uuid", "image", "date", "time", "datetime", "datetime2", "timestamp", "year", "smalldatetime", "datetimeoffset", "XML", "sql_variant", "uniqueidentifier", "CURSOR", "BFILE", "CLOB", "NCLOB", "RAW"];
|
|
5
|
+
export declare const TABLE_SETTING_SUGGESTION_LABELS: readonly [SettingName.HeaderColor, SettingName.Note];
|
|
6
|
+
export declare const TABLE_SETTING_SUGGESTION_TEXT_INSERTS: string[];
|
|
7
|
+
export declare const COLUMN_SUGGESTION_LABELS: (SettingName.Note | SettingName.PK | SettingName.PrimaryKey | SettingName.Unique | SettingName.Ref | SettingName.Dep | SettingName.NotNull | SettingName.Null | SettingName.Increment | SettingName.Default | SettingName.Check)[];
|
|
8
|
+
export declare const COLUMN_SUGGESTION_TEXT_INSERTS: string[];
|
|
9
|
+
export declare const INDEX_SETTING_SUGGESTION_LABELS: (SettingName.Note | SettingName.PK | SettingName.Unique | SettingName.Name | SettingName.Type)[];
|
|
10
|
+
export declare const INDEX_SETTING_SUGGESTION_TEXT_INSERTS: string[];
|
|
11
|
+
export declare const REF_SETTING_SUGGESTION_LABELS: (SettingName.Color | SettingName.Update | SettingName.Delete | SettingName.Inactive)[];
|
|
12
|
+
export declare const REF_SETTING_SUGGESTION_TEXT_INSERTS: string[];
|
|
13
|
+
export declare const ENUM_SETTING_SUGGESTION_LABELS: readonly [SettingName.Note];
|
|
14
|
+
export declare const ENUM_SETTING_SUGGESTION_TEXT_INSERTS: string[];
|
|
15
|
+
export declare const CHECK_SETTING_SUGGESTION_LABELS: readonly [SettingName.Name];
|
|
16
|
+
export declare const CHECK_SETTING_SUGGESTION_TEXT_INSERTS: string[];
|
|
17
|
+
export declare const REF_ACTION_VALUE_SUGGESTIONS: readonly ["cascade", "set default", "set null", "restrict"];
|
|
18
|
+
export declare const INDEX_TYPE_VALUE_SUGGESTIONS: readonly ["btree", "hash"];
|
|
19
|
+
export declare const TABLE_BODY_SUGGESTION_LABELS: ("indexes" | "checks" | "Note" | "Records")[];
|
|
20
|
+
export declare const PROJECT_FIELD_SUGGESTION_LABELS: ("Table" | "Enum" | "TableGroup" | "TablePartial" | "Note" | "Ref" | "Dep")[];
|
|
3
21
|
export interface DBMLCompletionItemProviderOptions {
|
|
4
22
|
triggerCharacters?: string[];
|
|
5
23
|
}
|
|
@@ -9,3 +27,4 @@ export default class DBMLCompletionItemProvider implements CompletionItemProvide
|
|
|
9
27
|
constructor(compiler: Compiler, options?: DBMLCompletionItemProviderOptions);
|
|
10
28
|
provideCompletionItems(model: TextModel, position: Position): CompletionList;
|
|
11
29
|
}
|
|
30
|
+
export declare const TOP_LEVEL_SUGGESTION_LABELS: ("Table" | "Enum" | "TableGroup" | "TablePartial" | "Note" | "DiagramView" | "Metadata" | "Ref" | "Dep" | "Project" | "Records")[];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
3
|
"name": "@dbml/parse",
|
|
4
|
-
"version": "10.
|
|
4
|
+
"version": "10.1.0-alpha.0",
|
|
5
5
|
"description": "DBML parser v2",
|
|
6
6
|
"author": "Holistics <dev@holistics.io>",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
"test:watch": "vitest watch",
|
|
32
32
|
"coverage": "vitest run --coverage",
|
|
33
33
|
"prepare": "npm run build",
|
|
34
|
-
"lint": "eslint .",
|
|
34
|
+
"lint": "eslint $(git diff --relative --name-only --diff-filter=ACMRTUXB master -- . | grep -E '\\.ts$')",
|
|
35
|
+
"lint:all": "eslint .",
|
|
35
36
|
"lint:fix": "eslint --fix .",
|
|
36
37
|
"bench": "npx tsx __benchmarks__/compiler.benchmark.ts",
|
|
37
38
|
"profile:build": "vite build --config vite.profile.config.mts && cp -r __benchmarks__/input dist-profile/input",
|
|
@@ -50,5 +51,5 @@
|
|
|
50
51
|
"engines": {
|
|
51
52
|
"node": ">=18"
|
|
52
53
|
},
|
|
53
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "b9c9c643d79c2ab0677852a1742fb3cc57561f73"
|
|
54
55
|
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Filepath } from '../../../core/types/filepath';
|
|
2
|
-
import { NodeSymbol } from '../../../core/types/symbol';
|
|
3
|
-
import { default as Compiler } from '../../index';
|
|
4
|
-
export type TableNameInput = string | {
|
|
5
|
-
schema?: string;
|
|
6
|
-
table: string;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Normalizes a table name input to { schema, table } format.
|
|
10
|
-
* Properly handles quoted identifiers with dots inside.
|
|
11
|
-
*/
|
|
12
|
-
export declare function normalizeTableName(input: TableNameInput): {
|
|
13
|
-
schema: string;
|
|
14
|
-
table: string;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Looks up a table symbol by matching its full qualified name.
|
|
18
|
-
*/
|
|
19
|
-
export declare function lookupTableSymbol(compiler: Compiler, filepath: Filepath, schema: string, table: string): NodeSymbol | null;
|
|
20
|
-
/**
|
|
21
|
-
* Removes surrounding double quotes from a string if present.
|
|
22
|
-
*/
|
|
23
|
-
export declare function stripQuotes(str: string): string;
|