Skip to content

Commit

Permalink
Merge pull request #77 from bollwyvl/gh-76-step-0-composite
Browse files Browse the repository at this point in the history
upgrade typescript, use composite, remove require usage (76  0️⃣ )
  • Loading branch information
krassowski authored Oct 29, 2019
2 parents 903ee46 + 1add7ce commit 21ff0cc
Show file tree
Hide file tree
Showing 24 changed files with 579 additions and 263 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ venv.bak/

node_modules
.yarn-packages
*.tsbuildinfo

atest/output/
junit.xml
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
},
"scripts": {
"bootstrap": "jlpm && jlpm clean && jlpm lint && jlpm build",
"build": "tsc",
"build": "tsc -b",
"clean": "rimraf lib",
"watch": "tsc -w",
"watch": "tsc -b -w",
"lint": "jlpm prettier && jlpm tslint",
"lint:check": "jlpm prettier:check && jlpm tslint:check",
"prettier": "prettier --write '**/*{.ts,.tsx,.js,.jsx,.css,.json,.md,.yml}'",
Expand Down Expand Up @@ -94,7 +94,7 @@
"tslint-config-prettier": "^1.18.0",
"tslint-plugin-prettier": "^2.0.1",
"tslint-react": "^4.0.0",
"typescript": "~3.4.5",
"typescript": "~3.5.1",
"unified-language-server": "^0.3.0",
"vscode-css-languageserver-bin": "^1.4.0",
"vscode-html-languageserver-bin": "^1.4.0",
Expand Down
2 changes: 1 addition & 1 deletion src/adapters/codemirror/cm_adapter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { CodeMirrorAdapter } from './cm_adapter';
import { LSPConnection } from '../../connection';
import { IJupyterLabComponentsManager } from '../jupyterlab/jl_adapter';
import { IRootPosition } from '../../positioning';
import CodeMirror = require('codemirror');
import * as CodeMirror from 'codemirror';
import { CodeMirrorLSPFeature } from './feature';
import { FeatureTestEnvironment } from './testutils';

Expand Down
2 changes: 1 addition & 1 deletion src/adapters/codemirror/cm_adapter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export import CodeMirror = require('codemirror');
import * as CodeMirror from 'codemirror';
import { until_ready } from '../../utils';
import { CodeMirrorHandler, VirtualEditor } from '../../virtual/editor';
import { VirtualDocument } from '../../virtual/document';
Expand Down
2 changes: 1 addition & 1 deletion src/adapters/codemirror/feature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { IJupyterLabComponentsManager } from '../jupyterlab/jl_adapter';
// import { Listener } from 'events';
import * as lsProtocol from 'vscode-languageserver-protocol';
import { PositionConverter } from '../../converter';
import { CodeMirror } from './cm_adapter';
import * as CodeMirror from 'codemirror';
import { ICommandContext } from '../../command_manager';

export enum CommandEntryPoint {
Expand Down
2 changes: 1 addition & 1 deletion src/adapters/codemirror/features/completion.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CompletionTriggerKind } from '../../../lsp';
import CodeMirror = require('codemirror');
import * as CodeMirror from 'codemirror';
import { CodeMirrorLSPFeature } from '../feature';

export class Completion extends CodeMirrorLSPFeature {
Expand Down
2 changes: 1 addition & 1 deletion src/adapters/codemirror/features/diagnostics.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CodeMirror } from '../cm_adapter';
import * as CodeMirror from 'codemirror';
import * as lsProtocol from 'vscode-languageserver-protocol';
import { PositionConverter } from '../../../converter';
import { IVirtualPosition } from '../../../positioning';
Expand Down
2 changes: 1 addition & 1 deletion src/adapters/codemirror/features/highlights.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CodeMirror } from '../cm_adapter';
import * as CodeMirror from 'codemirror';
import * as lsProtocol from 'vscode-languageserver-protocol';
import { documentHighlightKindNames } from '../../../lsp';
import { VirtualDocument } from '../../../virtual/document';
Expand Down
2 changes: 1 addition & 1 deletion src/adapters/codemirror/features/hover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
IVirtualPosition
} from '../../../positioning';
import * as lsProtocol from 'vscode-languageserver-protocol';
import { CodeMirror } from '../cm_adapter';
import * as CodeMirror from 'codemirror';
import { CodeMirrorLSPFeature, IEditorRange } from '../feature';
import { Debouncer } from '@jupyterlab/coreutils';

Expand Down
2 changes: 1 addition & 1 deletion src/adapters/codemirror/features/signature.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as lsProtocol from 'vscode-languageserver-protocol';
import { IRootPosition } from '../../../positioning';
import CodeMirror = require('codemirror');
import * as CodeMirror from 'codemirror';
import { CodeMirrorLSPFeature } from '../feature';

export class Signature extends CodeMirrorLSPFeature {
Expand Down
8 changes: 6 additions & 2 deletions src/adapters/codemirror/testutils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,15 @@ export class FeatureTestEnvironment implements IFeatureTestEnvironment {

public create_dummy_components(): IJupyterLabComponentsManager {
return {
invoke_completer: () => {},
invoke_completer: () => {
// nothing yet
},
create_tooltip: () => {
return {} as FreeTooltip;
},
remove_tooltip: () => {},
remove_tooltip: () => {
// nothing yet
},
jumper: null
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/adapters/jupyterlab/file_editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { JupyterLabWidgetAdapter } from './jl_adapter';
import { FileEditor } from '@jupyterlab/fileeditor';
import { IDocumentWidget } from '@jupyterlab/docregistry';
import { FileEditorJumper } from '@krassowski/jupyterlab_go_to_definition/lib/jumpers/fileeditor';
import { CodeMirror } from '../codemirror/cm_adapter';
import * as CodeMirror from 'codemirror';
import { JupyterFrontEnd } from '@jupyterlab/application';
import { IRenderMimeRegistry } from '@jupyterlab/rendermime';
import { CodeMirrorEditor } from '@jupyterlab/codemirror';
Expand Down
3 changes: 2 additions & 1 deletion src/adapters/jupyterlab/jl_adapter.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { PathExt } from '@jupyterlab/coreutils';
import { CodeMirror, CodeMirrorAdapter } from '../codemirror/cm_adapter';
import * as CodeMirror from 'codemirror';
import { CodeMirrorAdapter } from '../codemirror/cm_adapter';
import { JupyterFrontEnd } from '@jupyterlab/application';
import { CodeJumper } from '@krassowski/jupyterlab_go_to_definition/lib/jumpers/jumper';
import { PositionConverter } from '../../converter';
Expand Down
2 changes: 1 addition & 1 deletion src/adapters/jupyterlab/notebook.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { JupyterLabWidgetAdapter } from './jl_adapter';
import { Notebook, NotebookPanel } from '@jupyterlab/notebook';
import { CodeMirror } from '../codemirror/cm_adapter';
import * as CodeMirror from 'codemirror';
import { VirtualEditorForNotebook } from '../../virtual/editors/notebook';
import { ICompletionManager } from '@jupyterlab/completer';
import { NotebookJumper } from '@krassowski/jupyterlab_go_to_definition/lib/jumpers/notebook';
Expand Down
2 changes: 1 addition & 1 deletion src/converter.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as lsProtocol from 'vscode-languageserver-protocol';
import { CodeEditor } from '@jupyterlab/codeeditor';
import CodeMirror = require('codemirror');
import * as CodeMirror from 'codemirror';

export class PositionConverter {
static lsp_to_cm(position: lsProtocol.Position): CodeMirror.Position {
Expand Down
2 changes: 1 addition & 1 deletion src/positioning.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export import CodeMirror = require('codemirror');
import * as CodeMirror from 'codemirror';

/**
* is_* attributes are there only to enforce strict interface type checking
Expand Down
2 changes: 1 addition & 1 deletion src/virtual/document.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect } from 'chai';
import { RegExpForeignCodeExtractor } from '../extractors/regexp';
import { is_within_range, VirtualDocument } from './document';
import CodeMirror = require('codemirror');
import * as CodeMirror from 'codemirror';
import { ISourcePosition, IVirtualPosition } from '../positioning';
import { CodeEditor } from '@jupyterlab/codeeditor';

Expand Down
2 changes: 1 addition & 1 deletion src/virtual/document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { IOverridesRegistry } from '../magics/overrides';
import { DefaultMap } from '../utils';
import { Signal } from '@phosphor/signaling';
import { CodeEditor } from '@jupyterlab/codeeditor';
import { CodeMirror } from '../adapters/codemirror/cm_adapter';
import * as CodeMirror from 'codemirror';
import {
IEditorPosition,
ISourcePosition,
Expand Down
10 changes: 7 additions & 3 deletions src/virtual/editor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
IRootPosition,
IVirtualPosition
} from '../positioning';
import CodeMirror = require('codemirror');
import * as CodeMirror from 'codemirror';

class VirtualEditorImplementation extends VirtualEditor {
private cm_editor: CodeMirror.Editor;
Expand All @@ -29,9 +29,13 @@ class VirtualEditorImplementation extends VirtualEditor {
addEventListener(
type: string,
listener: EventListener | EventListenerObject
): void {}
): void {
// nothing yet
}

protected perform_documents_update(): void {}
protected perform_documents_update(): void {
// nothing yet
}

forEveryBlockEditor(callback: (cm_editor: CodeMirror.Editor) => void): void {
callback(this.cm_editor);
Expand Down
2 changes: 1 addition & 1 deletion src/virtual/editor.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { VirtualDocument } from './document';
import { IOverridesRegistry } from '../magics/overrides';
import { IForeignCodeExtractorsRegistry } from '../extractors/types';
import { CodeMirror } from '../adapters/codemirror/cm_adapter';
import * as CodeMirror from 'codemirror';
import {
IEditorPosition,
IRootPosition,
Expand Down
2 changes: 1 addition & 1 deletion src/virtual/editors/file_editor.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { VirtualEditor } from '../editor';
import { CodeMirror } from '../../adapters/codemirror/cm_adapter';
import * as CodeMirror from 'codemirror';
import {
IEditorPosition,
IRootPosition,
Expand Down
2 changes: 1 addition & 1 deletion src/virtual/editors/notebook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ShowHintOptions } from 'codemirror';
import { IOverridesRegistry } from '../../magics/overrides';
import { IForeignCodeExtractorsRegistry } from '../../extractors/types';
import { VirtualEditor } from '../editor';
import CodeMirror = require('codemirror');
import * as CodeMirror from 'codemirror';
import {
IEditorPosition,
IRootPosition,
Expand Down
6 changes: 4 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"compilerOptions": {
"declaration": true,
"lib": ["es2015", "dom"],
"composite": true,
"module": "commonjs",
"moduleResolution": "node",
"noEmitOnError": true,
Expand All @@ -13,7 +14,8 @@
"strictNullChecks": false,
"esModuleInterop": true,
"target": "es2015",
"types": ["jest"]
"types": ["jest"],
"tsBuildInfoFile": "lib/.tsbuildinfo"
},
"include": ["src/*", "src/editors/*", "src/adapters/*"]
"include": ["src/**/*"]
}
Loading

0 comments on commit 21ff0cc

Please sign in to comment.