Skip to content

Commit

Permalink
Adding foreign code extractors for spark sql and exporting other requ…
Browse files Browse the repository at this point in the history
…ired classes
  • Loading branch information
skakker committed Sep 15, 2023
1 parent dc46506 commit b80b4d1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/jupyterlab-lsp/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
/** General public tokens, including lumino Tokens and namespaces */
export * from './tokens';

/** Export the required classes */
export {FileEditorAdapter} from './adapters/file_editor/file_editor';
export {FileEditorContextMenuEntryPoint} from './adapters/file_editor';
export {PositionConverter} from './converter';
export {VirtualDocument} from './virtual/document';

/** Generated JSON Schema types for server responses and settings */
export * as SCHEMA from './_schema';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,20 @@ export let foreign_code_extractors: IForeignCodeExtractorsRegistry = {
foreign_capture_groups: [1],
is_standalone: false,
file_extension: 'sql'
}),
new RegExpForeignCodeExtractor({
language: 'sql',
pattern: `^%%spark -c sql(?: (?:${SQL_URL_PATTERN}|${COMMAND_PATTERN}|(?:\\w+ << )|(?:\\w+@\\w+)))?\n?((?:.+\n)?(?:[^]*))`,
foreign_capture_groups: [1],
is_standalone: true,
file_extension: 'sql'
}),
new RegExpForeignCodeExtractor({
language: 'sql',
pattern: `(?:^|\n)%spark -c sql (?:${SQL_URL_PATTERN}|${COMMAND_PATTERN}|(.*))\n?`,
foreign_capture_groups: [1],
is_standalone: false,
file_extension: 'sql'
})
]
};

0 comments on commit b80b4d1

Please sign in to comment.