Skip to content

Commit

Permalink
reorganize API definitions to avoid circular imports
Browse files Browse the repository at this point in the history
  • Loading branch information
bollwyvl committed Mar 21, 2021
1 parent 93e7d4d commit 76bef7d
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 32 deletions.
14 changes: 14 additions & 0 deletions packages/jupyterlab-lsp/src/api/extractor.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* Extractor Public API
*
* Please note that this APIs can be subject to change and relocation to separate package in the future releases.
*
* @see https://github.com/krassowski/jupyterlab-lsp/issues/561
*/
export { LanguageIdentifier } from '../lsp';
export {
IForeignCodeExtractor,
IForeignCodeExtractorsRegistry,
IExtractedCode
} from '../extractors/types';
export { RegExpForeignCodeExtractor } from '../extractors/regexp';
5 changes: 5 additions & 0 deletions packages/jupyterlab-lsp/src/api/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/** Extractor Public API */
export * from './extractor';

/** Overrides Public API */
export * from './overrides';
11 changes: 11 additions & 0 deletions packages/jupyterlab-lsp/src/api/overrides.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Overrides Public API
*
* Please note that this APIs can be subject to change and relocation to separate package in the future releases.
*
* @see https://github.com/krassowski/jupyterlab-lsp/issues/561
*/
export {
ILSPCodeOverridesManager,
IScopedCodeOverride
} from '../overrides/tokens';
10 changes: 8 additions & 2 deletions packages/jupyterlab-lsp/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/** The Public API, as exposed in the `main` field of package.json */

/** General public tokens, including lumino Tokens and namespaces */
export * from './tokens';

/** Component- and feature-specific APIs */
export * from './api';

import {
JupyterFrontEnd,
JupyterFrontEndPlugin
Expand Down Expand Up @@ -51,8 +59,6 @@ import { CODE_OVERRIDES_MANAGER } from './overrides';
import IPaths = JupyterFrontEnd.IPaths;
import { LOG_CONSOLE } from './virtual/console';

export * from './tokens';

export interface IFeatureOptions {
/**
* The feature to be registered.
Expand Down
32 changes: 2 additions & 30 deletions packages/jupyterlab-lsp/src/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,39 +17,11 @@ import {
IContextMenuOptions
} from './command_manager';
import IEditor = CodeEditor.IEditor;

/**
* Extractor API
*
* Please note that this APIs can be subject to change and relocation to separate package in the future releases.
*
* @see https://github.com/krassowski/jupyterlab-lsp/issues/561
*/
import { LanguageIdentifier } from './lsp';
import {
IForeignCodeExtractor,
IForeignCodeExtractorsRegistry,
IExtractedCode
IForeignCodeExtractorsRegistry
} from './extractors/types';
export {
IExtractedCode,
IForeignCodeExtractorsRegistry,
IForeignCodeExtractor,
LanguageIdentifier
};
export { RegExpForeignCodeExtractor } from './extractors/regexp';

/**
* Overrides API
*
* Please note that this APIs can be subject to change and relocation to separate package in the future releases.
*
* @see https://github.com/krassowski/jupyterlab-lsp/issues/561
*/
export {
ILSPCodeOverridesManager,
IScopedCodeOverride
} from './overrides/tokens';
import { LanguageIdentifier } from './lsp';

export type TLanguageServerId = string;
export type TLanguageId = string;
Expand Down

0 comments on commit 76bef7d

Please sign in to comment.