├── typescript-ast-util ├── spec │ ├── testUtil.ts │ ├── support │ │ ├── jasmine.json │ │ └── jasmine-js.json │ ├── index.ts │ ├── createProgramSpec.ts │ └── findAscendantSpec.ts ├── tests │ ├── buildAstAndPrintCode.ts │ └── scannertest1.ts ├── .npmignore ├── .gitignore ├── src │ ├── index.ts │ ├── assets │ │ └── simpletsconfig.json │ └── misc.ts ├── tsconfig.json ├── README.md └── LICENSE ├── plugin-scratch-1 ├── .gitignore ├── test-project │ ├── .gitignore │ ├── src │ │ └── index.ts │ ├── .vscode │ │ └── settings.json │ ├── tsconfig.json │ ├── package-lock.json │ └── package.json ├── README.md ├── .vscode │ └── settings.json ├── tsconfig.json ├── package.json └── package-lock.json ├── input-ui-ipc-provider ├── src │ ├── declarations.d.ts │ ├── index.ts │ └── consumerInstance.ts ├── spec │ ├── providerSpec.ts │ └── support │ │ ├── jasmine.json │ │ └── jasmine-js.json ├── .npmignore ├── .gitignore ├── tsconfig.json └── LICENSE ├── ts-run ├── .babelrc.json ├── .gitignore ├── src │ ├── index.ts │ ├── misc.ts │ ├── test │ │ └── index.html │ ├── getCompilerOptions.ts │ └── file.ts ├── spec │ ├── support │ │ └── jasmine.json │ ├── researchSpec.ts │ └── nodeSpec.ts ├── api │ ├── modules │ │ ├── _index_.md │ │ ├── _file_.md │ │ ├── _types_.md │ │ ├── _getcompileroptions_.md │ │ ├── _run_.md │ │ └── _emit_.md │ └── interfaces │ │ └── _types_.file.md ├── .npmignore ├── jest.config-spec.js ├── CHANGELOG.md ├── tsconfig.json └── LICENSE ├── typescript-plugin-test-helper ├── assets │ └── sampleProject1 │ │ └── src │ │ ├── index.ts │ │ └── model │ │ ├── abstract │ │ ├── machine.ts │ │ └── computer.ts │ │ └── concretes │ │ └── dell123.ts ├── .npmignore ├── .gitignore ├── spec │ ├── support │ │ ├── jasmine.json │ │ └── jasmine-js.json │ └── indexSpec.ts ├── README.md ├── tsconfig.json └── package.json ├── typescript-plugin-move-file ├── declarations.d.ts ├── .gitignore ├── doc-assets │ ├── atom-move-file.gif │ └── vs-code-move-file.gif ├── .npmignore ├── tsconfig.json └── LICENSE ├── plain-typescript-test-project ├── src │ ├── other │ │ ├── file2.ts │ │ └── file.ts │ └── index.ts ├── README.md ├── tsconfig.json └── package.json ├── .npmignore ├── typescript-plugin-ast-inspector ├── src │ ├── typings.ts │ └── regex-groups-index.ts ├── .npmignore ├── .gitignore ├── doc-assets │ ├── print-ast.gif │ ├── evalCodeVsCode.gif │ └── print-parent-nodes.gif ├── tsconfig.json └── LICENSE ├── .gitignore ├── typescript-plugin-move-declaration ├── assets │ ├── sampleProject1 │ │ ├── src │ │ │ ├── model │ │ │ │ ├── Alive.ts │ │ │ │ ├── Eatable.ts │ │ │ │ ├── fruit.ts │ │ │ │ ├── seeds.ts │ │ │ │ ├── level2 │ │ │ │ │ └── usingApples.ts │ │ │ │ └── apple.ts │ │ │ ├── index.ts │ │ │ └── tools.ts │ │ ├── tsconfig.json │ │ └── package.json │ └── sampleProject2 │ │ ├── src │ │ └── model │ │ │ ├── base │ │ │ ├── Thing.ts │ │ │ └── impl │ │ │ │ └── ThingImpl.ts │ │ │ └── units │ │ │ ├── AttackerUnit.ts │ │ │ ├── Unit.ts │ │ │ ├── UnitImpl.ts │ │ │ └── impl │ │ │ ├── Archer.ts │ │ │ ├── Knight.ts │ │ │ └── Warrior.ts │ │ ├── tsconfig.json │ │ └── package.json ├── .npmignore ├── .gitignore ├── doc-assets │ └── vscode-move-interface.gif ├── spec │ └── support │ │ ├── jasmine.json │ │ └── jasmine-js.json ├── tsconfig.json ├── .vscode │ ├── tasks.json │ └── launch.json └── LICENSE ├── typescript-plugin-add-type ├── .npmignore ├── .gitignore ├── doc-assets │ └── vscode.gif ├── tsconfig.json ├── package.json └── LICENSE ├── typescript-plugin-proactive-code-fixes ├── src │ ├── typings.ts │ └── code-fix │ │ └── organizeImportsAndFormat.ts ├── assets │ └── sampleProject1 │ │ ├── src │ │ ├── constToVar.ts │ │ ├── second.ts │ │ ├── third.ts │ │ └── index.ts │ │ ├── tsconfig.json │ │ └── package.json ├── .npmignore ├── doc-assets │ ├── declareReturnTypeAtom.gif │ ├── extractInterfaceVsCode.gif │ ├── template2LiteralVsCode.gif │ ├── convertToNamedParamsAtom.gif │ ├── declareConstructorVsCode.gif │ ├── declareReturnTypeVsCode.gif │ ├── delegateMethodVisualCode.gif │ ├── variableRelatedFixesVsCode.gif │ ├── declareClassAndInterfaceVsCode.gif │ └── arrowFunctionsBodyTransformationsVsCode.gif ├── .gitignore ├── spec │ ├── support │ │ ├── jasmine.json │ │ └── jasmine-js.json │ ├── tests │ │ ├── importFromLibrary.ts │ │ ├── useVirtualFileSystemTypesIssue.1.ts │ │ ├── useVirtualFileSystemTypesIssue.ts │ │ ├── addMemberGetStartIssue.ts │ │ └── newExpr.ts │ ├── addReturnStatementSpec.ts │ ├── const2letSpec.ts │ ├── variableRenameSpec.ts │ ├── implementInterfaceMemberSpec.ts │ ├── declareReturnTypeSpec.ts │ ├── stringChangeQuoteCharSpec.ts │ ├── memberChangeScopeSpec.ts │ ├── splitVariableDeclarationListSpec.ts │ ├── changeReturnTypeSpec.ts │ ├── declareConstructorSpec.ts │ ├── declareClassSpec.ts │ └── removeCommentsSpec.ts ├── tsconfig.json ├── .vscode │ ├── tasks.json │ └── launch.json └── LICENSE ├── input-ui-ipc-provider-vscode ├── .gitignore ├── .gitattributes ├── .vscodeignore ├── tslint.json ├── README.md ├── CHANGELOG.md ├── tsconfig.json ├── LICENSE └── package.json ├── typescript-plugin-extract-interface ├── .npmignore ├── .gitignore ├── doc-assets │ └── extract-interface.gif ├── tsconfig.json ├── package.json └── LICENSE ├── vscode-typescript-refactors ├── .gitignore ├── .gitattributes ├── .vscodeignore ├── .vscode │ ├── extensions.json │ ├── settings.json │ └── tasks.json ├── src │ ├── extension.ts │ └── test │ │ ├── extension.test.ts │ │ └── index.ts ├── tslint.json ├── CHANGELOG.md ├── tsconfig.json └── LICENSE ├── sample-ts-plugin1-sample-project ├── .vscode │ └── settings.json ├── tsconfig.json ├── package.json └── src │ └── test1.ts ├── typescript-plugin-method-delegate ├── .npmignore ├── doc-assets │ └── vscode.gif ├── .gitignore ├── spec │ └── support │ │ └── jasmine.json ├── tsconfig.json └── assets │ └── sampleProject1 │ ├── tsconfig.json │ ├── src │ └── index.ts │ └── package.json ├── input-ui-ipc-provider-test-vscode-extension ├── .gitignore ├── .gitattributes ├── .vscodeignore ├── .vscode │ ├── extensions.json │ ├── settings.json │ └── tasks.json ├── src │ ├── extension.ts │ └── test │ │ ├── extension.test.ts │ │ └── index.ts ├── tslint.json ├── CHANGELOG.md ├── tsconfig.json └── LICENSE ├── typescript-plugin-postfix ├── .npmignore ├── .gitignore ├── tsconfig.json └── src │ └── postfixHome.ts ├── typescript-plugin-util ├── src │ └── index.ts ├── spec │ ├── testSpec.ts │ ├── support │ │ └── jasmine.json │ └── index.ts ├── .gitignore ├── .npmignore ├── tsconfig.json ├── package.json └── LICENSE ├── typescript-node-ids ├── .npmignore ├── .gitignore ├── spec │ ├── support │ │ └── jasmine.json │ └── testUtil.ts ├── tsconfig.json ├── src │ └── util.ts ├── LICENSE └── package.json ├── typescript-plugin-all-ts-fixes-and-refactors ├── .npmignore ├── .gitignore ├── spec │ ├── support │ │ ├── jasmine.json │ │ └── jasmine-js.json │ └── firstSpec.ts └── tsconfig.json ├── docs ├── sample-ts-plugin1 │ ├── plugin-screencast.gif │ └── public │ │ └── fonts │ │ ├── aller-bold.eot │ │ ├── aller-bold.ttf │ │ ├── aller-bold.woff │ │ ├── aller-light.eot │ │ ├── aller-light.ttf │ │ ├── aller-light.woff │ │ ├── roboto-black.eot │ │ ├── roboto-black.ttf │ │ └── roboto-black.woff ├── ts-simple-ast-extra │ └── assets │ │ ├── images │ │ ├── icons.png │ │ ├── icons@2x.png │ │ ├── widgets.png │ │ └── widgets@2x.png │ │ └── js │ │ └── search.js └── typescript-ast-util │ └── assets │ ├── images │ ├── icons.png │ ├── icons@2x.png │ ├── widgets.png │ └── widgets@2x.png │ └── js │ └── search.js ├── input-ui-ipc-provider-test-typescript-plugin ├── README.md ├── .npmignore ├── .gitignore ├── spec │ ├── indexSpec.ts │ └── support │ │ ├── jasmine.json │ │ └── jasmine-js.json ├── tsconfig.json └── LICENSE ├── ts-simple-ast-extra ├── spec │ ├── assets │ │ ├── projectSample1 │ │ │ ├── src │ │ │ │ └── model │ │ │ │ │ ├── base │ │ │ │ │ ├── Thing.ts │ │ │ │ │ └── impl │ │ │ │ │ │ └── ThingImpl.ts │ │ │ │ │ └── units │ │ │ │ │ ├── AttackerUnit.ts │ │ │ │ │ ├── Unit.ts │ │ │ │ │ ├── UnitImpl.ts │ │ │ │ │ └── impl │ │ │ │ │ ├── Archer.ts │ │ │ │ │ ├── Knight.ts │ │ │ │ │ └── Warrior.ts │ │ │ └── tsconfig.json │ │ └── moveDeclarationReal.ts │ ├── support │ │ └── jasmine.json │ ├── refactors │ │ ├── convertToEs6ModuleSpec.ts │ │ ├── moveToNewFileSpec.ts │ │ ├── quoteSpec.ts │ │ ├── emptyLinesSpec.ts │ │ ├── organizeImportsSpec.ts │ │ └── convertImportsSpec.ts │ ├── incubator │ │ └── probes │ │ │ ├── tsmorphIssue.ts │ │ │ └── toJson.ts │ └── generalNodeSpec.ts ├── src │ ├── astPath │ │ ├── index.ts │ │ └── selectNode.ts │ ├── refactor │ │ ├── impl │ │ │ ├── refactors.ts │ │ │ ├── organizeImports.ts │ │ │ ├── removeAllUnused.ts │ │ │ ├── moveToNewFile.ts │ │ │ └── convertParamsToDestructuredObject.ts │ │ └── index.ts │ ├── index.ts │ ├── diagnostics.ts │ ├── path.ts │ └── flags.ts ├── nyc.config.js ├── .gitignore ├── .npmignore ├── tsconfig.json ├── COPYING └── LICENSE ├── typescript-plugin-extract-interface-client-project1 ├── src │ ├── model │ │ ├── base │ │ │ ├── Thing.ts │ │ │ └── impl │ │ │ │ └── ThingImpl.ts │ │ └── units │ │ │ ├── AttackerUnit.ts │ │ │ ├── Unit.ts │ │ │ ├── UnitImpl.ts │ │ │ └── impl │ │ │ ├── Archer.ts │ │ │ ├── Knight.ts │ │ │ └── Warrior.ts │ ├── tests │ │ ├── test2323.ts │ │ ├── test2323.js │ │ ├── test3.ts │ │ ├── stringconcattest1.ts │ │ ├── letPostfixTest1.ts │ │ ├── declareClass.ts │ │ ├── declareMember.ts │ │ ├── constToVar.ts │ │ └── test4.ts │ ├── alone │ │ ├── declareConstructorAloneText.ts │ │ ├── arrowFunctionBodyTransformations.ts │ │ ├── declareClassesAndInterfaces.ts │ │ ├── toNamedParameters.ts │ │ ├── declareReturnValueAloneText.ts │ │ ├── variableRelatedFixesAloneText.ts │ │ ├── reorderParamAlone.ts │ │ └── declareMissingMember.ts │ └── evaltests │ │ └── 01-eval-comment-help.ts └── .vscode │ ├── settings.json │ └── launch.json ├── sample-ts-plugin1 ├── doc-assets │ └── plugin-screencast.gif ├── tsconfig.json ├── package.json └── LICENSE ├── typescript-plugin-subclasses-of ├── .gitignore ├── .npmignore ├── doc-assets │ └── screencast.gif ├── tsconfig.json ├── package.json └── LICENSE ├── typescript-plugins-text-based-user-interaction ├── .gitignore ├── .npmignore ├── spec │ └── support │ │ └── jasmine.json ├── tsconfig.json ├── package.json └── LICENSE ├── .travis.yml ├── typescript-plugin-function-signature-refactors ├── .npmignore ├── doc-assets │ └── reorderParamsVsCode.gif ├── .gitignore ├── spec │ └── support │ │ ├── jasmine.json │ │ └── jasmine-js.json ├── tsconfig.json ├── .vscode │ ├── tasks.json │ └── launch.json └── LICENSE ├── yamat.json ├── .vscode └── settings.json ├── discontinued.md └── LICENSE /typescript-ast-util/spec/testUtil.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /plugin-scratch-1/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist -------------------------------------------------------------------------------- /typescript-ast-util/tests/buildAstAndPrintCode.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /plugin-scratch-1/test-project/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist -------------------------------------------------------------------------------- /input-ui-ipc-provider/src/declarations.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'axon' -------------------------------------------------------------------------------- /ts-run/.babelrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015", "react"] 3 | } -------------------------------------------------------------------------------- /typescript-plugin-test-helper/assets/sampleProject1/src/index.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /typescript-plugin-move-file/declarations.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'pretty-ms'; -------------------------------------------------------------------------------- /plain-typescript-test-project/src/other/file2.ts: -------------------------------------------------------------------------------- 1 | export class AA { 2 | } 3 | -------------------------------------------------------------------------------- /plain-typescript-test-project/README.md: -------------------------------------------------------------------------------- 1 | just a sample ts project to test plugins -------------------------------------------------------------------------------- /plugin-scratch-1/test-project/src/index.ts: -------------------------------------------------------------------------------- 1 | const a: any = f() 2 | 3 | new Array() -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-deps.json 3 | *.log 4 | doc-assets 5 | tmp 6 | spec -------------------------------------------------------------------------------- /plugin-scratch-1/README.md: -------------------------------------------------------------------------------- 1 | simple ts plugin with latest typescript and without libraries -------------------------------------------------------------------------------- /typescript-plugin-ast-inspector/src/typings.ts: -------------------------------------------------------------------------------- 1 | export {EvalContext} from './evalCode' -------------------------------------------------------------------------------- /typescript-plugin-move-file/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | *.log 4 | tmp 5 | *.tgz -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | *.log 4 | tmp 5 | .yamat 6 | *.tgz 7 | evaluated_* 8 | .idea -------------------------------------------------------------------------------- /plugin-scratch-1/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "typescript.tsdk": "node_modules/typescript/lib" 3 | } -------------------------------------------------------------------------------- /ts-run/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | /common/temp/** 3 | dist 4 | *.log 5 | tmp 6 | docs 7 | .cache 8 | -------------------------------------------------------------------------------- /typescript-plugin-move-declaration/assets/sampleProject1/src/model/Alive.ts: -------------------------------------------------------------------------------- 1 | export interface Alive{} -------------------------------------------------------------------------------- /typescript-plugin-move-declaration/assets/sampleProject1/src/model/Eatable.ts: -------------------------------------------------------------------------------- 1 | export interface Eatable{} -------------------------------------------------------------------------------- /ts-run/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './types' 2 | export { run } from './run' 3 | export * from './file' 4 | -------------------------------------------------------------------------------- /typescript-plugin-add-type/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-deps.json 3 | *.log 4 | doc-assets 5 | tmp -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/src/typings.ts: -------------------------------------------------------------------------------- 1 | export * from './codeFixes' 2 | export * from './util' -------------------------------------------------------------------------------- /input-ui-ipc-provider-vscode/.gitignore: -------------------------------------------------------------------------------- 1 | out 2 | node_modules 3 | .vscode-test/ 4 | *.vsix 5 | package-lock.json -------------------------------------------------------------------------------- /plugin-scratch-1/test-project/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "typescript.tsdk": "node_modules/typescript/lib" 3 | } -------------------------------------------------------------------------------- /typescript-plugin-extract-interface/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-deps.json 3 | *.log 4 | doc-assets 5 | tmp -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/assets/sampleProject1/src/constToVar.ts: -------------------------------------------------------------------------------- 1 | const a = 1 2 | 3 | a = 2 4 | -------------------------------------------------------------------------------- /vscode-typescript-refactors/.gitignore: -------------------------------------------------------------------------------- 1 | out 2 | node_modules 3 | .vscode-test/ 4 | *.vsix 5 | package-lock.json -------------------------------------------------------------------------------- /sample-ts-plugin1-sample-project/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "typescript.tsdk": "node_modules/typescript/lib" 3 | } -------------------------------------------------------------------------------- /typescript-plugin-test-helper/assets/sampleProject1/src/model/abstract/machine.ts: -------------------------------------------------------------------------------- 1 | export class Machine{ 2 | 3 | } -------------------------------------------------------------------------------- /typescript-plugin-method-delegate/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-deps.json 3 | *.log 4 | doc-assets 5 | tmp 6 | spec -------------------------------------------------------------------------------- /typescript-plugin-move-declaration/assets/sampleProject1/src/model/fruit.ts: -------------------------------------------------------------------------------- 1 | export class Fruit{ 2 | color: string 3 | } -------------------------------------------------------------------------------- /input-ui-ipc-provider-test-vscode-extension/.gitignore: -------------------------------------------------------------------------------- 1 | out 2 | node_modules 3 | .vscode-test/ 4 | *.vsix 5 | package-lock.json -------------------------------------------------------------------------------- /plain-typescript-test-project/src/other/file.ts: -------------------------------------------------------------------------------- 1 | import { AA } from './file2'; 2 | 3 | export class CC extends AA{ 4 | } 5 | -------------------------------------------------------------------------------- /ts-run/spec/support/jasmine.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec_dir": "/spec", 3 | "spec_files": [ 4 | "**/*[sS]pec.ts" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/assets/sampleProject1/src/second.ts: -------------------------------------------------------------------------------- 1 | export class C extends B{ 2 | name: string 3 | } -------------------------------------------------------------------------------- /input-ui-ipc-provider-vscode/.gitattributes: -------------------------------------------------------------------------------- 1 | # Set default behavior to automatically normalize line endings. 2 | * text=auto 3 | 4 | -------------------------------------------------------------------------------- /typescript-plugin-move-declaration/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-deps.json 3 | *.log 4 | doc-assets 5 | tmp 6 | spec 7 | assets -------------------------------------------------------------------------------- /vscode-typescript-refactors/.gitattributes: -------------------------------------------------------------------------------- 1 | # Set default behavior to automatically normalize line endings. 2 | * text=auto 3 | 4 | -------------------------------------------------------------------------------- /ts-run/spec/researchSpec.ts: -------------------------------------------------------------------------------- 1 | describe('researchSpec', () => { 2 | it('research', () => { 3 | expect(1).toBe(1) 4 | }) 5 | }) 6 | -------------------------------------------------------------------------------- /typescript-plugin-ast-inspector/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-deps.json 3 | *.log 4 | doc-assets 5 | tmp 6 | src 7 | doc 8 | dist/doc -------------------------------------------------------------------------------- /typescript-plugin-postfix/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-deps.json 3 | *.log 4 | doc-assets 5 | tmp 6 | spec 7 | assets 8 | src 9 | .vscode -------------------------------------------------------------------------------- /typescript-plugin-util/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./pluginInstaller" 2 | export * from "./tsMorphProjectManager" 3 | export * from "./codeFix" -------------------------------------------------------------------------------- /input-ui-ipc-provider-test-vscode-extension/.gitattributes: -------------------------------------------------------------------------------- 1 | # Set default behavior to automatically normalize line endings. 2 | * text=auto 3 | 4 | -------------------------------------------------------------------------------- /typescript-plugin-test-helper/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-deps.json 3 | *.log 4 | doc-assets 5 | tmp 6 | spec 7 | assets 8 | src 9 | .vscode -------------------------------------------------------------------------------- /typescript-plugin-util/spec/testSpec.ts: -------------------------------------------------------------------------------- 1 | 2 | import * as ts from 'typescript' 3 | describe(' ', () => { 4 | it('s', ()=>{ 5 | }) 6 | }) 7 | -------------------------------------------------------------------------------- /input-ui-ipc-provider/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './types' 2 | export * from './consumer' 3 | export * from './provider' 4 | export * from './consumerInstance' -------------------------------------------------------------------------------- /ts-run/api/modules/_index_.md: -------------------------------------------------------------------------------- 1 | [ts-run](../README.md) > ["index"](../modules/_index_.md) 2 | 3 | # External module: "index" 4 | 5 | ## Index 6 | 7 | --- 8 | 9 | -------------------------------------------------------------------------------- /typescript-ast-util/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-deps.json 3 | *.log 4 | doc-assets 5 | tmp 6 | spec 7 | src 8 | dist/spec 9 | dist/tests 10 | tests -------------------------------------------------------------------------------- /typescript-node-ids/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-deps.json 3 | *.log 4 | doc-assets 5 | tmp 6 | spec 7 | src 8 | dist/spec 9 | dist/tests 10 | tests -------------------------------------------------------------------------------- /typescript-plugin-all-ts-fixes-and-refactors/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-deps.json 3 | *.log 4 | doc-assets 5 | tmp 6 | spec 7 | assets 8 | src 9 | .vscode -------------------------------------------------------------------------------- /typescript-plugin-move-declaration/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore NPM package folders 2 | node_modules 3 | 4 | dist 5 | *.log 6 | tmp 7 | *_copy 8 | # assets/sampleProject1_* -------------------------------------------------------------------------------- /docs/sample-ts-plugin1/plugin-screencast.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-plugins-of-mine/HEAD/docs/sample-ts-plugin1/plugin-screencast.gif -------------------------------------------------------------------------------- /input-ui-ipc-provider-test-typescript-plugin/README.md: -------------------------------------------------------------------------------- 1 | input-ui-ipc-provider-test-typescript-plugin 2 | 3 | 4 | testing in vscode all interactions of ui-ipc-provider -------------------------------------------------------------------------------- /ts-simple-ast-extra/spec/assets/projectSample1/src/model/base/Thing.ts: -------------------------------------------------------------------------------- 1 | export interface Thing { 2 | name: string 3 | description: string 4 | id: string 5 | } 6 | -------------------------------------------------------------------------------- /typescript-ast-util/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore NPM package folders 2 | node_modules 3 | 4 | # Ignore Rush temporary files 5 | /common/temp/** 6 | 7 | dist 8 | *.log 9 | tmp -------------------------------------------------------------------------------- /typescript-node-ids/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore NPM package folders 2 | node_modules 3 | 4 | # Ignore Rush temporary files 5 | /common/temp/** 6 | 7 | dist 8 | *.log 9 | tmp -------------------------------------------------------------------------------- /typescript-plugin-extract-interface-client-project1/src/model/base/Thing.ts: -------------------------------------------------------------------------------- 1 | export interface Thing{ 2 | name:string 3 | description:string 4 | id: string 5 | } -------------------------------------------------------------------------------- /typescript-plugin-extract-interface-client-project1/src/tests/test2323.ts: -------------------------------------------------------------------------------- 1 | // class asd{ 2 | // foo= 123 3 | // } 4 | 5 | // ooo.foo=123 6 | 7 | // new asd().foo=123 -------------------------------------------------------------------------------- /docs/ts-simple-ast-extra/assets/images/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-plugins-of-mine/HEAD/docs/ts-simple-ast-extra/assets/images/icons.png -------------------------------------------------------------------------------- /docs/typescript-ast-util/assets/images/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-plugins-of-mine/HEAD/docs/typescript-ast-util/assets/images/icons.png -------------------------------------------------------------------------------- /ts-simple-ast-extra/src/astPath/index.ts: -------------------------------------------------------------------------------- 1 | export * from './buildSelector' 2 | export * from './printAstPath' 3 | export * from './selectNode' 4 | export * from './types' 5 | -------------------------------------------------------------------------------- /typescript-plugin-add-type/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore NPM package folders 2 | node_modules 3 | 4 | # Ignore Rush temporary files 5 | /common/temp/** 6 | 7 | dist 8 | *.log 9 | tmp -------------------------------------------------------------------------------- /typescript-plugin-add-type/doc-assets/vscode.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-plugins-of-mine/HEAD/typescript-plugin-add-type/doc-assets/vscode.gif -------------------------------------------------------------------------------- /typescript-plugin-move-declaration/assets/sampleProject2/src/model/base/Thing.ts: -------------------------------------------------------------------------------- 1 | export interface Thing{ 2 | name:string 3 | description:string 4 | id: string 5 | } -------------------------------------------------------------------------------- /typescript-plugin-util/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore NPM package folders 2 | node_modules 3 | 4 | # Ignore Rush temporary files 5 | /common/temp/** 6 | 7 | dist 8 | *.log 9 | tmp -------------------------------------------------------------------------------- /docs/sample-ts-plugin1/public/fonts/aller-bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-plugins-of-mine/HEAD/docs/sample-ts-plugin1/public/fonts/aller-bold.eot -------------------------------------------------------------------------------- /docs/sample-ts-plugin1/public/fonts/aller-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-plugins-of-mine/HEAD/docs/sample-ts-plugin1/public/fonts/aller-bold.ttf -------------------------------------------------------------------------------- /docs/sample-ts-plugin1/public/fonts/aller-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-plugins-of-mine/HEAD/docs/sample-ts-plugin1/public/fonts/aller-bold.woff -------------------------------------------------------------------------------- /docs/sample-ts-plugin1/public/fonts/aller-light.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-plugins-of-mine/HEAD/docs/sample-ts-plugin1/public/fonts/aller-light.eot -------------------------------------------------------------------------------- /docs/sample-ts-plugin1/public/fonts/aller-light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-plugins-of-mine/HEAD/docs/sample-ts-plugin1/public/fonts/aller-light.ttf -------------------------------------------------------------------------------- /docs/ts-simple-ast-extra/assets/images/icons@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-plugins-of-mine/HEAD/docs/ts-simple-ast-extra/assets/images/icons@2x.png -------------------------------------------------------------------------------- /docs/ts-simple-ast-extra/assets/images/widgets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-plugins-of-mine/HEAD/docs/ts-simple-ast-extra/assets/images/widgets.png -------------------------------------------------------------------------------- /docs/typescript-ast-util/assets/images/icons@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-plugins-of-mine/HEAD/docs/typescript-ast-util/assets/images/icons@2x.png -------------------------------------------------------------------------------- /docs/typescript-ast-util/assets/images/widgets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-plugins-of-mine/HEAD/docs/typescript-ast-util/assets/images/widgets.png -------------------------------------------------------------------------------- /input-ui-ipc-provider/spec/providerSpec.ts: -------------------------------------------------------------------------------- 1 | 2 | describe('input-ui-ipc-provider', () => { 3 | 4 | it('basic', async () => { 5 | expect(1).toBe(1) 6 | }) 7 | }) 8 | 9 | -------------------------------------------------------------------------------- /sample-ts-plugin1/doc-assets/plugin-screencast.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-plugins-of-mine/HEAD/sample-ts-plugin1/doc-assets/plugin-screencast.gif -------------------------------------------------------------------------------- /typescript-plugin-ast-inspector/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore NPM package folders 2 | node_modules 3 | 4 | # Ignore Rush temporary files 5 | /common/temp/** 6 | 7 | dist 8 | *.log 9 | tmp -------------------------------------------------------------------------------- /typescript-plugin-subclasses-of/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore NPM package folders 2 | node_modules 3 | 4 | # Ignore Rush temporary files 5 | /common/temp/** 6 | 7 | dist 8 | *.log 9 | tmp -------------------------------------------------------------------------------- /docs/sample-ts-plugin1/public/fonts/aller-light.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-plugins-of-mine/HEAD/docs/sample-ts-plugin1/public/fonts/aller-light.woff -------------------------------------------------------------------------------- /docs/sample-ts-plugin1/public/fonts/roboto-black.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-plugins-of-mine/HEAD/docs/sample-ts-plugin1/public/fonts/roboto-black.eot -------------------------------------------------------------------------------- /docs/sample-ts-plugin1/public/fonts/roboto-black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-plugins-of-mine/HEAD/docs/sample-ts-plugin1/public/fonts/roboto-black.ttf -------------------------------------------------------------------------------- /docs/sample-ts-plugin1/public/fonts/roboto-black.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-plugins-of-mine/HEAD/docs/sample-ts-plugin1/public/fonts/roboto-black.woff -------------------------------------------------------------------------------- /docs/ts-simple-ast-extra/assets/images/widgets@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-plugins-of-mine/HEAD/docs/ts-simple-ast-extra/assets/images/widgets@2x.png -------------------------------------------------------------------------------- /docs/typescript-ast-util/assets/images/widgets@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-plugins-of-mine/HEAD/docs/typescript-ast-util/assets/images/widgets@2x.png -------------------------------------------------------------------------------- /ts-run/src/misc.ts: -------------------------------------------------------------------------------- 1 | let mist 2 | //TODO: to misc 3 | export function dirname(s: string) { 4 | const i = s.lastIndexOf('/') 5 | return i === -1 ? '.' : s.substring(0, i) 6 | } 7 | -------------------------------------------------------------------------------- /typescript-plugin-extract-interface/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore NPM package folders 2 | node_modules 3 | 4 | # Ignore Rush temporary files 5 | /common/temp/** 6 | 7 | dist 8 | *.log 9 | tmp -------------------------------------------------------------------------------- /typescript-plugin-move-declaration/assets/sampleProject1/src/model/seeds.ts: -------------------------------------------------------------------------------- 1 | import { Alive } from "./Alive"; 2 | 3 | export class Seed implements Alive { 4 | energy: number 5 | } -------------------------------------------------------------------------------- /typescript-plugin-test-helper/assets/sampleProject1/src/model/abstract/computer.ts: -------------------------------------------------------------------------------- 1 | import { Machine } from "./machine"; 2 | 3 | export class Computer extends Machine{ 4 | 5 | } -------------------------------------------------------------------------------- /ts-simple-ast-extra/nyc.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "extends": "@istanbuljs/nyc-config-typescript", 3 | "reporter": [ 4 | "html", 'lcov', 'text-summary' 5 | ], 6 | } -------------------------------------------------------------------------------- /typescript-plugin-ast-inspector/doc-assets/print-ast.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-plugins-of-mine/HEAD/typescript-plugin-ast-inspector/doc-assets/print-ast.gif -------------------------------------------------------------------------------- /typescript-plugin-method-delegate/doc-assets/vscode.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-plugins-of-mine/HEAD/typescript-plugin-method-delegate/doc-assets/vscode.gif -------------------------------------------------------------------------------- /typescript-plugin-subclasses-of/.npmignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | *.log 3 | /doc-assets 4 | /tmp 5 | /spec 6 | /src 7 | /.gitignore 8 | /.npmignore 9 | /dist/spec 10 | /tsconfig.json -------------------------------------------------------------------------------- /typescript-plugin-move-file/doc-assets/atom-move-file.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-plugins-of-mine/HEAD/typescript-plugin-move-file/doc-assets/atom-move-file.gif -------------------------------------------------------------------------------- /typescript-plugin-subclasses-of/doc-assets/screencast.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-plugins-of-mine/HEAD/typescript-plugin-subclasses-of/doc-assets/screencast.gif -------------------------------------------------------------------------------- /typescript-plugin-test-helper/assets/sampleProject1/src/model/concretes/dell123.ts: -------------------------------------------------------------------------------- 1 | import { Computer } from "../abstract/computer"; 2 | 3 | export class Dell123 extends Computer { 4 | 5 | } -------------------------------------------------------------------------------- /typescript-plugins-text-based-user-interaction/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore NPM package folders 2 | node_modules 3 | 4 | # Ignore Rush temporary files 5 | /common/temp/** 6 | 7 | dist 8 | *.log 9 | tmp -------------------------------------------------------------------------------- /input-ui-ipc-provider-vscode/.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | .vscode-test/** 3 | out/test/** 4 | out/**/*.map 5 | src/** 6 | .gitignore 7 | tsconfig.json 8 | vsc-extension-quickstart.md 9 | tslint.json -------------------------------------------------------------------------------- /input-ui-ipc-provider/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-deps.json 3 | *.log 4 | doc-assets 5 | tmp 6 | spec 7 | assets 8 | src 9 | .vscode 10 | dist/spec 11 | /coverage 12 | /.nyc_output -------------------------------------------------------------------------------- /typescript-plugin-ast-inspector/doc-assets/evalCodeVsCode.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-plugins-of-mine/HEAD/typescript-plugin-ast-inspector/doc-assets/evalCodeVsCode.gif -------------------------------------------------------------------------------- /typescript-plugin-extract-interface-client-project1/src/alone/declareConstructorAloneText.ts: -------------------------------------------------------------------------------- 1 | // class Gamma { 2 | // private() { } 3 | // } 4 | // const gamma = new Gamma('hello', 1, new Date()) -------------------------------------------------------------------------------- /typescript-plugin-move-file/doc-assets/vs-code-move-file.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-plugins-of-mine/HEAD/typescript-plugin-move-file/doc-assets/vs-code-move-file.gif -------------------------------------------------------------------------------- /typescript-plugin-test-helper/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore NPM package folders 2 | node_modules 3 | 4 | # Ignore Rush temporary files 5 | /common/temp/** 6 | 7 | dist 8 | *.log 9 | tmp 10 | *_copy -------------------------------------------------------------------------------- /vscode-typescript-refactors/.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | .vscode-test/** 3 | out/test/** 4 | out/**/*.map 5 | src/** 6 | .gitignore 7 | tsconfig.json 8 | vsc-extension-quickstart.md 9 | tslint.json -------------------------------------------------------------------------------- /typescript-plugin-method-delegate/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore NPM package folders 2 | node_modules 3 | 4 | # Ignore Rush temporary files 5 | /common/temp/** 6 | 7 | dist 8 | *.log 9 | tmp 10 | *_copy -------------------------------------------------------------------------------- /ts-simple-ast-extra/spec/assets/projectSample1/src/model/units/AttackerUnit.ts: -------------------------------------------------------------------------------- 1 | import { Unit } from './Unit' 2 | 3 | export interface AttackerUnit extends Unit { 4 | attack(target: Unit): void 5 | } 6 | -------------------------------------------------------------------------------- /typescript-ast-util/spec/support/jasmine.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec_dir": "/spec", 3 | "spec_files": [ 4 | "**/*[sS]pec.ts" 5 | ], 6 | "stopSpecOnExpectationFailure": false, 7 | "random": true 8 | } 9 | -------------------------------------------------------------------------------- /typescript-plugin-ast-inspector/doc-assets/print-parent-nodes.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-plugins-of-mine/HEAD/typescript-plugin-ast-inspector/doc-assets/print-parent-nodes.gif -------------------------------------------------------------------------------- /typescript-plugin-extract-interface-client-project1/src/model/units/AttackerUnit.ts: -------------------------------------------------------------------------------- 1 | import { Unit } from "./Unit"; 2 | 3 | export interface AttackerUnit extends Unit { 4 | attack(target: Unit): void 5 | } -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/assets/sampleProject1/src/third.ts: -------------------------------------------------------------------------------- 1 | class C extends NonExistent implements NonExistentInterface, ExistentInterface{ 2 | 3 | } 4 | 5 | class ExistentInterface{ 6 | 7 | } -------------------------------------------------------------------------------- /input-ui-ipc-provider-test-vscode-extension/.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | .vscode-test/** 3 | out/test/** 4 | out/**/*.map 5 | src/** 6 | .gitignore 7 | tsconfig.json 8 | vsc-extension-quickstart.md 9 | tslint.json -------------------------------------------------------------------------------- /typescript-ast-util/spec/support/jasmine-js.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec_dir": "dist/spec", 3 | "spec_files": [ 4 | "**/*[sS]pec.js" 5 | ], 6 | "stopSpecOnExpectationFailure": false, 7 | "random": true 8 | } 9 | -------------------------------------------------------------------------------- /typescript-plugin-extract-interface/doc-assets/extract-interface.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-plugins-of-mine/HEAD/typescript-plugin-extract-interface/doc-assets/extract-interface.gif -------------------------------------------------------------------------------- /typescript-plugin-move-declaration/assets/sampleProject1/src/index.ts: -------------------------------------------------------------------------------- 1 | import { createSomeFruits } from "./tools"; 2 | 3 | const msg = createSomeFruits().apples.map(a=>a.color).join(', ') 4 | console.log(msg); 5 | -------------------------------------------------------------------------------- /typescript-plugin-move-declaration/assets/sampleProject2/src/model/units/AttackerUnit.ts: -------------------------------------------------------------------------------- 1 | import { Unit } from "./Unit"; 2 | 3 | export interface AttackerUnit extends Unit { 4 | attack(target: Unit): void 5 | } -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-deps.json 3 | *.log 4 | doc-assets 5 | tmp 6 | spec 7 | assets 8 | src 9 | .vscode 10 | dist/spec 11 | /coverage 12 | /.nyc_output -------------------------------------------------------------------------------- /typescript-plugin-util/.npmignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | *.log 3 | /doc-assets 4 | /tmp 5 | /spec 6 | /src 7 | /.gitignore 8 | /.npmignore 9 | /dist/spec 10 | /tsconfig.json 11 | /declarations.d.ts 12 | *.tgz -------------------------------------------------------------------------------- /typescript-plugin-util/spec/support/jasmine.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec_dir": "/spec", 3 | "spec_files": [ 4 | "**/*[sS]pec.ts" 5 | ], 6 | "stopSpecOnExpectationFailure": false, 7 | "random": true 8 | } 9 | -------------------------------------------------------------------------------- /typescript-plugin-move-declaration/doc-assets/vscode-move-interface.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-plugins-of-mine/HEAD/typescript-plugin-move-declaration/doc-assets/vscode-move-interface.gif -------------------------------------------------------------------------------- /typescript-plugin-move-file/.npmignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | *.log 3 | /doc-assets 4 | /tmp 5 | /spec 6 | /src 7 | /.gitignore 8 | /.npmignore 9 | /dist/spec 10 | /tsconfig.json 11 | /declarations.d.ts 12 | *.tgz -------------------------------------------------------------------------------- /typescript-plugin-postfix/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore NPM package folders 2 | node_modules 3 | 4 | # Ignore Rush temporary files 5 | /common/temp/** 6 | 7 | dist 8 | *.log 9 | tmp 10 | *_copy 11 | assets 12 | spec -------------------------------------------------------------------------------- /typescript-plugin-test-helper/spec/support/jasmine.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec_dir": "/spec", 3 | "spec_files": [ 4 | "**/*[sS]pec.ts" 5 | ], 6 | "stopSpecOnExpectationFailure": false, 7 | "random": false 8 | } 9 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "11" 4 | install: cd ts-simple-ast-extra; npm i; 5 | script: npm run coverage 6 | after_script: cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js 7 | -------------------------------------------------------------------------------- /input-ui-ipc-provider-test-typescript-plugin/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-deps.json 3 | *.log 4 | doc-assets 5 | tmp 6 | spec 7 | assets 8 | src 9 | .vscode 10 | dist/spec 11 | /coverage 12 | /.nyc_output -------------------------------------------------------------------------------- /input-ui-ipc-provider/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore NPM package folders 2 | node_modules 3 | 4 | # Ignore Rush temporary files 5 | /common/temp/** 6 | 7 | dist 8 | *.log 9 | tmp 10 | *_copy 11 | /coverage 12 | /.nyc_output -------------------------------------------------------------------------------- /ts-simple-ast-extra/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore NPM package folders 2 | node_modules 3 | 4 | # Ignore Rush temporary files 5 | /common/temp/** 6 | 7 | dist 8 | *.log 9 | tmp* 10 | .nyc_output 11 | /coverage 12 | .vscode -------------------------------------------------------------------------------- /typescript-plugin-function-signature-refactors/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-deps.json 3 | *.log 4 | doc-assets 5 | tmp 6 | spec 7 | assets 8 | src 9 | .vscode 10 | dist/spec 11 | /coverage 12 | /.nyc_output -------------------------------------------------------------------------------- /typescript-plugin-test-helper/spec/support/jasmine-js.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec_dir": "dist/spec", 3 | "spec_files": [ 4 | "**/*[sS]pec.js" 5 | ], 6 | "stopSpecOnExpectationFailure": false, 7 | "random": true 8 | } 9 | -------------------------------------------------------------------------------- /typescript-plugin-all-ts-fixes-and-refactors/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore NPM package folders 2 | node_modules 3 | 4 | # Ignore Rush temporary files 5 | /common/temp/** 6 | 7 | dist 8 | *.log 9 | tmp 10 | *_copy 11 | assets -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/doc-assets/declareReturnTypeAtom.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-plugins-of-mine/HEAD/typescript-plugin-proactive-code-fixes/doc-assets/declareReturnTypeAtom.gif -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/doc-assets/extractInterfaceVsCode.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-plugins-of-mine/HEAD/typescript-plugin-proactive-code-fixes/doc-assets/extractInterfaceVsCode.gif -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/doc-assets/template2LiteralVsCode.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-plugins-of-mine/HEAD/typescript-plugin-proactive-code-fixes/doc-assets/template2LiteralVsCode.gif -------------------------------------------------------------------------------- /yamat.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "typescript-ast-util", 4 | "path": "typescript-ast-util" 5 | }, 6 | { 7 | "name": "ts-simple-ast-extra", 8 | "path": "ts-simple-ast-extra" 9 | } 10 | 11 | ] 12 | -------------------------------------------------------------------------------- /typescript-plugin-all-ts-fixes-and-refactors/spec/support/jasmine.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec_dir": "/spec", 3 | "spec_files": [ 4 | "**/*[sS]pec.ts" 5 | ], 6 | "stopSpecOnExpectationFailure": false, 7 | "random": true 8 | } 9 | -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/doc-assets/convertToNamedParamsAtom.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-plugins-of-mine/HEAD/typescript-plugin-proactive-code-fixes/doc-assets/convertToNamedParamsAtom.gif -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/doc-assets/declareConstructorVsCode.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-plugins-of-mine/HEAD/typescript-plugin-proactive-code-fixes/doc-assets/declareConstructorVsCode.gif -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/doc-assets/declareReturnTypeVsCode.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-plugins-of-mine/HEAD/typescript-plugin-proactive-code-fixes/doc-assets/declareReturnTypeVsCode.gif -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/doc-assets/delegateMethodVisualCode.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-plugins-of-mine/HEAD/typescript-plugin-proactive-code-fixes/doc-assets/delegateMethodVisualCode.gif -------------------------------------------------------------------------------- /vscode-typescript-refactors/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // See http://go.microsoft.com/fwlink/?LinkId=827846 3 | // for the documentation about the extensions.json format 4 | "recommendations": [ 5 | "eg2.tslint" 6 | ] 7 | } -------------------------------------------------------------------------------- /typescript-plugin-all-ts-fixes-and-refactors/spec/support/jasmine-js.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec_dir": "dist/spec", 3 | "spec_files": [ 4 | "**/*[sS]pec.js" 5 | ], 6 | "stopSpecOnExpectationFailure": false, 7 | "random": true 8 | } 9 | -------------------------------------------------------------------------------- /typescript-plugin-function-signature-refactors/doc-assets/reorderParamsVsCode.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-plugins-of-mine/HEAD/typescript-plugin-function-signature-refactors/doc-assets/reorderParamsVsCode.gif -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/doc-assets/variableRelatedFixesVsCode.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-plugins-of-mine/HEAD/typescript-plugin-proactive-code-fixes/doc-assets/variableRelatedFixesVsCode.gif -------------------------------------------------------------------------------- /ts-simple-ast-extra/spec/assets/projectSample1/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "lib": ["esnext"], 4 | "strict": true, 5 | "skipLibCheck": true 6 | }, 7 | "include": ["src"], 8 | "exclude": ["src_bkp"] 9 | } -------------------------------------------------------------------------------- /ts-simple-ast-extra/spec/support/jasmine.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec_dir": "/spec", 3 | "spec_files": [ 4 | "**/*[sS]pec.ts" 5 | ], 6 | "stopSpecOnExpectationFailure": true, 7 | "failFast": true, 8 | "random": true 9 | } 10 | -------------------------------------------------------------------------------- /typescript-plugin-extract-interface-client-project1/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "typescript.tsdk": "node_modules/typescript/lib", 3 | 4 | "typescript.tsserver.log": "normal", 5 | "cSpell.words": [ 6 | "hoilallalalalal" 7 | ] 8 | } -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore NPM package folders 2 | node_modules 3 | 4 | # Ignore Rush temporary files 5 | /common/temp/** 6 | 7 | dist 8 | *.log 9 | tmp 10 | *_copy 11 | /coverage 12 | /.nyc_output -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | // Preferred quote style to use for quick fixes: 'single' quotes, 'double' quotes, or 'auto' infer quote type from existing imports. Requires TypeScript >= 2.9 3 | "typescript.preferences.quoteStyle": "single", 4 | } -------------------------------------------------------------------------------- /input-ui-ipc-provider-test-typescript-plugin/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore NPM package folders 2 | node_modules 3 | 4 | # Ignore Rush temporary files 5 | /common/temp/** 6 | 7 | dist 8 | *.log 9 | tmp 10 | *_copy 11 | /coverage 12 | /.nyc_output -------------------------------------------------------------------------------- /input-ui-ipc-provider-test-vscode-extension/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // See http://go.microsoft.com/fwlink/?LinkId=827846 3 | // for the documentation about the extensions.json format 4 | "recommendations": [ 5 | "eg2.tslint" 6 | ] 7 | } -------------------------------------------------------------------------------- /plain-typescript-test-project/src/index.ts: -------------------------------------------------------------------------------- 1 | var a: number = 1; 2 | var b: number = 2; 3 | var c: () => number = () => 1; 4 | let d = 1 5 | 6 | d /* ERROR parsing input json text SyntaxError: Unexpected token u in JSON at position 0 */= 2 7 | 8 | -------------------------------------------------------------------------------- /typescript-plugin-function-signature-refactors/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore NPM package folders 2 | node_modules 3 | 4 | # Ignore Rush temporary files 5 | /common/temp/** 6 | 7 | dist 8 | *.log 9 | tmp 10 | *_copy 11 | /coverage 12 | /.nyc_output -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/doc-assets/declareClassAndInterfaceVsCode.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-plugins-of-mine/HEAD/typescript-plugin-proactive-code-fixes/doc-assets/declareClassAndInterfaceVsCode.gif -------------------------------------------------------------------------------- /typescript-plugin-extract-interface-client-project1/src/tests/test2323.js: -------------------------------------------------------------------------------- 1 | var asd = /** @class */ (function () { 2 | function asd() { 3 | this.foo = 123; 4 | } 5 | return asd; 6 | }()); 7 | ooo.foo = 123; 8 | new asd().foo = 123; 9 | -------------------------------------------------------------------------------- /typescript-plugins-text-based-user-interaction/.npmignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | *.log 3 | /doc-assets 4 | /tmp 5 | /spec 6 | /src 7 | /.gitignore 8 | /.npmignore 9 | /dist/spec 10 | /tsconfig.json 11 | /declarations.d.ts 12 | *.tgz 13 | old-files -------------------------------------------------------------------------------- /ts-run/.npmignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | *.log 3 | /doc-assets 4 | /tmp 5 | /spec 6 | /src 7 | /.gitignore 8 | /.npmignore 9 | /dist/spec 10 | /tsconfig.json 11 | /declarations.d.ts 12 | *.tgz 13 | .cache 14 | declarations 15 | src/test 16 | dist/test 17 | -------------------------------------------------------------------------------- /typescript-plugin-move-declaration/assets/sampleProject1/src/model/level2/usingApples.ts: -------------------------------------------------------------------------------- 1 | import { Apple } from "../apple"; 2 | import { Seed } from "../seeds"; 3 | 4 | export const a = new Apple() 5 | a.color="red" 6 | a.seeds = [[[new Seed(), new Seed()]]] 7 | -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/doc-assets/arrowFunctionsBodyTransformationsVsCode.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cancerberoSgx/typescript-plugins-of-mine/HEAD/typescript-plugin-proactive-code-fixes/doc-assets/arrowFunctionsBodyTransformationsVsCode.gif -------------------------------------------------------------------------------- /typescript-plugin-move-declaration/assets/sampleProject2/src/model/units/Unit.ts: -------------------------------------------------------------------------------- 1 | import { Thing } from "../base/Thing"; 2 | 3 | export interface Unit extends Thing { 4 | health: number 5 | } 6 | 7 | // &%&% moveDeclarationNamed('Unit', '../base/impl/ThingImpl.ts') -------------------------------------------------------------------------------- /typescript-node-ids/spec/support/jasmine.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec_dir": "spec", 3 | "spec_files": [ 4 | "**/*[sS]pec.ts" 5 | ], 6 | "helpers": [ 7 | "helpers/**/*.ts" 8 | ], 9 | "stopSpecOnExpectationFailure": false, 10 | "random": true 11 | } 12 | -------------------------------------------------------------------------------- /typescript-plugin-move-declaration/assets/sampleProject2/src/model/units/UnitImpl.ts: -------------------------------------------------------------------------------- 1 | import { Unit } from "./Unit"; 2 | import { ThingImpl } from "../base/impl/ThingImpl"; 3 | 4 | export class UnitImpl extends ThingImpl implements Unit { 5 | health: number=0; 6 | } 7 | -------------------------------------------------------------------------------- /input-ui-ipc-provider-test-typescript-plugin/spec/indexSpec.ts: -------------------------------------------------------------------------------- 1 | 2 | describe('try to change signature param type', () => { 3 | 4 | 5 | it('method declarations and signatures', () => { 6 | expect(true).toBe(true) 7 | 8 | }) 9 | 10 | 11 | }) 12 | 13 | -------------------------------------------------------------------------------- /input-ui-ipc-provider/spec/support/jasmine.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec_dir": "spec", 3 | "spec_files": [ 4 | "**/*[sS]pec.ts" 5 | ], 6 | "helpers": [ 7 | "helpers/**/*.ts" 8 | ], 9 | "stopSpecOnExpectationFailure": false, 10 | "random": false 11 | } 12 | -------------------------------------------------------------------------------- /input-ui-ipc-provider/spec/support/jasmine-js.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec_dir": "dist/spec", 3 | "spec_files": [ 4 | "**/*[sS]pec.js" 5 | ], 6 | "helpers": [ 7 | "helpers/**/*.js" 8 | ], 9 | "stopSpecOnExpectationFailure": true, 10 | "random": false 11 | } 12 | -------------------------------------------------------------------------------- /typescript-ast-util/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './node' 2 | export * from './position' 3 | export * from './types' 4 | export * from './compiler' 5 | export * from './debug' 6 | export * from './sourceFileManipulation' 7 | export * from './misc' 8 | export * from './changes' 9 | -------------------------------------------------------------------------------- /typescript-plugin-extract-interface-client-project1/src/tests/test3.ts: -------------------------------------------------------------------------------- 1 | var a =1 2 | //laksd lkaj sldas 3 | function f(){ 4 | // laksjldkajs 5 | const a = 6 6 | //TODO: something 7 | let i = 2 8 | // Heads up!: 9 | var hh=1 10 | //lksksks 11 | } 12 | //final 13 | -------------------------------------------------------------------------------- /typescript-plugin-method-delegate/spec/support/jasmine.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec_dir": "spec", 3 | "spec_files": [ 4 | "**/*[sS]pec.ts" 5 | ], 6 | "helpers": [ 7 | "helpers/**/*.ts" 8 | ], 9 | "stopSpecOnExpectationFailure": false, 10 | "random": false 11 | } 12 | -------------------------------------------------------------------------------- /typescript-plugin-move-declaration/spec/support/jasmine.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec_dir": "spec", 3 | "spec_files": [ 4 | "**/*[sS]pec.ts" 5 | ], 6 | "helpers": [ 7 | "helpers/**/*.ts" 8 | ], 9 | "stopSpecOnExpectationFailure": true, 10 | "random": false 11 | } 12 | -------------------------------------------------------------------------------- /ts-run/jest.config-spec.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "testEnvironment": "node", 3 | "testRegex": "__tests__/.*\.*Test\.[t]sx?$", 4 | "transform": { 5 | ".(ts|tsx)": "ts-jest" 6 | }, 7 | "moduleFileExtensions": [ 8 | "ts", 9 | "tsx", 10 | "js" 11 | ] 12 | } -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/spec/support/jasmine.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec_dir": "spec", 3 | "spec_files": [ 4 | "**/*[sS]pec.ts" 5 | ], 6 | "helpers": [ 7 | "helpers/**/*.ts" 8 | ], 9 | "stopSpecOnExpectationFailure": false, 10 | "random": false 11 | } 12 | -------------------------------------------------------------------------------- /input-ui-ipc-provider-test-typescript-plugin/spec/support/jasmine.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec_dir": "spec", 3 | "spec_files": [ 4 | "**/*[sS]pec.ts" 5 | ], 6 | "helpers": [ 7 | "helpers/**/*.ts" 8 | ], 9 | "stopSpecOnExpectationFailure": false, 10 | "random": true 11 | } 12 | -------------------------------------------------------------------------------- /typescript-plugin-extract-interface-client-project1/src/alone/arrowFunctionBodyTransformations.ts: -------------------------------------------------------------------------------- 1 | // const o = { 2 | // fn: o1 => 'hello' + o1, 3 | // bodied: a => { return a - 1 + 2 / 6; }, 4 | // zeroArg: () => foo(), 5 | // returningObjectLiteral: (a) => ({ a, b: 'hi' }) 6 | // } 7 | -------------------------------------------------------------------------------- /typescript-plugin-function-signature-refactors/spec/support/jasmine.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec_dir": "spec", 3 | "spec_files": [ 4 | "**/*[sS]pec.ts" 5 | ], 6 | "helpers": [ 7 | "helpers/**/*.ts" 8 | ], 9 | "stopSpecOnExpectationFailure": false, 10 | "random": true 11 | } 12 | -------------------------------------------------------------------------------- /typescript-plugin-move-declaration/spec/support/jasmine-js.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec_dir": "dist/spec", 3 | "spec_files": [ 4 | "**/*[sS]pec.js" 5 | ], 6 | "helpers": [ 7 | "helpers/**/*.js" 8 | ], 9 | "stopSpecOnExpectationFailure": true, 10 | "random": false 11 | } 12 | -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/spec/support/jasmine-js.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec_dir": "dist/spec", 3 | "spec_files": [ 4 | "**/*[sS]pec.js" 5 | ], 6 | "helpers": [ 7 | "helpers/**/*.js" 8 | ], 9 | "stopSpecOnExpectationFailure": true, 10 | "random": false 11 | } 12 | -------------------------------------------------------------------------------- /typescript-plugins-text-based-user-interaction/spec/support/jasmine.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec_dir": "spec", 3 | "spec_files": [ 4 | "**/*[sS]pec.ts" 5 | ], 6 | "helpers": [ 7 | "helpers/**/*.ts" 8 | ], 9 | "stopSpecOnExpectationFailure": false, 10 | "random": true 11 | } 12 | -------------------------------------------------------------------------------- /input-ui-ipc-provider-test-typescript-plugin/spec/support/jasmine-js.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec_dir": "dist/spec", 3 | "spec_files": [ 4 | "**/*[sS]pec.js" 5 | ], 6 | "helpers": [ 7 | "helpers/**/*.js" 8 | ], 9 | "stopSpecOnExpectationFailure": true, 10 | "random": true 11 | } 12 | -------------------------------------------------------------------------------- /sample-ts-plugin1/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2018", 4 | "module": "commonjs", 5 | "lib": ["es2018"], 6 | "outDir": "./dist", 7 | "strict": true, 8 | "strictNullChecks": false, 9 | "esModuleInterop": true 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /typescript-plugin-subclasses-of/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2018", 4 | "module": "commonjs", 5 | "lib": ["es2018"], 6 | "outDir": "./dist", 7 | "rootDir": "./src", 8 | "strict": false, 9 | "esModuleInterop": true 10 | } 11 | } -------------------------------------------------------------------------------- /ts-run/api/modules/_file_.md: -------------------------------------------------------------------------------- 1 | [ts-run](../README.md) > ["file"](../modules/_file_.md) 2 | 3 | # External module: "file" 4 | 5 | ## Index 6 | 7 | ### Classes 8 | 9 | * [ContentFile](../classes/_file_.contentfile.md) 10 | * [RemoteFile](../classes/_file_.remotefile.md) 11 | 12 | --- 13 | 14 | -------------------------------------------------------------------------------- /typescript-plugin-function-signature-refactors/spec/support/jasmine-js.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec_dir": "dist/spec", 3 | "spec_files": [ 4 | "**/*[sS]pec.js" 5 | ], 6 | "helpers": [ 7 | "helpers/**/*.js" 8 | ], 9 | "stopSpecOnExpectationFailure": true, 10 | "random": true 11 | } 12 | -------------------------------------------------------------------------------- /docs/ts-simple-ast-extra/assets/js/search.js: -------------------------------------------------------------------------------- 1 | var typedoc = typedoc || {}; 2 | typedoc.search = typedoc.search || {}; 3 | typedoc.search.data = {"kinds":{"1":"External module"},"rows":[{"id":0,"kind":1,"name":"\"index\"","url":"modules/_index_.html","classes":"tsd-kind-external-module"}]}; -------------------------------------------------------------------------------- /docs/typescript-ast-util/assets/js/search.js: -------------------------------------------------------------------------------- 1 | var typedoc = typedoc || {}; 2 | typedoc.search = typedoc.search || {}; 3 | typedoc.search.data = {"kinds":{"1":"External module"},"rows":[{"id":0,"kind":1,"name":"\"index\"","url":"modules/_index_.html","classes":"tsd-kind-external-module"}]}; -------------------------------------------------------------------------------- /typescript-plugin-test-helper/README.md: -------------------------------------------------------------------------------- 1 | # typescript-plugin-test-helper 2 | helper to test/debug language service plugins 3 | 4 | (without having to use editor / tsserver, etc) 5 | 6 | an utility to easy test ls plugins and debug them. 7 | see example/watch-incremental working incremental language service 8 | 9 | -------------------------------------------------------------------------------- /typescript-ast-util/src/assets/simpletsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2018", 4 | "module": "commonjs", 5 | "lib": ["es2018"], 6 | "outDir": "./dist", 7 | "strict": true, 8 | "esModuleInterop": true, 9 | "removeComments": false 10 | } 11 | } -------------------------------------------------------------------------------- /ts-run/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # 0.0.15 2 | 3 | * extractInterface 4 | * buildAstSelector() selectFromAst() see spec/querySpec.ts 5 | 6 | # 0.0.17 7 | 8 | * prettier 9 | * enhanced selectNode (query) API 10 | 11 | # 0.0.18 12 | 13 | * getDefinitionsOf, getNodeName, objectLiteralInsert, ensureArrayLength, array2DInsert -------------------------------------------------------------------------------- /ts-simple-ast-extra/.npmignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | *.log 3 | /doc-assets 4 | /tmp 5 | /spec 6 | /src 7 | /.gitignore 8 | /.npmignore 9 | /dist/spec 10 | /tsconfig.json 11 | /declarations.d.ts 12 | *.tgz 13 | .nyc_output 14 | /coverage 15 | .vscode 16 | nyc.config.js 17 | formatCodeSettings.json 18 | TODO.md 19 | .vscode 20 | -------------------------------------------------------------------------------- /typescript-plugin-extract-interface-client-project1/src/alone/declareClassesAndInterfaces.ts: -------------------------------------------------------------------------------- 1 | // import { EventEmitter } from "events"; 2 | 3 | 4 | 5 | // class Onion extends NonExistent implements NonExistentInterface, ExistentInterface { } 6 | // interface IOnion extends IFruit, EventEmitter { } 7 | // class ExistentInterface { } 8 | -------------------------------------------------------------------------------- /typescript-plugin-extract-interface-client-project1/src/alone/toNamedParameters.ts: -------------------------------------------------------------------------------- 1 | function utility56(a: T, b: string[], c: (n: T) => boolean[], d?: boolean, 2 | e = 3.14): () => T | boolean { 3 | const expression44 = b.join(', ') + c(a).join(', ') + !!d + e + '' 4 | return () => expression44 === 'cancerberosgx' ? a : true 5 | } 6 | -------------------------------------------------------------------------------- /typescript-plugin-move-declaration/assets/sampleProject2/src/model/units/impl/Archer.ts: -------------------------------------------------------------------------------- 1 | import { AttackerUnit } from "../AttackerUnit"; 2 | import { Unit } from "../Unit"; 3 | import { UnitImpl } from "../UnitImpl"; 4 | 5 | export class Archer extends UnitImpl implements AttackerUnit { 6 | attack(target: Unit) { target.health -= 5 } 7 | } -------------------------------------------------------------------------------- /typescript-plugin-move-declaration/assets/sampleProject2/src/model/units/impl/Knight.ts: -------------------------------------------------------------------------------- 1 | import { AttackerUnit } from "../AttackerUnit"; 2 | import { Unit } from "../Unit"; 3 | import { UnitImpl } from "../UnitImpl"; 4 | 5 | export class Knight extends UnitImpl implements AttackerUnit { 6 | attack(target: Unit) { target.health -= 10 } 7 | } -------------------------------------------------------------------------------- /input-ui-ipc-provider-test-vscode-extension/src/extension.ts: -------------------------------------------------------------------------------- 1 | import * as vscode from 'vscode'; 2 | import { VsCodeInputProvider } from 'input-ui-ipc-provider-vscode'; 3 | 4 | export function activate(context: vscode.ExtensionContext) { 5 | new VsCodeInputProvider({port: 3001, log: console.log}) 6 | } 7 | export function deactivate() { 8 | } -------------------------------------------------------------------------------- /typescript-plugin-move-declaration/assets/sampleProject2/src/model/units/impl/Warrior.ts: -------------------------------------------------------------------------------- 1 | import { AttackerUnit } from "../AttackerUnit"; 2 | import { Unit } from "../Unit"; 3 | import { UnitImpl } from "../UnitImpl"; 4 | 5 | export class Warrior extends UnitImpl implements AttackerUnit { 6 | attack(target: Unit) { target.health -= 2 } 7 | } -------------------------------------------------------------------------------- /typescript-plugin-extract-interface/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2018", 4 | "module": "commonjs", 5 | "lib": ["es2018"], 6 | "outDir": "./dist", 7 | "rootDir": "./src", 8 | "strict": false, 9 | "removeComments": false, 10 | "esModuleInterop": true 11 | } 12 | } -------------------------------------------------------------------------------- /ts-simple-ast-extra/spec/assets/projectSample1/src/model/units/Unit.ts: -------------------------------------------------------------------------------- 1 | import { Thing } from '../base/Thing' 2 | 3 | // &%&% moveDeclarationNamed('Unit', '../base/Thing.ts') 4 | export interface Unit extends Thing { 5 | health: number 6 | move(x: number, y: number, animationMode: 'simple' | 'complex', arriveDateLimit: Date): Promise 7 | } 8 | -------------------------------------------------------------------------------- /typescript-plugin-extract-interface-client-project1/src/model/units/Unit.ts: -------------------------------------------------------------------------------- 1 | import { Thing } from "../base/Thing"; 2 | 3 | // &%&% moveDeclarationNamed('Unit', '../base/Thing.ts') 4 | export interface Unit extends Thing { 5 | health: number 6 | move(x: number, y: number, animationMode: 'simple'|'complex', arriveDateLimit: Date): Promise 7 | } -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/assets/sampleProject1/src/index.ts: -------------------------------------------------------------------------------- 1 | class A{ 2 | 3 | } 4 | 5 | function f(){ 6 | return 1 7 | } 8 | 9 | function main(){ 10 | 11 | i=f() 12 | 13 | // new A('hello') // create constructor : do it later 14 | 15 | const a = new A("12") 16 | // const a1 = new A() 17 | // a1.nonexistenMethod() 18 | } -------------------------------------------------------------------------------- /ts-simple-ast-extra/spec/assets/projectSample1/src/model/base/impl/ThingImpl.ts: -------------------------------------------------------------------------------- 1 | import { Thing } from '../Thing' 2 | 3 | export class ThingImpl implements Thing { 4 | constructor() { 5 | this.name = '' 6 | this.description = '' 7 | this.id = Math.random() + '' 8 | } 9 | name: string 10 | description: string 11 | id: string 12 | } 13 | -------------------------------------------------------------------------------- /typescript-plugin-extract-interface-client-project1/src/model/base/impl/ThingImpl.ts: -------------------------------------------------------------------------------- 1 | import { Thing } from "../Thing"; 2 | 3 | export class ThingImpl implements Thing { 4 | constructor(){ 5 | this.name='' 6 | this.description = '' 7 | this.id=Math.random()+'' 8 | } 9 | name: string; 10 | description: string; 11 | id: string; 12 | } -------------------------------------------------------------------------------- /typescript-plugin-move-file/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2018", 4 | "module": "commonjs", 5 | "lib": ["es2018"], 6 | "outDir": "./dist", 7 | "rootDir": ".", 8 | "strict": true, 9 | "strictNullChecks": false, 10 | "esModuleInterop": true, 11 | "declaration": true 12 | } 13 | } -------------------------------------------------------------------------------- /ts-run/api/modules/_types_.md: -------------------------------------------------------------------------------- 1 | [ts-run](../README.md) > ["types"](../modules/_types_.md) 2 | 3 | # External module: "types" 4 | 5 | ## Index 6 | 7 | ### Interfaces 8 | 9 | * [File](../interfaces/_types_.file.md) 10 | * [TsRunOptions](../interfaces/_types_.tsrunoptions.md) 11 | * [TsRunResult](../interfaces/_types_.tsrunresult.md) 12 | 13 | --- 14 | 15 | -------------------------------------------------------------------------------- /typescript-plugin-move-declaration/assets/sampleProject2/src/model/base/impl/ThingImpl.ts: -------------------------------------------------------------------------------- 1 | import { Thing } from "../Thing"; 2 | 3 | export class ThingImpl implements Thing { 4 | constructor(){ 5 | this.name='' 6 | this.description = '' 7 | this.id=Math.random()+'' 8 | } 9 | name: string; 10 | description: string; 11 | id: string; 12 | } -------------------------------------------------------------------------------- /ts-run/src/test/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | ts-run tests 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /typescript-plugin-add-type/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2018", 4 | "module": "commonjs", 5 | "lib": ["es2018"], 6 | "outDir": "./dist", 7 | "rootDir": "./src", 8 | "strict": true, 9 | "removeComments": false, 10 | "esModuleInterop": true, 11 | "strictNullChecks": false 12 | } 13 | } -------------------------------------------------------------------------------- /typescript-plugin-move-declaration/assets/sampleProject1/src/tools.ts: -------------------------------------------------------------------------------- 1 | import { Apple } from "./model/apple"; 2 | import { a as a2 } from "./model/level2/usingApples"; 3 | import { Seed } from "./model/seeds"; 4 | export function createSomeFruits() { 5 | const a = new Apple() 6 | a.color = "red" 7 | a.seeds = [[[new Seed(), new Seed()]]] 8 | return { apples: [a, a2] } 9 | } -------------------------------------------------------------------------------- /ts-simple-ast-extra/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "lib": ["esnext", "dom"], 6 | "outDir": "./dist", 7 | "rootDir": ".", 8 | "strict": true, 9 | "esModuleInterop": true, 10 | "declaration": true, 11 | "sourceMap": true 12 | }, 13 | "include": ["src", "spec"] 14 | } -------------------------------------------------------------------------------- /typescript-plugin-ast-inspector/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2018", 4 | "module": "commonjs", 5 | "lib": ["es2018"], 6 | "outDir": "./dist", 7 | "rootDir": "./src", 8 | "strict": false, 9 | "declaration": true, 10 | "esModuleInterop": true 11 | }, 12 | "exclude": [ 13 | "dist", "doc" 14 | ] 15 | } -------------------------------------------------------------------------------- /typescript-plugin-util/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2018", 4 | "module": "commonjs", 5 | "lib": ["es2018"], 6 | "outDir": "./dist", 7 | "rootDir": ".", 8 | "strict": true, 9 | "strictNullChecks": false, 10 | "esModuleInterop": true, 11 | "declaration": true, 12 | "sourceMap": true 13 | } 14 | } -------------------------------------------------------------------------------- /ts-simple-ast-extra/spec/assets/projectSample1/src/model/units/UnitImpl.ts: -------------------------------------------------------------------------------- 1 | import { ThingImpl } from '../base/impl/ThingImpl' 2 | import { Unit } from './Unit' 3 | 4 | export abstract class UnitImpl extends ThingImpl implements Unit { 5 | health: number = 0 6 | 7 | abstract move(x: number, y: number, animationMode: 'simple' | 'complex', arriveDateLimit: Date): Promise 8 | } 9 | -------------------------------------------------------------------------------- /plain-typescript-test-project/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2018", 4 | "module": "commonjs", 5 | "lib": ["es2018"], 6 | "outDir": "./dist", 7 | "rootDir": ".", 8 | "strict": true, 9 | "strictNullChecks": false, 10 | "esModuleInterop": true, 11 | "declaration": true, 12 | "sourceMap": true 13 | } 14 | } -------------------------------------------------------------------------------- /ts-run/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "lib": ["esnext", "dom"], 6 | "outDir": "./dist", 7 | "rootDir": ".", 8 | "strict": true, 9 | "esModuleInterop": true, 10 | "declaration": true, 11 | "sourceMap": true, 12 | "skipLibCheck": true 13 | }, 14 | "include": ["src"] 15 | } -------------------------------------------------------------------------------- /typescript-plugin-extract-interface-client-project1/src/model/units/UnitImpl.ts: -------------------------------------------------------------------------------- 1 | import { Unit } from "./Unit"; 2 | import { ThingImpl } from "../base/impl/ThingImpl"; 3 | 4 | export abstract class UnitImpl extends ThingImpl implements Unit { 5 | health: number=0 6 | 7 | abstract move(x: number, y: number, animationMode: 'simple'|'complex', arriveDateLimit: Date): Promise 8 | } 9 | -------------------------------------------------------------------------------- /typescript-plugin-postfix/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2018", 4 | "module": "commonjs", 5 | "lib": ["es2018"], 6 | "outDir": "./dist", 7 | "rootDir": ".", 8 | "strict": false, 9 | "esModuleInterop": true, 10 | "declaration": true, 11 | "sourceMap": true 12 | }, 13 | "include": [ 14 | "spec", "src" 15 | ] 16 | } -------------------------------------------------------------------------------- /plugin-scratch-1/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "lib": ["esnext", "dom"], 6 | "outDir": "./dist", 7 | "rootDir": ".", 8 | "noImplicitAny": true, 9 | "esModuleInterop": true, 10 | "declaration": true, 11 | "sourceMap": true, 12 | "skipLibCheck": true 13 | }, 14 | "include": ["src"] 15 | } -------------------------------------------------------------------------------- /typescript-plugin-test-helper/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2018", 4 | "module": "commonjs", 5 | "lib": ["es2018", "dom"], 6 | "outDir": "./dist", 7 | "rootDir": ".", 8 | "strict": false, 9 | "esModuleInterop": true, 10 | "declaration": true, 11 | "sourceMap": true 12 | }, 13 | "include": [ 14 | "spec" 15 | ] 16 | } -------------------------------------------------------------------------------- /typescript-plugins-text-based-user-interaction/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2018", 4 | "module": "commonjs", 5 | "lib": ["es2018"], 6 | "outDir": "./dist", 7 | "rootDir": ".", 8 | "strict": true, 9 | "strictNullChecks": false, 10 | "esModuleInterop": true, 11 | "declaration": true, 12 | "sourceMap": true 13 | } 14 | } -------------------------------------------------------------------------------- /typescript-ast-util/src/misc.ts: -------------------------------------------------------------------------------- 1 | 2 | export function unionEquals(left: T[], right: T[], equals: (a: T, b: T) => boolean): T[] { 3 | return left.concat(right).reduce((acc, element) => { 4 | return acc.some(elt => equals(elt, element)) ? acc : acc.concat(element) 5 | } 6 | , []); 7 | } 8 | 9 | export function flat(arr: T[][]): T[] { 10 | return arr.reduce((a, b) => a.concat(b)) 11 | } -------------------------------------------------------------------------------- /typescript-plugin-method-delegate/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2018", 4 | "module": "commonjs", 5 | "lib": ["es2018", "dom"], 6 | "outDir": "./dist", 7 | "rootDir": ".", 8 | "strict": false, 9 | "esModuleInterop": true, 10 | "declaration": true, 11 | "sourceMap": true 12 | }, 13 | "include": [ 14 | "src", "spec" 15 | ] 16 | } -------------------------------------------------------------------------------- /typescript-plugin-move-declaration/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2018", 4 | "module": "commonjs", 5 | "lib": ["es2018", "dom"], 6 | "outDir": "./dist", 7 | "rootDir": ".", 8 | "strict": false, 9 | "esModuleInterop": true, 10 | "declaration": true, 11 | "sourceMap": true 12 | }, 13 | "include": [ 14 | "src", "spec" 15 | ] 16 | } -------------------------------------------------------------------------------- /typescript-plugin-all-ts-fixes-and-refactors/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2018", 4 | "module": "commonjs", 5 | "lib": ["es2018"], 6 | "outDir": "./dist", 7 | "rootDir": ".", 8 | "strict": false, 9 | "esModuleInterop": true, 10 | "declaration": true, 11 | "sourceMap": true 12 | }, 13 | "include": [ 14 | "spec", "src" 15 | ] 16 | } -------------------------------------------------------------------------------- /typescript-plugin-method-delegate/assets/sampleProject1/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2018", 4 | "module": "commonjs", 5 | "lib": ["es2018", "dom"], 6 | "outDir": "./dist", 7 | "rootDir": ".", 8 | "strict": true, 9 | "strictNullChecks": false, 10 | "esModuleInterop": true, 11 | "declaration": true, 12 | "sourceMap": true 13 | } 14 | } -------------------------------------------------------------------------------- /vscode-typescript-refactors/src/extension.ts: -------------------------------------------------------------------------------- 1 | import * as vscode from 'vscode'; 2 | //import { VsCodeInputProvider } from 'input-ui-ipc-provider-vscode' 3 | 4 | export function activate(context: vscode.ExtensionContext) { 5 | // vscode.window.onDidChangeWindowState() .activeTextEditor!.document. 6 | // new VsCodeInputProvider({ port: 3001, log: console.log }) 7 | } 8 | export function deactivate() { 9 | } 10 | -------------------------------------------------------------------------------- /typescript-plugin-move-declaration/assets/sampleProject1/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2018", 4 | "module": "commonjs", 5 | "lib": ["es2018", "dom"], 6 | "outDir": "./dist", 7 | "rootDir": ".", 8 | "strict": true, 9 | "strictNullChecks": false, 10 | "esModuleInterop": true, 11 | "declaration": true, 12 | "sourceMap": true 13 | } 14 | } -------------------------------------------------------------------------------- /typescript-plugin-move-declaration/assets/sampleProject2/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2018", 4 | "module": "commonjs", 5 | "lib": ["es2018", "dom"], 6 | "outDir": "./dist", 7 | "rootDir": ".", 8 | "strict": true, 9 | "strictNullChecks": false, 10 | "esModuleInterop": true, 11 | "declaration": true, 12 | "sourceMap": true 13 | } 14 | } -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/assets/sampleProject1/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2018", 4 | "module": "commonjs", 5 | "lib": ["es2018", "dom"], 6 | "outDir": "./dist", 7 | "rootDir": ".", 8 | "strict": true, 9 | "strictNullChecks": false, 10 | "esModuleInterop": true, 11 | "declaration": true, 12 | "sourceMap": true 13 | } 14 | } -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2018", 4 | "module": "commonjs", 5 | "lib": [ 6 | "es2018" 7 | ], 8 | "outDir": "./dist", 9 | "rootDir": ".", 10 | "strict": false, 11 | "esModuleInterop": true, 12 | "declaration": true, 13 | "sourceMap": true 14 | }, 15 | "include": [ 16 | "spec", 17 | "src" 18 | ] 19 | } -------------------------------------------------------------------------------- /typescript-plugin-move-declaration/assets/sampleProject1/src/model/apple.ts: -------------------------------------------------------------------------------- 1 | import { Fruit } from "./fruit"; 2 | import { Eatable } from "./Eatable"; 3 | import { Alive } from "./Alive"; 4 | import { Seed } from "./seeds"; 5 | 6 | export class AppleTree implements Alive{ 7 | apples: Apple[] 8 | } 9 | export class Apple extends Fruit implements Eatable, Alive { 10 | seeds: Array>> 11 | tree: AppleTree 12 | } -------------------------------------------------------------------------------- /sample-ts-plugin1-sample-project/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2018", 4 | "module": "commonjs", 5 | "lib": ["es2018"], 6 | "outDir": "./dist", 7 | "strict": true, 8 | "esModuleInterop": true, 9 | "noImplicitAny": true, 10 | "plugins": [{ 11 | "name": "sample-ts-plugin1", 12 | "remove": ["caller", "callee", "getDay"] 13 | }] 14 | } 15 | } -------------------------------------------------------------------------------- /input-ui-ipc-provider-vscode/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "no-string-throw": true, 4 | "no-unused-expression": true, 5 | "no-duplicate-variable": true, 6 | "curly": true, 7 | "class-name": true, 8 | "semicolon": [ 9 | true, 10 | "always" 11 | ], 12 | "triple-equals": true 13 | }, 14 | "defaultSeverity": "warning" 15 | } -------------------------------------------------------------------------------- /vscode-typescript-refactors/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "no-string-throw": true, 4 | "no-unused-expression": true, 5 | "no-duplicate-variable": true, 6 | "curly": true, 7 | "class-name": true, 8 | "semicolon": [ 9 | true, 10 | "always" 11 | ], 12 | "triple-equals": true 13 | }, 14 | "defaultSeverity": "warning" 15 | } -------------------------------------------------------------------------------- /input-ui-ipc-provider/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2018", 4 | "module": "commonjs", 5 | "lib": [ 6 | "es2018" 7 | ], 8 | "outDir": "./dist", 9 | "rootDir": ".", 10 | "strict": true, 11 | "strictNullChecks": false, 12 | "esModuleInterop": true, 13 | "declaration": true, 14 | "sourceMap": true 15 | }, 16 | "include": [ 17 | "spec", 18 | "src" 19 | ] 20 | } -------------------------------------------------------------------------------- /typescript-node-ids/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "lib": [ 4 | "es2018" 5 | ], 6 | "target": "ES2018", 7 | "module": "commonjs", 8 | "strict": true, 9 | "esModuleInterop": true, 10 | "outDir": "dist", 11 | "rootDir": ".", 12 | "declaration": true 13 | }, 14 | "include": [ 15 | "./src/**/*.ts", 16 | "./spec/**/*.ts" 17 | ], 18 | "exclude": [ 19 | "./dist/**/*" 20 | ] 21 | } -------------------------------------------------------------------------------- /input-ui-ipc-provider-test-vscode-extension/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "no-string-throw": true, 4 | "no-unused-expression": true, 5 | "no-duplicate-variable": true, 6 | "curly": true, 7 | "class-name": true, 8 | "semicolon": [ 9 | true, 10 | "always" 11 | ], 12 | "triple-equals": true 13 | }, 14 | "defaultSeverity": "warning" 15 | } -------------------------------------------------------------------------------- /typescript-ast-util/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2018", 4 | "module": "commonjs", 5 | "lib": ["es2018"], 6 | "outDir": "./dist", 7 | "rootDir": ".", 8 | "strict": true, 9 | "strictNullChecks": false, 10 | "esModuleInterop": true, 11 | "declaration": true, 12 | "sourceMap": true 13 | }, 14 | "include": [ 15 | "src/**/*.ts", "spec/**/*.ts", "tests/**/*.ts" 16 | ] 17 | } -------------------------------------------------------------------------------- /input-ui-ipc-provider-test-typescript-plugin/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2018", 4 | "module": "commonjs", 5 | "lib": [ 6 | "es2018" 7 | ], 8 | "outDir": "./dist", 9 | "rootDir": ".", 10 | "strict": false, 11 | "strictNullChecks": false, 12 | "esModuleInterop": true, 13 | "declaration": true, 14 | "sourceMap": true 15 | }, 16 | "include": [ 17 | "spec", 18 | "src" 19 | ] 20 | } -------------------------------------------------------------------------------- /typescript-plugin-function-signature-refactors/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2018", 4 | "module": "commonjs", 5 | "lib": [ 6 | "es2018" 7 | ], 8 | "outDir": "./dist", 9 | "rootDir": ".", 10 | "strict": false, 11 | "strictNullChecks": false, 12 | "esModuleInterop": true, 13 | "declaration": true, 14 | "sourceMap": true 15 | }, 16 | "include": [ 17 | "spec", 18 | "src" 19 | ] 20 | } -------------------------------------------------------------------------------- /typescript-plugin-move-declaration/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the tasks.json format 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "identifier": "build", 8 | "type": "npm", 9 | "script": "build", 10 | "problemMatcher": ["$tsc"], 11 | "group": { 12 | "kind": "build", 13 | "isDefault": true 14 | } 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the tasks.json format 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "identifier": "build", 8 | "type": "npm", 9 | "script": "build", 10 | "problemMatcher": ["$tsc"], 11 | "group": { 12 | "kind": "build", 13 | "isDefault": true 14 | } 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /plugin-scratch-1/test-project/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "lib": ["esnext"], 6 | "outDir": "./dist", 7 | "rootDir": ".", 8 | "noImplicitAny": true, 9 | "esModuleInterop": true, 10 | "declaration": true, 11 | "sourceMap": true, 12 | "skipLibCheck": true, 13 | "plugins": [{ 14 | "name": "plugin-scratch-1", 15 | }] 16 | }, 17 | "include": ["src"] 18 | } -------------------------------------------------------------------------------- /typescript-plugin-extract-interface-client-project1/src/model/units/impl/Archer.ts: -------------------------------------------------------------------------------- 1 | import { AttackerUnit } from "../AttackerUnit"; 2 | import { Unit } from "../Unit"; 3 | import { UnitImpl } from "../UnitImpl"; 4 | 5 | export class Archer extends UnitImpl implements AttackerUnit { 6 | attack(target: Unit) { target.health -= 5 } 7 | move(x: number, y: number, animationMode: 'simple'|'complex', arriveDateLimit: Date): Promise{ 8 | return Promise.resolve() 9 | } 10 | } -------------------------------------------------------------------------------- /typescript-plugin-extract-interface-client-project1/src/model/units/impl/Knight.ts: -------------------------------------------------------------------------------- 1 | import { AttackerUnit } from "../AttackerUnit"; 2 | import { Unit } from "../Unit"; 3 | import { UnitImpl } from "../UnitImpl"; 4 | 5 | export class Knight extends UnitImpl implements AttackerUnit { 6 | attack(target: Unit) { target.health -= 10 } 7 | move(x: number, y: number, animationMode: 'simple'|'complex', arriveDateLimit: Date): Promise{ 8 | return Promise.resolve() 9 | } 10 | } -------------------------------------------------------------------------------- /typescript-plugin-function-signature-refactors/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the tasks.json format 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "identifier": "build", 8 | "type": "npm", 9 | "script": "build", 10 | "problemMatcher": ["$tsc"], 11 | "group": { 12 | "kind": "build", 13 | "isDefault": true 14 | } 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /ts-simple-ast-extra/spec/assets/projectSample1/src/model/units/impl/Archer.ts: -------------------------------------------------------------------------------- 1 | import { AttackerUnit } from '../AttackerUnit' 2 | import { Unit } from '../Unit' 3 | import { UnitImpl } from '../UnitImpl' 4 | 5 | export class Archer extends UnitImpl implements AttackerUnit { 6 | attack(target: Unit) { 7 | target.health -= 5 8 | } 9 | move(x: number, y: number, animationMode: 'simple' | 'complex', arriveDateLimit: Date): Promise { 10 | return Promise.resolve() 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ts-simple-ast-extra/spec/assets/projectSample1/src/model/units/impl/Knight.ts: -------------------------------------------------------------------------------- 1 | import { AttackerUnit } from '../AttackerUnit' 2 | import { Unit } from '../Unit' 3 | import { UnitImpl } from '../UnitImpl' 4 | 5 | export class Knight extends UnitImpl implements AttackerUnit { 6 | attack(target: Unit) { 7 | target.health -= 10 8 | } 9 | move(x: number, y: number, animationMode: 'simple' | 'complex', arriveDateLimit: Date): Promise { 10 | return Promise.resolve() 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /typescript-plugin-extract-interface-client-project1/src/model/units/impl/Warrior.ts: -------------------------------------------------------------------------------- 1 | import { AttackerUnit } from "../AttackerUnit"; 2 | import { Unit } from "../Unit"; 3 | import { UnitImpl } from "../UnitImpl"; 4 | 5 | export class Warrior extends UnitImpl implements AttackerUnit { 6 | attack(target: Unit) { target.health -= 2 } 7 | 8 | move(x: number, y: number, animationMode: 'simple'|'complex', arriveDateLimit: Date): Promise{ 9 | return Promise.resolve() 10 | } 11 | 12 | } -------------------------------------------------------------------------------- /ts-simple-ast-extra/src/refactor/impl/refactors.ts: -------------------------------------------------------------------------------- 1 | import { Node, Project } from 'ts-morph' 2 | import { applyAllSuggestedCodeFixes } from '../../changes' 3 | 4 | export function convertToEs6Module(project: Project, node: Node) { 5 | return applyAllSuggestedCodeFixes(project, node, [80001, 80005]) 6 | } 7 | 8 | export function inferTypesFromUsage(project: Project, node: Node) { 9 | return applyAllSuggestedCodeFixes(project, node, [7043, 7044, 7045, 7046, 7047, 7048, 7049, 7050, 7051]) 10 | } 11 | -------------------------------------------------------------------------------- /typescript-ast-util/spec/index.ts: -------------------------------------------------------------------------------- 1 | // Be able to run individual specs (without having to comment all the others). Examples: 2 | // 3 | // $ node spec cliApiSpec 4 | // $ node spec cliApiSpec,nodeApiSpec 5 | 6 | const path = require('path') 7 | const Jasmine = require('jasmine') 8 | 9 | let specFiles = process.argv[2] 10 | .split(',') 11 | .map(f => path.join(__dirname, f)) 12 | 13 | const jasmineRunner = new Jasmine() 14 | jasmineRunner.specFiles = specFiles 15 | jasmineRunner.execute() 16 | 17 | -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/spec/tests/importFromLibrary.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | import {Project, TypeGuards } from 'ts-morph'; 4 | 5 | const project1 = new Project({ 6 | useVirtualFileSystem: true 7 | }) 8 | const sourceFile = project1.createSourceFile('src/index.ts', ` 9 | import {f1} from 'a-library-f1' 10 | 11 | `) 12 | const decl = sourceFile.getImportDeclarations()[0] 13 | const rel =sourceFile .getRelativePathAsModuleSpecifierTo(decl.getModuleSpecifierSourceFile()) 14 | console.log(rel); 15 | -------------------------------------------------------------------------------- /ts-simple-ast-extra/spec/assets/projectSample1/src/model/units/impl/Warrior.ts: -------------------------------------------------------------------------------- 1 | import { AttackerUnit } from '../AttackerUnit' 2 | import { Unit } from '../Unit' 3 | import { UnitImpl } from '../UnitImpl' 4 | 5 | export class Warrior extends UnitImpl implements AttackerUnit { 6 | attack(target: Unit) { 7 | target.health -= 2 8 | } 9 | 10 | move(x: number, y: number, animationMode: 'simple' | 'complex', arriveDateLimit: Date): Promise { 11 | return Promise.resolve() 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /typescript-plugin-util/spec/index.ts: -------------------------------------------------------------------------------- 1 | // Be able to run individual specs (without having to comment all the others). Examples: 2 | // 3 | // $ node spec cliApiSpec 4 | // $ node spec cliApiSpec,nodeApiSpec 5 | 6 | const path = require('path') 7 | const Jasmine = require('jasmine') 8 | 9 | let specFiles = process.argv[2] 10 | .split(',') 11 | .map(f => path.join(__dirname, f)) 12 | 13 | const jasmineRunner = new Jasmine() 14 | jasmineRunner.specFiles = specFiles 15 | jasmineRunner.execute() 16 | 17 | -------------------------------------------------------------------------------- /plugin-scratch-1/test-project/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "plugin-scratch-1-test-project", 3 | "version": "0.0.1", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "typescript": { 8 | "version": "4.1.3", 9 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.3.tgz", 10 | "integrity": "sha512-B3ZIOf1IKeH2ixgHhj6la6xdwR9QrLC5d1VKeCSY4tvkqhF2eqd9O7txNlS0PO3GrBAFIdr3L1ndNwteUbZLYg==", 11 | "dev": true 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /typescript-plugin-method-delegate/assets/sampleProject1/src/index.ts: -------------------------------------------------------------------------------- 1 | 2 | interface Speedometer{ 3 | // UN INDENTED ON PURPOSE !!!! 4 | getCurrentSpeed():number 5 | /** la rotacion del chamaco */ 6 | rotate(force:number):{counterclockwise:boolean, h:number} 7 | /** 8 | * @return un numero number importante 9 | */ 10 | m():number 11 | go(to:{x:number,y:number}):Promise 12 | } 13 | interface Car { 14 | speedometer: Speedometer 15 | } 16 | 17 | class Foo{ 18 | speedometer: Speedometer 19 | } -------------------------------------------------------------------------------- /vscode-typescript-refactors/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | // Place your settings in this file to overwrite default and user settings. 2 | { 3 | "files.exclude": { 4 | "out": false // set this to true to hide the "out" folder with the compiled JS files 5 | }, 6 | "search.exclude": { 7 | "out": true // set this to false to include "out" folder in search results 8 | }, 9 | // Turn off tsc task auto detection since we have the necessary tasks as npm scripts 10 | "typescript.tsc.autoDetect": "off" 11 | } -------------------------------------------------------------------------------- /ts-run/src/getCompilerOptions.ts: -------------------------------------------------------------------------------- 1 | import { File } from './types' 2 | import { CompilerOptions, ts } from 'ts-morph' 3 | import { parseCompilerOptionsFromText } from 'ts-simple-ast-extra' 4 | import { dirname } from 'misc-utils-of-mine-generic' 5 | 6 | export async function getCompilerOptions(f: File) { 7 | const tsConfigData = await f.getContent() 8 | const tsconfigPath = dirname(f.getFilePath()) 9 | const compilerOptions: CompilerOptions = parseCompilerOptionsFromText(tsConfigData, tsconfigPath) 10 | return compilerOptions 11 | } 12 | -------------------------------------------------------------------------------- /typescript-plugin-extract-interface-client-project1/src/tests/stringconcattest1.ts: -------------------------------------------------------------------------------- 1 | const name = 'Sebastian' 2 | 3 | const where = 'here' 4 | 5 | const msg1 = "Hello " + name + " we are \"glad\" you have " + (1 + 2 + 3) + " years old" 6 | 7 | const msg2 = `Hello ${name}. We are glad you are ${where}` 8 | 9 | function prettyFunction(a: string, b: number, c: Date[]): boolean { 10 | return null 11 | } 12 | 13 | class cccc { 14 | method(g: string): string { 15 | return prettyFunction(g, 2, [new Date()]) + '' 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /input-ui-ipc-provider-test-vscode-extension/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | // Place your settings in this file to overwrite default and user settings. 2 | { 3 | "files.exclude": { 4 | "out": false // set this to true to hide the "out" folder with the compiled JS files 5 | }, 6 | "search.exclude": { 7 | "out": true // set this to false to include "out" folder in search results 8 | }, 9 | // Turn off tsc task auto detection since we have the necessary tasks as npm scripts 10 | "typescript.tsc.autoDetect": "off" 11 | } -------------------------------------------------------------------------------- /typescript-plugin-test-helper/spec/indexSpec.ts: -------------------------------------------------------------------------------- 1 | import { create } from '../src' 2 | import { sync as glob } from 'glob' 3 | import * as ts from 'typescript' 4 | 5 | describe('compileSource, findChildren and getJsDoc', () => { 6 | it('1', (done) => { 7 | const inputFiles = glob('assets/sampleProject1/src/**/*.ts') 8 | console.log(inputFiles); 9 | 10 | const tool = create({ 11 | inputFiles, 12 | options: { module: ts.ModuleKind.CommonJS }, 13 | // currentDirectory: 'assets/sampleProject1/' 14 | }) 15 | tool.watch() 16 | }) 17 | }) 18 | -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/spec/addReturnStatementSpec.ts: -------------------------------------------------------------------------------- 1 | import { basicTest, defaultAfterEach, defaultBeforeEach, DefaultBeforeEachResult } from './testUtil' 2 | 3 | describe('addReturnStatement', () => { 4 | let config: DefaultBeforeEachResult 5 | beforeEach(() => { 6 | config = defaultBeforeEach({ createNewFile: `function fffff(): number{}` }) 7 | }) 8 | it('basic', async () => { 9 | basicTest(19, config, 'addReturnStatement', [`return`]) 10 | }) 11 | afterEach(() => { 12 | defaultAfterEach(config) 13 | }) 14 | }) 15 | 16 | -------------------------------------------------------------------------------- /ts-simple-ast-extra/src/index.ts: -------------------------------------------------------------------------------- 1 | export { Project, ts } from 'ts-morph' 2 | export * from './astPath' 3 | export * from './changes' 4 | export * from './compilerOptions' 5 | export * from './declaration' 6 | export * from './diagnostics' 7 | export * from './flags' 8 | export * from './generalNode' 9 | export * from './locals' 10 | export * from './modify' 11 | export * from './node' 12 | export * from './path' 13 | export * from './refactor' 14 | export * from './reference' 15 | export * from './types' 16 | export { tsMorph } 17 | 18 | import * as tsMorph from 'ts-morph' 19 | -------------------------------------------------------------------------------- /typescript-plugin-extract-interface-client-project1/src/tests/letPostfixTest1.ts: -------------------------------------------------------------------------------- 1 | console.log() 2 | 3 | 4 | function f(a, b, c, foo) { 5 | function asdasd() { 6 | } 7 | const nameMePlease0 = a < b && c; 8 | // a b && cconXX; 9 | if ( nameMePlease0 ) 10 | return a > 3 * foo.bar.alf && b < c.con 11 | } 12 | 13 | // 1 - l 14 | // 2 - e. 15 | // 3 - .lo 16 | // 4 - le.lo 17 | 18 | 19 | const s1 = `function f(a, b, c, foo) { 20 | function asdasd() { 21 | } 22 | if (a < b) 23 | return a > 3 * foo.bar.alf && b < c. 24 | } 25 | 26 | ` -------------------------------------------------------------------------------- /ts-simple-ast-extra/src/refactor/impl/organizeImports.ts: -------------------------------------------------------------------------------- 1 | import { UserPreferences } from 'ts-morph' 2 | import { RefactorFormatBaseOptions } from './format' 3 | 4 | export interface OrganizeImportsOptions extends RefactorFormatBaseOptions, Partial { 5 | organizeImports?: boolean 6 | } 7 | 8 | export function organizeImports(options: OrganizeImportsOptions) { 9 | if (!options.organizeImports) { 10 | return 11 | } 12 | const file = options.file.organizeImports(options, options) 13 | options.file.replaceWithText(file.getFullText()) 14 | return file 15 | } 16 | -------------------------------------------------------------------------------- /typescript-plugin-extract-interface-client-project1/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "node", 9 | "request": "launch", 10 | "name": "Launch Program", 11 | "program": "${workspaceFolder}/index.js", 12 | "outFiles": [ 13 | "${workspaceFolder}/**/*.js" 14 | ] 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/spec/const2letSpec.ts: -------------------------------------------------------------------------------- 1 | const code = ` 2 | const constant2 = 1; 3 | constant2 = 2 4 | ` 5 | import { basicTest, defaultAfterEach, defaultBeforeEach, DefaultBeforeEachResult } from './testUtil' 6 | describe('const2let', () => { 7 | let config: DefaultBeforeEachResult 8 | beforeEach(() => { 9 | config = defaultBeforeEach({ createNewFile: code }) 10 | }) 11 | it('basic', async () => { 12 | basicTest(25, config, 'const2let', [`let constant2 = 1`]) 13 | }) 14 | afterEach(() => { 15 | defaultAfterEach(config) 16 | }) 17 | }) 18 | 19 | -------------------------------------------------------------------------------- /input-ui-ipc-provider-vscode/README.md: -------------------------------------------------------------------------------- 1 | # input-ui-ipc-provider-vscode 2 | 3 | vscode Editor support for generic GUI data inquire through https://github.com/cancerberoSgx/typescript-plugins-of-mine/tree/master/input-ui-ipc-provider 4 | 5 | Particularly, This will help my TypeScript plugins to inquire the user for data visually in TypeScript before refactoring the code. For example, ask the user in which class he wants to move a certain method. 6 | 7 | This will keep my plugins editor/IDE agnostic while the user experience is acceptable and visual. 8 | 9 | Probably this package should be installed together with the ts plugins -------------------------------------------------------------------------------- /vscode-typescript-refactors/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | // See https://go.microsoft.com/fwlink/?LinkId=733558 2 | // for the documentation about the tasks.json format 3 | { 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "type": "npm", 8 | "script": "watch", 9 | "problemMatcher": "$tsc-watch", 10 | "isBackground": true, 11 | "presentation": { 12 | "reveal": "never" 13 | }, 14 | "group": { 15 | "kind": "build", 16 | "isDefault": true 17 | } 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /ts-simple-ast-extra/spec/refactors/convertToEs6ModuleSpec.ts: -------------------------------------------------------------------------------- 1 | import { Project } from 'ts-morph' 2 | import { convertToEs6Module } from '../../src' 3 | 4 | describe('convertToEs6Module', () => { 5 | it('should convert requires to imports', () => { 6 | const project = new Project({ useVirtualFileSystem: true }) 7 | const code = ` 8 | const r = require('f') 9 | const f = foo('r') 10 | import {foo} from 'bar' 11 | ` 12 | const f = project.createSourceFile('f1.ts', code) 13 | convertToEs6Module(project, f) 14 | expect(f.getText()).toContain('import r=require(\'f\')') 15 | }) 16 | }) 17 | -------------------------------------------------------------------------------- /input-ui-ipc-provider-test-vscode-extension/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | // See https://go.microsoft.com/fwlink/?LinkId=733558 2 | // for the documentation about the tasks.json format 3 | { 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "type": "npm", 8 | "script": "watch", 9 | "problemMatcher": "$tsc-watch", 10 | "isBackground": true, 11 | "presentation": { 12 | "reveal": "never" 13 | }, 14 | "group": { 15 | "kind": "build", 16 | "isDefault": true 17 | } 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /typescript-plugin-all-ts-fixes-and-refactors/spec/firstSpec.ts: -------------------------------------------------------------------------------- 1 | import { getSupportedCodeFixes } from "typescript"; 2 | import { getAllSupportedCodeFixeDefinitions } from '../src/supportedCodeFixes'; 3 | import { writeFileSync } from 'fs'; 4 | 5 | describe('first', () => { 6 | it('should 1', () => { 7 | expect(getAllSupportedCodeFixeDefinitions().length).toBeGreaterThan(0) 8 | getAllSupportedCodeFixeDefinitions().forEach(d => { 9 | expect(getSupportedCodeFixes().includes(d.code + '')) 10 | }) 11 | 12 | writeFileSync('all.txt', JSON.stringify(getAllSupportedCodeFixeDefinitions(), null, 2)); 13 | 14 | }) 15 | }) -------------------------------------------------------------------------------- /ts-simple-ast-extra/spec/assets/moveDeclarationReal.ts: -------------------------------------------------------------------------------- 1 | import { Project } from 'ts-morph' 2 | import { moveDeclaration } from '../../src' 3 | 4 | const p = new Project({ 5 | tsConfigFilePath: '/home/sg/git/typescript-plugins-of-mine/ts-run/tsconfig.json', 6 | addFilesFromTsConfig: true 7 | }) 8 | const file = p.getSourceFileOrThrow('file.ts') 9 | const declaration = file.getInterfaceOrThrow('File') 10 | const target = p.getSourceFileOrThrow('types.ts') 11 | console.log(p.getSourceFiles().length, target.getFilePath(), declaration.getText()) 12 | 13 | moveDeclaration({ 14 | target, 15 | declaration 16 | }) 17 | 18 | p.saveSync() 19 | -------------------------------------------------------------------------------- /vscode-typescript-refactors/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | ### 0.0.1 4 | 5 | Refactors are pure TypeScript Language Service plugins and are maintained in [this project](https://github.com/cancerberoSgx/typescript-plugins-of-mine/tree/master/typescript-plugin-proactive-code-fixes). 6 | 7 | This 0.0.1 version of this extension just makes vscode enable the refactors more easily. 8 | 9 | ### 0.0.11 10 | 11 | * dependencies updated for more refactors 12 | * typescript-plugin-function-signature-refactors for change parameter order in function-like signature (so we can start testing user input inquire with vscode GUI) 13 | * readme with gif 14 | -------------------------------------------------------------------------------- /input-ui-ipc-provider-vscode/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | ### 0.0.1 4 | 5 | Refactors are pure TypeScript Language Service plugins and are maintained in [this project](https://github.com/cancerberoSgx/typescript-plugins-of-mine/tree/master/typescript-plugin-proactive-code-fixes). 6 | 7 | This 0.0.1 version of this extension just makes vscode enable the refactors more easily. 8 | 9 | ### 0.0.11 10 | 11 | * dependencies updated for more refactors 12 | * typescript-plugin-function-signature-refactors for change parameter order in function-like signature (so we can start testing user input inquire with vscode GUI) 13 | * readme with gif 14 | -------------------------------------------------------------------------------- /input-ui-ipc-provider-test-vscode-extension/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | ### 0.0.1 4 | 5 | Refactors are pure TypeScript Language Service plugins and are maintained in [this project](https://github.com/cancerberoSgx/typescript-plugins-of-mine/tree/master/typescript-plugin-proactive-code-fixes). 6 | 7 | This 0.0.1 version of this extension just makes vscode enable the refactors more easily. 8 | 9 | ### 0.0.11 10 | 11 | * dependencies updated for more refactors 12 | * typescript-plugin-function-signature-refactors for change parameter order in function-like signature (so we can start testing user input inquire with vscode GUI) 13 | * readme with gif 14 | -------------------------------------------------------------------------------- /typescript-ast-util/README.md: -------------------------------------------------------------------------------- 1 | # typescript-ast-util 2 | 3 | **IMPORTANT**: a lot of objectives of this project were implemented in ts-simple-ast so it's kind of obsolete. 4 | 5 | I feel that I'm collecting utilities used in several plugins so I'm putting them in this project. 6 | 7 | [See apidocs](../docs/typescript-ast-util/modules/_index_.html) 8 | 9 | 10 | # TODO 11 | 12 | * rename / alias findChild to findDescendant 13 | * remove / investigate / rename / better jssdoc for findChild2() 14 | * document createProgram and other utilities 15 | * add example in ts-api playground 16 | 17 | 18 | * transform easy and print api base on : tests/transform2.ts 19 | -------------------------------------------------------------------------------- /plugin-scratch-1/test-project/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "plugin-scratch-1-test-project", 3 | "version": "0.0.1", 4 | "description": "simple plain ts plugin", 5 | "main": "dist/src/index.js", 6 | "typings": "dist/src/index.d.ts", 7 | "scripts": { 8 | "build": "npx tsc" 9 | }, 10 | "keywords": [ 11 | "TypeScript", 12 | "TypeScript Language Service", 13 | "plugin" 14 | ], 15 | "author": "Sebastian Gurin", 16 | "license": "MIT", 17 | "dependencies": {}, 18 | "devDependencies": { 19 | "typescript": "^4.1.3" 20 | }, 21 | "repository": "https://github.com/cancerberoSgx/typescript-plugin-of-mine/tree/master/plugin-scratch-1" 22 | } 23 | -------------------------------------------------------------------------------- /plain-typescript-test-project/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "plain-typescript-test-project", 3 | "version": "1.0.0", 4 | "description": "just a ts project for testing", 5 | "main": "dist/src/index.js", 6 | "scripts": { 7 | "build": "tsc" 8 | }, 9 | "private": true, 10 | "keywords": [ 11 | "TypeScript", 12 | "TypeScript Language Service", 13 | "plugin" 14 | ], 15 | "author": "Sebastian Gurin", 16 | "license": "MIT", 17 | "dependencies": { 18 | }, 19 | "devDependencies": { 20 | "typescript": "3.1.3" 21 | }, 22 | "repository": "https://github.com/cancerberoSgx/typescript-plugin-of-mine/tree/master/plain-typescript-test-project" 23 | } 24 | -------------------------------------------------------------------------------- /typescript-node-ids/spec/testUtil.ts: -------------------------------------------------------------------------------- 1 | import * as ts from 'typescript' 2 | import { typeScriptImpl } from '../src' 3 | import { getKindName } from 'typescript-ast-util' 4 | import { fromNow } from 'hrtime-now' 5 | 6 | export function logTime(fn: () => T) { 7 | return fromNow(fn, (t, hint) => console.log(`Function ${fn.toString().replace(/\n+/, ' ')} took ${t}`)) 8 | } 9 | 10 | export function printNode(n: ts.Node, level: number = 0, index: number, parentNode: ts.Node): string { 11 | const text = n.getText() 12 | return `${new Array(level * 2).fill(' ').join('')}${getKindName(n.kind)}" - id: ${typeScriptImpl.getId(n)} ${text.substring(0, Math.min(text.length, 20))}` 13 | } 14 | -------------------------------------------------------------------------------- /sample-ts-plugin1-sample-project/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sample-ts-plugin1-sample-project", 3 | "version": "1.0.4", 4 | "description": "https://github.com/Microsoft/TypeScript/wiki/Writing-a-Language-Service-Plugin", 5 | "main": "index.js", 6 | "private": true, 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 0", 9 | "build": "tsc", 10 | "doc": "echo nothing && exit 0" 11 | }, 12 | "keywords": [], 13 | "author": "", 14 | "license": "ISC", 15 | "dependencies": {}, 16 | "devDependencies": { 17 | "@types/node": "^10.3.2", 18 | "sample-ts-plugin1": "file:../sample-ts-plugin1", 19 | "typescript": "2.9.1" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /plugin-scratch-1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "plugin-scratch-1", 3 | "version": "0.0.1", 4 | "description": "simple plain ts plugin", 5 | "main": "dist/src/index.js", 6 | "typings": "dist/src/index.d.ts", 7 | "scripts": { 8 | "build": "npx tsc" 9 | }, 10 | "keywords": [ 11 | "TypeScript", 12 | "TypeScript Language Service", 13 | "plugin" 14 | ], 15 | "author": "Sebastian Gurin", 16 | "license": "MIT", 17 | "dependencies": { 18 | "typescript": "^4.1.3" 19 | }, 20 | "devDependencies": { 21 | "@types/node": "^14.14.16" 22 | }, 23 | "repository": "https://github.com/cancerberoSgx/typescript-plugin-of-mine/tree/master/plugin-scratch-1" 24 | } 25 | -------------------------------------------------------------------------------- /ts-simple-ast-extra/src/refactor/impl/removeAllUnused.ts: -------------------------------------------------------------------------------- 1 | import { FormatCodeSettings, Project, SourceFile, UserPreferences } from 'ts-morph' 2 | 3 | export function removeAllUnused( 4 | project: Project, 5 | sourceFileOrPath: SourceFile | string, 6 | formatSettings: FormatCodeSettings = {}, 7 | userPreferences: UserPreferences = {} 8 | ) { 9 | const file = typeof sourceFileOrPath === 'string' ? project.getSourceFileOrThrow(sourceFileOrPath) : sourceFileOrPath 10 | const fix = project 11 | .getLanguageService() 12 | .getCombinedCodeFix(file, 'unusedIdentifier_delete', formatSettings, userPreferences) 13 | fix.getChanges().forEach(c => c.applyChanges({ overwrite: true })) 14 | } 15 | -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/spec/variableRenameSpec.ts: -------------------------------------------------------------------------------- 1 | const code = ` 2 | let variable = 1 3 | let variable = 's' 4 | ` 5 | import { basicTest, defaultAfterEach, defaultBeforeEach, DefaultBeforeEachResult } from './testUtil' 6 | describe('variableRename', () => { 7 | let config: DefaultBeforeEachResult 8 | beforeEach(() => { 9 | config = defaultBeforeEach({ createNewFile: code }) 10 | }) 11 | it('basic1', async () => { 12 | basicTest(10, config, 'variableRename', [`let variable2 = 1`]) 13 | }) 14 | it('basic2', async () => { 15 | basicTest(26, config, 'variableRename', [`let variable2 = 's'`]) 16 | }) 17 | afterEach(() => { 18 | defaultAfterEach(config) 19 | }) 20 | }) 21 | 22 | -------------------------------------------------------------------------------- /ts-simple-ast-extra/src/diagnostics.ts: -------------------------------------------------------------------------------- 1 | import { Diagnostic, DiagnosticMessageChain, Project } from 'ts-morph' 2 | 3 | export function printDiagnostics(project: Project) { 4 | return project.getPreEmitDiagnostics().map(getDiagnosticMessage) 5 | } 6 | 7 | export function getDiagnosticMessage(d: Diagnostic) { 8 | const s = d.getMessageText() 9 | return `${d.getSourceFile() && d.getSourceFile()!.getBaseName()}: ${typeof s === 'string' ? s : (s.getNext() || []).map(print).join(' - ')}` 10 | } 11 | 12 | function print(s: DiagnosticMessageChain | undefined): string { 13 | if (!s) { 14 | return '' 15 | } else { 16 | return `${s.getMessageText()} - ${(s.getNext() || []).map(print).join(' - ')}` 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /typescript-plugin-extract-interface-client-project1/src/alone/declareReturnValueAloneText.ts: -------------------------------------------------------------------------------- 1 | // function g34(): GResult { 2 | // return { a: 1, b: 's' } 3 | // } 4 | // const h77 = (): HResult => { 5 | // return { 6 | // a: 1, b: 's', 7 | // log: msg => msg + '', 8 | // kill: function (probe: T) { return 1 }, 9 | // status: { t: new Date() } 10 | // } 11 | // } 12 | // function fn87(): FNResult { 13 | // return { 14 | // a: 1, 15 | // b: 's', 16 | // log: (msg: string = 'hello') => { }, 17 | // kill: function (foo: HResult, value: T): { amount: number, newValue: T } { 18 | // return { 19 | // amount: 1, newValue: null 20 | // } 21 | // } 22 | // } 23 | // } 24 | -------------------------------------------------------------------------------- /plugin-scratch-1/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "plugin-scratch-1", 3 | "version": "0.0.1", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@types/node": { 8 | "version": "14.14.16", 9 | "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.16.tgz", 10 | "integrity": "sha512-naXYePhweTi+BMv11TgioE2/FXU4fSl29HAH1ffxVciNsH3rYXjNP2yM8wqmSm7jS20gM8TIklKiTen+1iVncw==", 11 | "dev": true 12 | }, 13 | "typescript": { 14 | "version": "4.1.3", 15 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.3.tgz", 16 | "integrity": "sha512-B3ZIOf1IKeH2ixgHhj6la6xdwR9QrLC5d1VKeCSY4tvkqhF2eqd9O7txNlS0PO3GrBAFIdr3L1ndNwteUbZLYg==" 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /typescript-node-ids/src/util.ts: -------------------------------------------------------------------------------- 1 | // import { Node, SourceFile } from 'typescript' 2 | // import * as ts from 'typescript' 3 | // import { Id } from './index' 4 | 5 | // export type Visitor = (node: Node, level: number, childIndex: number, parentNode: Node) => void 6 | 7 | // export function visit_forEachChild(node: Node, visitor: Visitor, file: SourceFile, level: number = 0, childIndex: number = 0) { 8 | // if (!node) { 9 | // return 10 | // } 11 | // visitor(node, level, childIndex, node.parent||file) 12 | // let index = 0 13 | // node.forEachChild(child => visit_forEachChild(child, visitor, file, level + 1, index++)) 14 | // } 15 | 16 | 17 | // export function getKindName(kind: ts.SyntaxKind) { 18 | // return (ts as any).SyntaxKind[kind]; 19 | // } -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/spec/tests/useVirtualFileSystemTypesIssue.1.ts: -------------------------------------------------------------------------------- 1 | import Project, { TypeGuards } from 'ts-morph'; 2 | 3 | const project1 = new Project({ 4 | useVirtualFileSystem: true 5 | }) 6 | const sourceFile = project1.createSourceFile('src/index.ts', `hello([[1,2]])`) 7 | const name1 = sourceFile.getDescendants().find(TypeGuards.isCallExpression).getArguments().map(p => p.getType().getText()).join(', ') 8 | console.log('name1: '+name1 ) 9 | 10 | const project2 = new Project({}) 11 | const sourceFile2 = project2.createSourceFile('src/index2.ts', `hello([[1,2]])`) 12 | const name2 = sourceFile2.getDescendants().find(TypeGuards.isCallExpression).getArguments().map(p => p.getType().getText()).join(', ') 13 | console.log('name2: '+name2 ) 14 | -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/spec/tests/useVirtualFileSystemTypesIssue.ts: -------------------------------------------------------------------------------- 1 | import Project, { TypeGuards } from 'ts-morph'; 2 | 3 | const project1 = new Project({ 4 | useVirtualFileSystem: true 5 | }) 6 | const sourceFile = project1.createSourceFile('src/index.ts', `hello([[1,2]])`) 7 | const name1 = sourceFile.getDescendants().find(TypeGuards.isCallExpression).getArguments().map(p => p.getType().getText()).join(', ') 8 | console.log('name1: '+name1 ) 9 | 10 | const project2 = new Project({}) 11 | const sourceFile2 = project2.createSourceFile('src/index2.ts', `hello([[1,2]])`) 12 | const name2 = sourceFile2.getDescendants().find(TypeGuards.isCallExpression).getArguments().map(p => p.getType().getText()).join(', ') 13 | console.log('name2: '+name2 ) 14 | -------------------------------------------------------------------------------- /ts-simple-ast-extra/spec/incubator/probes/tsmorphIssue.ts: -------------------------------------------------------------------------------- 1 | 2 | // const project = new Project() 3 | // const file = project.createSourceFile('f1.ts', 'var a = 1') 4 | // var n = file.getDescendants()[2] 5 | // if (n && !TypeGuards.isSemicolonToken(n)) { 6 | // var c = n.getKindName() 7 | // } 8 | 9 | 10 | // p.declaration.getType().getSymbol() -- often returns undefined - it should be in the types. 11 | 12 | 13 | // getStaticMethods, getStaticProperties, getInstanceMethods, getConstructors() they all support getJsDocs() but getInstanceProperties() don't and it should 14 | 15 | 16 | 17 | // const project = new Project() 18 | // const file = project.createSourceFile('f1.ts', 'f(()=>a())') 19 | // file.getDescendantStatements().forEach(s=>console.log(s.getText())) 20 | -------------------------------------------------------------------------------- /typescript-ast-util/spec/createProgramSpec.ts: -------------------------------------------------------------------------------- 1 | import { SyntaxKind } from "typescript"; 2 | import { createProgram, findChild } from "../src"; 3 | 4 | describe('createProgram', () => { 5 | it('should create parent nodes so findChild doesn\'t fail', () => { 6 | const program = createProgram([ 7 | { fileName: 'one.ts', content: 'const a:number = 1' }, 8 | { fileName: 'two.ts', content: 'class A{color: string="red"}' } 9 | ]) 10 | const one = findChild(program.getSourceFile('one.ts'), c => c.getText().includes('1')) 11 | expect(findChild(program.getSourceFile('one.ts'), c => c.getText().includes('= 1'))).toBeDefined() 12 | expect(findChild(program.getSourceFile('two.ts'), c => c.kind === SyntaxKind.ClassDeclaration)).toBeDefined() 13 | }) 14 | }) -------------------------------------------------------------------------------- /ts-simple-ast-extra/src/refactor/impl/moveToNewFile.ts: -------------------------------------------------------------------------------- 1 | import { Node, Project } from 'ts-morph' 2 | import { ApplyFileTextChangesResult, applyRefactorEditInfo } from '../../changes' 3 | 4 | export function moveToNewFile( 5 | project: Project, 6 | node: Node, 7 | removeEmpty: boolean = false 8 | ): ApplyFileTextChangesResult | undefined { 9 | const range = { pos: node.getStart(), end: node.getEnd() } 10 | const edits = project 11 | .getLanguageService() 12 | .compilerObject.getEditsForRefactor( 13 | node.getSourceFile().getFilePath(), 14 | {}, 15 | range, 16 | 'Move to a new file', 17 | 'Move to a new file', 18 | {} 19 | ) 20 | if (edits) { 21 | return applyRefactorEditInfo(project, edits, removeEmpty) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /typescript-ast-util/tests/scannertest1.ts: -------------------------------------------------------------------------------- 1 | import * as ts from 'typescript' 2 | 3 | const scanner = ts.createScanner(ts.ScriptTarget.Latest, true); 4 | function initializeState(text: string) { 5 | scanner.setText(text); 6 | scanner.setOnError((message: ts.DiagnosticMessage, length: number) => { 7 | console.log('Error: '+message); 8 | }); 9 | scanner.setScriptTarget(ts.ScriptTarget.ES5); 10 | scanner.setLanguageVariant(ts.LanguageVariant.Standard); 11 | } 12 | initializeState('var foo = 123;'.trim()); 13 | var token = scanner.scan(); 14 | while (token != ts.SyntaxKind.EndOfFileToken) { 15 | console.log( getKindName(token)); 16 | token = scanner.scan(); 17 | } 18 | 19 | export function getKindName(kind: ts.SyntaxKind) { 20 | return (ts).SyntaxKind[kind]; 21 | } -------------------------------------------------------------------------------- /typescript-plugin-ast-inspector/src/regex-groups-index.ts: -------------------------------------------------------------------------------- 1 | // // TODO: make it independent library 2 | 3 | // export function matchGlobalRegexWithGroupIndex(regex: RegExp, text: string): {value:string, start:number, end:number}[][] { 4 | // let result 5 | // let lastMatchIndex = 0 6 | // const matches = [] 7 | // while ((result = regex.exec(text))) { 8 | // const match = [] 9 | // lastMatchIndex = text.indexOf(result[0], lastMatchIndex) 10 | // let relIndex = 0 11 | // for (let i = 1; i < result.length; i++) { 12 | // relIndex = text.indexOf(result[i], relIndex) 13 | // match.push({ value: result[i], start: relIndex, end: relIndex + result[i].length }) 14 | // } 15 | // matches.push(match) 16 | // } 17 | // return matches 18 | // } 19 | 20 | -------------------------------------------------------------------------------- /typescript-plugin-extract-interface-client-project1/src/alone/variableRelatedFixesAloneText.ts: -------------------------------------------------------------------------------- 1 | // myCustomPi = 3.14; 2 | 3 | // const simpleVariable4 = 'lorem ipsum'; 4 | // simpleVariable4 = 'hello world'; 5 | 6 | // let treeMagic = 1; 7 | // let treeMagic = 's'; 8 | 9 | // function(n) { 10 | // return [...Array(n + 1).keys()] 11 | // .slice(1).reduce((acc, cur) => acc * cur, 1); 12 | // } 13 | 14 | // const underscore = require('underscore'), moment = require('moment'), 15 | // handlebars = require('handlebars'), gulp = require('gulp'); 16 | 17 | // const root1: { n: number } 18 | // const tree = buildTree(root1, { leaveCount: 50, depth: [98] }) 19 | 20 | // class Something12{ 21 | // readonly prop: number = 1 22 | // } 23 | // const s55 = new Something12() 24 | // s55.prop = 1; -------------------------------------------------------------------------------- /typescript-plugin-extract-interface-client-project1/src/evaltests/01-eval-comment-help.ts: -------------------------------------------------------------------------------- 1 | // internal note: install - vscode. 2 | 3 | // we will learn how to use the debug-eval-code plugin to evaluate code in the guest editor 4 | // to develop TypeScript language service plugins faster which is painful. Even for the most simple plugin it 5 | // implies reload tsserver, look at tsserver.log, find and interpret stacktraces, come back to host editor, 6 | // fix and try again... Would be because of this that there are so few TypeScript plugins? If so, let's hope 7 | // this eval thingy changes that... 8 | 9 | 10 | // select something like the variable name 'var1' and apply refactor "eval code in comments" 11 | const var1 = 123 12 | 13 | 14 | // internal note: explain what's happening and show an error -------------------------------------------------------------------------------- /typescript-plugin-move-declaration/assets/sampleProject1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "typescript-plugin-move-decl-sample1", 3 | "version": "1.0.0", 4 | "description": "testing ts related techologies", 5 | "main": "dist/src/index.js", 6 | "typings": "dist/src/index.d.ts", 7 | "scripts": { 8 | "test": "echo 1", 9 | "doc": "echo 1", 10 | "test-js": "echo 1", 11 | "watch": "tsc --watch", 12 | "build": "tsc" 13 | }, 14 | "keywords": [ 15 | "TypeScript", 16 | "TypeScript Language Service", 17 | "plugin" 18 | ], 19 | "author": "Sebastian Gurin", 20 | "license": "MIT", 21 | "dependencies": { 22 | "typescript": "2.9.1" 23 | }, 24 | "repository": "https://github.com/cancerberoSgx/typescript-plugins-of-mine/tree/master/typescript-ast-util" 25 | } 26 | -------------------------------------------------------------------------------- /typescript-plugin-move-declaration/assets/sampleProject2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "typescript-plugin-move-decl-sample2", 3 | "version": "1.0.0", 4 | "description": "testing ts related techologies", 5 | "main": "dist/src/index.js", 6 | "typings": "dist/src/index.d.ts", 7 | "scripts": { 8 | "test": "echo 1", 9 | "doc": "echo 1", 10 | "test-js": "echo 1", 11 | "watch": "tsc --watch", 12 | "build": "tsc" 13 | }, 14 | "keywords": [ 15 | "TypeScript", 16 | "TypeScript Language Service", 17 | "plugin" 18 | ], 19 | "author": "Sebastian Gurin", 20 | "license": "MIT", 21 | "dependencies": { 22 | "typescript": "2.9.1" 23 | }, 24 | "repository": "https://github.com/cancerberoSgx/typescript-plugins-of-mine/tree/master/typescript-ast-util" 25 | } 26 | -------------------------------------------------------------------------------- /typescript-plugin-method-delegate/assets/sampleProject1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "typescript-plugin-methodDelegate-sample1", 3 | "version": "1.0.0", 4 | "description": "testing ts related techologies", 5 | "main": "dist/src/index.js", 6 | "typings": "dist/src/index.d.ts", 7 | "scripts": { 8 | "test": "echo 1", 9 | "doc": "echo 1", 10 | "test-js": "echo 1", 11 | "watch": "tsc --watch", 12 | "build": "tsc" 13 | }, 14 | "keywords": [ 15 | "TypeScript", 16 | "TypeScript Language Service", 17 | "plugin" 18 | ], 19 | "author": "Sebastian Gurin", 20 | "license": "MIT", 21 | "dependencies": { 22 | "typescript": "2.9.1" 23 | }, 24 | "repository": "https://github.com/cancerberoSgx/typescript-plugins-of-mine/tree/master/typescript-ast-util" 25 | } 26 | -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/spec/implementInterfaceMemberSpec.ts: -------------------------------------------------------------------------------- 1 | const code = `interface SomeInterface { 2 | prop1: { s: string, n: Date }[] 3 | } 4 | class Class2 implements SomeInterface { 5 | prop1: boolean[] 6 | }` 7 | import { basicTest, defaultAfterEach, defaultBeforeEach, DefaultBeforeEachResult } from './testUtil' 8 | 9 | describe('implementInterfaceMember', () => { 10 | let config: DefaultBeforeEachResult 11 | beforeEach(() => { 12 | config = defaultBeforeEach({ createNewFile: code }) 13 | }) 14 | it('fix member', async () => { 15 | basicTest(code.indexOf('prop1: boolean[]')+1, config, 'implementInterfaceMember', [`class Class2 implements SomeInterface { prop1: { s: string; n: Date; }[] }`]) 16 | }) 17 | afterEach(() => { 18 | defaultAfterEach(config) 19 | }) 20 | }) 21 | -------------------------------------------------------------------------------- /ts-simple-ast-extra/src/refactor/impl/convertParamsToDestructuredObject.ts: -------------------------------------------------------------------------------- 1 | import { ParameteredNode, UserPreferences } from 'ts-morph' 2 | import { RefactorFormatBaseOptions } from './format' 3 | 4 | export interface ConvertParamsToDestructuredObjectOptions extends RefactorFormatBaseOptions, Partial { 5 | node: ParameteredNode 6 | } 7 | 8 | export function convertParamsToDestructuredObject(o: ConvertParamsToDestructuredObjectOptions) { 9 | const params = o.node.getParameters() 10 | if (params.length === 0) 11 | return 12 | const edits = o.project.getLanguageService().getEditsForRefactor(o.file.getFilePath(), {}, params[0], 13 | 'Convert parameters to destructured object', 'Convert parameters to destructured object', o) 14 | if (edits) 15 | edits.applyChanges({ overwrite: true }) 16 | } 17 | -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/spec/tests/addMemberGetStartIssue.ts: -------------------------------------------------------------------------------- 1 | // not an issue - just use getFullStart, getFullWidth, etc 2 | 3 | import Project, { TypeGuards } from 'ts-morph'; 4 | 5 | const project1 = new Project({ 6 | useVirtualFileSystem: true 7 | }) 8 | const sourceFile = project1.createSourceFile('src/index.ts', ` 9 | class A{ 10 | 11 | } 12 | 13 | `) 14 | const decl = sourceFile.getClass('A') 15 | const constr1 = decl.addConstructor({ 16 | parameters: [{name: 'foo', type: 'number'}] 17 | }) 18 | 19 | const construcText = sourceFile.getText().substring(constr1.getFullStart(), constr1.getEnd()) 20 | console.log(construcText); 21 | console.log(constr1.getText()); 22 | 23 | // console.log(sourceFile.getText().length); 24 | 25 | // class A{ 26 | // constructor(foo: number) { 27 | // } 28 | // } 29 | -------------------------------------------------------------------------------- /typescript-plugin-extract-interface-client-project1/src/tests/declareClass.ts: -------------------------------------------------------------------------------- 1 | interface FNResult { 2 | /** 3 | * TODO: Document me 4 | */ 5 | a: number; 6 | /** 7 | * TODO: Document me 8 | */ 9 | b: string[]; 10 | } 11 | 12 | 13 | function fn(): FNResult { 14 | return {a: 1, b: ''.split('')} 15 | } 16 | 17 | // &%&% moveDeclarationNamed('CCC', '../other/file.ts') 18 | 19 | new CCC().fooo([1]) 20 | 21 | const fffo = {bar: 1} 22 | const val: string[] = fffo.bar123123(1, ['w'], true) 23 | const f: boolean = fffo.bar 24 | 25 | const variableString1 = 'hello world1' 26 | const variableString2 = "hello world2" 27 | 28 | 29 | 30 | const ii: Number = 0, c: String = 's', arr: boolean[] = [] 31 | 32 | import { obj1 } from './constToVar'; 33 | obj1.foo(1) 34 | const obj2 = {} 35 | obj2.bar 36 | 37 | 38 | -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/spec/declareReturnTypeSpec.ts: -------------------------------------------------------------------------------- 1 | 2 | import { declareReturnType } from '../src/code-fix/declareReturnType'; 3 | import { removeWhiteSpaces, testCodeFixRefactorEditInfo } from './testUtil'; 4 | 5 | describe('declareReturnType', () => { 6 | it('basic', async () => { 7 | const code = ` 8 | function fn(): FNResult { 9 | return { a: 1, b: 's', log: (msg) => msg+'', kill: function () { return 1 } } 10 | } 11 | ` 12 | const cursorPosition = code.indexOf('FNResult') + 1 13 | const result = testCodeFixRefactorEditInfo(code, cursorPosition, declareReturnType.name) 14 | const s = removeWhiteSpaces(result.edits[0].textChanges[0].newText, ' ') 15 | expect(s).toContain(`interface FNResult { a: number; b: string; log(msg: any): string; kill(): number; }`) 16 | }) 17 | }) -------------------------------------------------------------------------------- /typescript-plugin-extract-interface-client-project1/src/alone/reorderParamAlone.ts: -------------------------------------------------------------------------------- 1 | function foo32(n: number, date1: Date[][]): Promise { 2 | return Promise.resolve(true) 3 | } 4 | function bar15(helpers: Interface17[] | undefined, air: Wind41, n: RegExp, 5 | a: number[]): Promise { 6 | return Promise.resolve(true) 7 | } 8 | interface Interface17 { 9 | method2: (b: Date[], a: number, c: boolean) => string // autocomplete needs to be INSIDE 10 | } 11 | const obj45: Interface17 = { 12 | method2(b: Date[], a: number, c: boolean): string { 13 | return '' 14 | } 15 | } 16 | class Wind41 { 17 | blow(d: Date, b: boolean[][], a: number): number[] { 18 | /* &%&% reorderParams("blow", [2, 1, 0]) */ 19 | 20 | return [] 21 | } 22 | } 23 | const result78 = new Wind41().blow(new Date(), [[true]], 3.14) -------------------------------------------------------------------------------- /vscode-typescript-refactors/src/test/extension.test.ts: -------------------------------------------------------------------------------- 1 | // 2 | // Note: This example test is leveraging the Mocha test framework. 3 | // Please refer to their documentation on https://mochajs.org/ for help. 4 | // 5 | 6 | // The module 'assert' provides assertion methods from node 7 | import * as assert from 'assert'; 8 | 9 | // You can import and use all API from the 'vscode' module 10 | // as well as import your extension to test it 11 | // import * as vscode from 'vscode'; 12 | // import * as myExtension from '../extension'; 13 | 14 | // Defines a Mocha test suite to group tests of similar kind together 15 | suite("Extension Tests", function () { 16 | 17 | // Defines a Mocha unit test 18 | test("Something 1", function() { 19 | assert.equal(-1, [1, 2, 3].indexOf(5)); 20 | assert.equal(-1, [1, 2, 3].indexOf(0)); 21 | }); 22 | }); -------------------------------------------------------------------------------- /sample-ts-plugin1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sample-ts-plugin1", 3 | "version": "1.0.12", 4 | "description": "https://github.com/Microsoft/TypeScript/wiki/Writing-a-Language-Service-Plugin", 5 | "main": "dist/index.js", 6 | "private": true, 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 0", 9 | "build": "tsc", 10 | "doc": "docco -o ../docs/sample-ts-plugin1 src/index.ts && cp doc-assets/plugin-screencast.gif ../docs/sample-ts-plugin1" 11 | }, 12 | "keywords": [ 13 | "TypeScript", 14 | "TypeScript plugin tutorial", 15 | "TypeScript Language Service", 16 | "tutorial", 17 | "example" 18 | ], 19 | "author": "Sebastián Gurin", 20 | "license": "MIT", 21 | "dependencies": { 22 | "typescript": "^3.1.4" 23 | }, 24 | "devDependencies": { 25 | "docco": "^0.8.0" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ts-run/src/file.ts: -------------------------------------------------------------------------------- 1 | import { basename } from 'misc-utils-of-mine-generic' 2 | import { load } from './loadFile' 3 | import { File } from './types' 4 | 5 | export class ContentFile implements File { 6 | constructor(protected filePath: string, protected content: string) {} 7 | getFilePath() { 8 | return this.filePath 9 | } 10 | async getContent() { 11 | return this.content 12 | } 13 | } 14 | 15 | export class RemoteFile implements File { 16 | getContentPromise: any 17 | constructor(protected url: string, protected filePath: string = basename(url)) {} 18 | getFilePath() { 19 | return this.filePath 20 | } 21 | async getContent() { 22 | if (!this.getContentPromise) { 23 | this.getContentPromise = load(this.url) 24 | } 25 | const response = await this.getContentPromise 26 | return response.data 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /typescript-plugin-extract-interface-client-project1/src/tests/declareMember.ts: -------------------------------------------------------------------------------- 1 | 2 | const o = { 3 | foo: () => { return 1 } 4 | } 5 | 6 | const val: string[] = o.bar(1, ['w'], true) 7 | 8 | interface Hello { 9 | foo():void, 10 | world(arg0: number[][]): any; 11 | 12 | } 13 | const hello: Hello = { 14 | 15 | } 16 | let i: string[] 17 | i = hello.world([[1, 2, 3], [4, 5]]) 18 | const k = hello.mama(1, 2, 3) + ' how are you?' 19 | function f(h: Hello) { 20 | h.fromFunc = true 21 | } 22 | var x: Date = new Date(hello.timeWhen('born')) 23 | class C { 24 | foof: number; 25 | hello: Hello 26 | m(s: number[]) { this.hello.grasp(s, [false, true]) } 27 | } 28 | const notDefined: C 29 | const a = notDefined.foof + 9 30 | 31 | 32 | import {II, CC} from './constToVar' 33 | 34 | const o2: II = { 35 | foo: 5 36 | } 37 | 38 | const ccc = new CC() 39 | ccc.a( ) -------------------------------------------------------------------------------- /input-ui-ipc-provider-test-vscode-extension/src/test/extension.test.ts: -------------------------------------------------------------------------------- 1 | // 2 | // Note: This example test is leveraging the Mocha test framework. 3 | // Please refer to their documentation on https://mochajs.org/ for help. 4 | // 5 | 6 | // The module 'assert' provides assertion methods from node 7 | import * as assert from 'assert'; 8 | 9 | // You can import and use all API from the 'vscode' module 10 | // as well as import your extension to test it 11 | // import * as vscode from 'vscode'; 12 | // import * as myExtension from '../extension'; 13 | 14 | // Defines a Mocha test suite to group tests of similar kind together 15 | suite("Extension Tests", function () { 16 | 17 | // Defines a Mocha unit test 18 | test("Something 1", function() { 19 | assert.equal(-1, [1, 2, 3].indexOf(5)); 20 | assert.equal(-1, [1, 2, 3].indexOf(0)); 21 | }); 22 | }); -------------------------------------------------------------------------------- /ts-run/api/modules/_getcompileroptions_.md: -------------------------------------------------------------------------------- 1 | [ts-run](../README.md) > ["getCompilerOptions"](../modules/_getcompileroptions_.md) 2 | 3 | # External module: "getCompilerOptions" 4 | 5 | ## Index 6 | 7 | ### Functions 8 | 9 | * [getCompilerOptions](_getcompileroptions_.md#getcompileroptions) 10 | 11 | --- 12 | 13 | ## Functions 14 | 15 | 16 | 17 | ### getCompilerOptions 18 | 19 | ▸ **getCompilerOptions**(f: *[File](../interfaces/_types_.file.md)*): `Promise`<`CompilerOptions`> 20 | 21 | *Defined in [getCompilerOptions.ts:6](https://github.com/cancerberoSgx/typescript-plugins-of-mine/blob/d827319/ts-run/src/getCompilerOptions.ts#L6)* 22 | 23 | **Parameters:** 24 | 25 | | Name | Type | 26 | | ------ | ------ | 27 | | f | [File](../interfaces/_types_.file.md) | 28 | 29 | **Returns:** `Promise`<`CompilerOptions`> 30 | 31 | ___ 32 | 33 | -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/spec/stringChangeQuoteCharSpec.ts: -------------------------------------------------------------------------------- 1 | const code = ` 2 | const variableString1 = 'hello world1' 3 | const variableString2 = "hello world2" 4 | ` 5 | import { stringChangeQuoteChar } from '../src/code-fix/stringChangeQuoteChar'; 6 | import { testCodeFixRefactorEditInfo } from './testUtil'; 7 | describe('stringChangeQuoteChar', () => { 8 | it('simple2double', async () => { 9 | const result = testCodeFixRefactorEditInfo(code, code.indexOf(`'hello world1'`)+1, stringChangeQuoteChar.name) 10 | expect(result.edits[0].textChanges[0].newText).toBe('"hello world1"') 11 | }) 12 | it('double2simple', async () => { 13 | const result = testCodeFixRefactorEditInfo(code, code.indexOf(`"hello world2"`)+1, stringChangeQuoteChar.name) 14 | expect(result.edits[0].textChanges[0].newText).toBe(`'hello world2'`) 15 | }) 16 | }) 17 | 18 | -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/spec/memberChangeScopeSpec.ts: -------------------------------------------------------------------------------- 1 | const code = `class A { 2 | private method(a: number):Date[]{ 3 | return [new Date()] 4 | } 5 | } 6 | const a = new A() 7 | new A().method(1) 8 | a.method(2)` 9 | import { basicTest, defaultAfterEach, defaultBeforeEach, DefaultBeforeEachResult } from './testUtil' 10 | 11 | describe('memberChangeScope', () => { 12 | let config: DefaultBeforeEachResult 13 | beforeEach(() => { 14 | config = defaultBeforeEach({ createNewFile: code }) 15 | }) 16 | it('from new expression member access', async () => { 17 | basicTest(105, config, 'memberChangeScope', [`public method(`]) 18 | }) 19 | it('from variable member access', async () => { 20 | basicTest(116, config, 'memberChangeScope', [`public method(`]) 21 | }) 22 | afterEach(() => { 23 | defaultAfterEach(config) 24 | }) 25 | }) 26 | -------------------------------------------------------------------------------- /sample-ts-plugin1-sample-project/src/test1.ts: -------------------------------------------------------------------------------- 1 | import { EventEmitter } from "events"; 2 | 3 | class Banana { 4 | callee = 1 5 | caller = 2 6 | getDay() { } 7 | thisIsTheOnlyThatWillAutoComplete = 99 8 | } 9 | const banana = new Banana() 10 | // banana.thisIsTheOnlyThatWillAutoComplete 11 | /* 12 | first we show that autocomplete in banana filter some 13 | members like callee, caller and getDay 14 | 15 | Second, we show that when we select the class identifier 16 | 'banana' our refactor is suggested and it works, but 17 | when we select other identifiers the suggestion is not 18 | shown 19 | */ 20 | 21 | 22 | function target(emitter: EventEmitter){ 23 | emitter.on('foo', ()=>{}) 24 | } 25 | let f = function f(){} 26 | const casted = Object.assign(f.prototype, EventEmitter.prototype) as EventEmitter 27 | //now we now is an EventEmitter - we cast 28 | target(casted); 29 | -------------------------------------------------------------------------------- /typescript-plugin-extract-interface-client-project1/src/tests/constToVar.ts: -------------------------------------------------------------------------------- 1 | var a = 1 2 | function foo33(a: string[][], b: {o: {u: Date[]}}, c: number=4) : string { 3 | return a.length+''+b+c+'' 4 | } 5 | 6 | 7 | foo3asas2(1,2,3) 8 | 9 | let uiu=new UY() 10 | 11 | let uuu: SSSSS = {} 12 | function AAS(){ 13 | new IIJIIJ() 14 | } 15 | // function foo33(a: string[][], b: {o: {u: Date[]}}, c: number=4) : string { 16 | // return a.length+''+b+c+'' 17 | // } 18 | const y = 9 19 | // const reDeclared123 = 1 20 | 21 | // function (){ 22 | 23 | // reDeclared123 =99 24 | // } 25 | 26 | // var a = 1 27 | 28 | function fasdoo33(a: string[][], b: {o: {u: Date[]}}, c: number=4) : string { 29 | return a.length+''+b+c+'' 30 | } 31 | 32 | export const obj1 = {a: 1} 33 | 34 | export interface II {a: number} 35 | export class CC {a(){}} 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /ts-simple-ast-extra/src/path.ts: -------------------------------------------------------------------------------- 1 | import { getRelativePath as relative, pathJoin } from 'misc-utils-of-mine-generic' 2 | import { Project } from 'ts-morph' 3 | 4 | export function getBasePath(project: Project) { 5 | const rootDir = project.getRootDirectories()[0] 6 | return rootDir.getPath() 7 | } 8 | 9 | export function getAbsolutePath(relativePath: string, project: Project) { 10 | return pathJoin(getBasePath(project), relativePath).replace(/\\/g, '/') 11 | } 12 | 13 | export function getRelativePath(path: string, project: Project) { 14 | return relative(getBasePath(project), getAbsolutePath(path, project)) 15 | } 16 | 17 | export function getFileFromRelativePath(path: string, project: Project) { 18 | const rootDir = project.getRootDirectories()[0] 19 | path = path.startsWith('./') ? path.substring(2) : path 20 | return rootDir.getDirectory(path) || rootDir.getSourceFile(path) 21 | } 22 | -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/assets/sampleProject1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "typescript-plugin-methodDelegate-sample1", 3 | "version": "1.0.0", 4 | "description": "testing ts related techologies", 5 | "main": "dist/src/index.js", 6 | "typings": "dist/src/index.d.ts", 7 | "scripts": { 8 | "test": "echo 1", 9 | "doc": "echo 1", 10 | "test-js": "echo 1", 11 | "watch": "tsc --watch", 12 | "build": "tsc" 13 | }, 14 | "keywords": [ 15 | "TypeScript", 16 | "TypeScript Language Service", 17 | "plugin" 18 | ], 19 | "author": "Sebastian Gurin", 20 | "license": "MIT", 21 | "dependencies": { 22 | "typescript": "2.9.1" 23 | }, 24 | "devDependencies": { 25 | "typescript-plugin-proactive-code-fixes": "file:../.." 26 | }, 27 | "repository": "https://github.com/cancerberoSgx/typescript-plugins-of-mine/tree/master/typescript-ast-util" 28 | } 29 | -------------------------------------------------------------------------------- /input-ui-ipc-provider/src/consumerInstance.ts: -------------------------------------------------------------------------------- 1 | //why ? we need one consumer because right now is the server and we have only one provider (in the editor) - we cannot instantiate more than one consumers because of addrinuse 2 | //TODO: probably we want to have the server in the editor (provider) so one or more plugins can consume 3 | 4 | import { createConsumer, InputConsumerConfig, InputConsumer } from './consumer'; 5 | 6 | let inputConsumer: InputConsumer 7 | 8 | export function getInputConsumer(): InputConsumer{ 9 | if(!inputConsumer){ 10 | inputConsumer = createConsumer(getConsumerConfig()) 11 | } 12 | return inputConsumer 13 | } 14 | 15 | function getConsumerConfig(){ 16 | return {log, port: 3001} 17 | } 18 | 19 | let log = console.log 20 | export function setLogger(logger: (msg: string) => void){ 21 | if(inputConsumer){ 22 | inputConsumer.setLogger(logger) 23 | } 24 | log = logger 25 | } -------------------------------------------------------------------------------- /ts-simple-ast-extra/spec/refactors/moveToNewFileSpec.ts: -------------------------------------------------------------------------------- 1 | import { Project } from 'ts-morph' 2 | import { moveToNewFile } from '../../src' 3 | 4 | describe('moveToNewFile', () => { 5 | it('should move declaration to new file', () => { 6 | const project = new Project() 7 | const code = ` 8 | export class Class1 {} 9 | const c = new Class1() 10 | ` 11 | const f = project.createSourceFile('f1.ts', code) 12 | 13 | const result = moveToNewFile(project, f.getClass('Class1')!) 14 | 15 | expect(f.getText()).not.toContain('class Class1') 16 | expect(f.getText()).toContain('import { Class1 } from "./Class1";') 17 | const newFile = project.getSourceFile('Class1.ts') 18 | expect(newFile!.getText()).toContain('export class Class1') 19 | 20 | expect(result!.created[0].getBaseName()).toBe('Class1.ts') 21 | expect(result!.modified[0].getBaseName()).toBe('f1.ts') 22 | }) 23 | }) 24 | -------------------------------------------------------------------------------- /vscode-typescript-refactors/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es6", 5 | "outDir": "out", 6 | "lib": [ 7 | "es6" 8 | ], 9 | "sourceMap": true, 10 | "rootDir": "src", 11 | /* Strict Type-Checking Option */ 12 | "strict": true, /* enable all strict type-checking options */ 13 | /* Additional Checks */ 14 | "noUnusedLocals": true /* Report errors on unused locals. */ 15 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ 16 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ 17 | // "noUnusedParameters": true, /* Report errors on unused parameters. */ 18 | }, 19 | "exclude": [ 20 | "node_modules", 21 | ".vscode-test" 22 | ] 23 | } -------------------------------------------------------------------------------- /ts-simple-ast-extra/src/refactor/index.ts: -------------------------------------------------------------------------------- 1 | export * from './impl/arrowBraces' 2 | export * from './impl/convertImports' 3 | export * from './impl/convertParamsToDestructuredObject' 4 | export * from './impl/declareVariable' 5 | export * from './impl/emptyLines' 6 | export * from './impl/extractInterface' 7 | export { format, formatOnly, FormatOptions, formatString, FormatStringOptions, setupProjectManipulationSettings } from './impl/format' 8 | export * from './impl/formatJsdocs' 9 | export * from './impl/moveDeclaration' 10 | export * from './impl/moveToNewFile' 11 | export * from './impl/organizeImports' 12 | export * from './impl/quotes' 13 | export * from './impl/refactors' 14 | export * from './impl/removeAllUnused' 15 | export * from './impl/splitVariableDeclaration' 16 | export * from './impl/stringConcatenationToTemplate' 17 | export * from './impl/templateToStringConcatenation' 18 | export * from './impl/trailingSemicolons' 19 | -------------------------------------------------------------------------------- /input-ui-ipc-provider-test-vscode-extension/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es6", 5 | "outDir": "out", 6 | "lib": [ 7 | "es6" 8 | ], 9 | "sourceMap": true, 10 | "rootDir": "src", 11 | /* Strict Type-Checking Option */ 12 | "strict": true, /* enable all strict type-checking options */ 13 | /* Additional Checks */ 14 | "noUnusedLocals": true /* Report errors on unused locals. */ 15 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ 16 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ 17 | // "noUnusedParameters": true, /* Report errors on unused parameters. */ 18 | }, 19 | "exclude": [ 20 | "node_modules", 21 | ".vscode-test" 22 | ] 23 | } -------------------------------------------------------------------------------- /ts-simple-ast-extra/spec/incubator/probes/toJson.ts: -------------------------------------------------------------------------------- 1 | import { indent } from 'misc-utils-of-mine-generic' 2 | import { Project, ts } from 'ts-morph' 3 | 4 | // function test() { 5 | const p = new Project({ 6 | tsConfigFilePath: 'spec/assets/projectSample1/tsconfig.json', 7 | addFilesFromTsConfig: true 8 | }) 9 | // // expectNoErrors(p) 10 | const f1 = p.getSourceFileOrThrow('Unit.ts') 11 | // const f2 = p.getSourceFileOrThrow('Thing.ts') 12 | // const c = f1.getInterfaceOrThrow('Unit') 13 | // 14 | // debugger 15 | 16 | // console.log((c.compilerNode! as any).ast) 17 | // } 18 | 19 | // test() 20 | 21 | const navTree = p.getLanguageService().compilerObject.getNavigationTree(f1.getFilePath()) 22 | function print(n: ts.NavigationTree, level = 0) { 23 | console.log(indent(level), n.text, n.kind, n.kindModifiers) 24 | ; (n.childItems || []).forEach(c => print(c, level + 1)) 25 | } 26 | print(navTree) 27 | // console.log(); 28 | -------------------------------------------------------------------------------- /typescript-plugin-extract-interface-client-project1/src/alone/declareMissingMember.ts: -------------------------------------------------------------------------------- 1 | // const myCustomFoo = { 2 | // foo: () => { return 1 } 3 | // } 4 | // const val66: string[] = myCustomFoo.bar(1, ['w'], true) // declare missing member to an object literal 5 | // interface Hello { } 6 | // const hello54: Hello = {} 7 | // let counter113: string[] = hello.world([[1, 2, 3], [4, 5]]) // declare missing member to instance's interface 8 | // const k413 = hello.mama(1, 2, 3) + ' how are you?' // same as before - notice inferred return type 9 | // function f(h: Hello) { 10 | // h.fromFunc = true // same as before - instance is parameter 11 | // } 12 | // var x: Date = new Date(hello.timeWhen('born')) // same as before - notice inferred return type 13 | // class C445LLJ { 14 | // hello: Hello 15 | // m(s: number[]) { return this.hello.grasp(s, [false, true]) } // same as before - instance is property accessor 16 | // } 17 | // new C().non() -------------------------------------------------------------------------------- /typescript-plugin-subclasses-of/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "typescript-plugin-subclasses-of", 3 | "version": "1.0.5", 4 | "description": "TypeScript Language Service plugin that shows what are all the sub classes (direct or indirect) a class have. The same for interfaces. ", 5 | "main": "dist/index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 0", 8 | "build": "tsc", 9 | "prepare": "npm run build", 10 | "doc": "exit 0" 11 | }, 12 | "keywords": [ 13 | "TypeScript", 14 | "TypeScript Language Service", 15 | "plugin" 16 | ], 17 | "author": "Sebastian Gurin", 18 | "license": "MIT", 19 | "dependencies": { 20 | "typescript": "2.9.1", 21 | "typescript-ast-util": "file:../typescript-ast-util" 22 | }, 23 | "devDependencies": {}, 24 | "repository": "https://github.com/cancerberoSgx/typescript-plugins-of-mine/tree/master/typescript-ast-util", 25 | "readme": "README.md" 26 | } 27 | -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/src/code-fix/organizeImportsAndFormat.ts: -------------------------------------------------------------------------------- 1 | import * as ts from 'typescript'; 2 | import { CodeFix, CodeFixOptions } from '../codeFixes'; 3 | 4 | /** 5 | # Description 6 | 7 | This will execute organize imports and fomat the source file in a single call 8 | 9 | # TODO 10 | 11 | 12 | */ 13 | 14 | export const organizeImportsAndFormat: CodeFix = { 15 | 16 | name: 'organizeImportsAndFormat', 17 | 18 | config: { 19 | }, 20 | 21 | predicate: (options: CodeFixOptions): boolean => { 22 | return true 23 | }, 24 | 25 | description: (options: CodeFixOptions): string => `Organize Imports and Format Document`, 26 | 27 | apply: (options: CodeFixOptions) => { 28 | if (!options.positionOrRange || (options.positionOrRange as ts.TextRange).pos === undefined) { 29 | return 30 | } 31 | options.simpleNode.getSourceFile().organizeImports() 32 | options.simpleNode.getSourceFile().formatText() 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /ts-simple-ast-extra/spec/refactors/quoteSpec.ts: -------------------------------------------------------------------------------- 1 | import { Project } from 'ts-morph' 2 | import { quotes } from '../../src/refactor' 3 | import { expectEqualsAndDiff, expectNoErrors } from '../testUtil' 4 | 5 | describe('should change strings in templates, and change only spaces', () => { 6 | it('simple all', () => { 7 | const project = new Project() 8 | const code = ` 9 | var a='', 10 | b="", 11 | c:["", 12 | ''], 13 | d={x:'', 14 | y:"asda", 15 | z: \`asd""''\${'asdas'}asd""''\${"askljdh"}\` 16 | } `.trim() 17 | const expected = ` 18 | var a='', 19 | b='', 20 | c:['', 21 | ''], 22 | d={x:'', 23 | y:'asda', 24 | z: \`asd""''\${'asdas'}asd""''\${'askljdh'}\` 25 | }`.trim() 26 | const file = project.createSourceFile('f1.ts', code) 27 | expectNoErrors(project) 28 | quotes({ file, project, quotePreference: 'single' }) 29 | expectEqualsAndDiff(file.getFullText().trim(), expected) 30 | expectNoErrors(project) 31 | }) 32 | }) 33 | -------------------------------------------------------------------------------- /typescript-plugin-postfix/src/postfixHome.ts: -------------------------------------------------------------------------------- 1 | import { Postfix } from "./types"; 2 | import { DeclareVariablePostFix, DeclareVariablePostfixConfig } from "./declareVariablePostfix"; 3 | import * as ts from 'typescript' 4 | import { ConsolePostfixConfig, ConsolePostFix } from './consolePostfix'; 5 | 6 | 7 | const allPostfix : Postfix[]= [ 8 | new DeclareVariablePostFix( new DeclareVariablePostfixConfig('declare let variable', 'let')), 9 | new DeclareVariablePostFix( new DeclareVariablePostfixConfig('declare const variable', 'const')), 10 | new DeclareVariablePostFix( new DeclareVariablePostfixConfig('declare var variable', 'var')), 11 | new ConsolePostFix(new ConsolePostfixConfig('wrap with console.log', 'log')), 12 | new ConsolePostFix(new ConsolePostfixConfig('wrap with console.error', 'error')), 13 | new ConsolePostFix(new ConsolePostfixConfig('wrap with console.warn', 'warn')), 14 | ] 15 | 16 | export function getAllPostfix(): Postfix[] { 17 | return allPostfix 18 | } -------------------------------------------------------------------------------- /discontinued.md: -------------------------------------------------------------------------------- 1 | **Discontinued / Research** 2 | 3 | I'm not currently working on this anymore. In the reality I tried to each my own shit in vscode and was a pain. I don't think it even work since many versions have passed. 4 | 5 | I would LOVE to see someone working on improving this. These kind of tools could make the difference for a programmer. Writhing code could be ugly if you posses a disability like being drunk or high. 6 | 7 | So feel free to retake this if you like. 8 | 9 | Also I would love to see more documentation regarding this topic, with more variable list of examples like this project contains. I hope it helps for education purposes at least. 10 | 11 | Finally I would like to see this working on mono repos (moving a types.ts file from one project to another without having `export * `on the first one 12 | 13 | I see this is being tackled by TypeScript team gradually, I just wanted to see this right now. 14 | 15 | That was my "dear reyes magos" letter :) 16 | 17 | -- 18 | -------------------------------------------------------------------------------- /typescript-plugin-move-declaration/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "node", 9 | "request": "launch", 10 | "protocol": "inspector", 11 | "name": "moveDeclarationSpec", 12 | "preLaunchTask": "build", 13 | "args": [ 14 | "--config=spec/support/jasmine-js.json", 15 | "**/moveDeclarationSpec.js" 16 | ], 17 | "runtimeArgs": [ 18 | "--inspect", 19 | "--debug-brk", 20 | ], 21 | "cwd": "${workspaceFolder}/", 22 | "program": "${workspaceFolder}/node_modules/jasmine/bin/jasmine", 23 | "sourceMaps": true 24 | }, 25 | ] 26 | } -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "node", 9 | "request": "launch", 10 | "protocol": "inspector", 11 | "name": "moveDeclarationSpec", 12 | "preLaunchTask": "build", 13 | "args": [ 14 | "--config=spec/support/jasmine-js.json", 15 | "**/moveDeclarationSpec.js" 16 | ], 17 | "runtimeArgs": [ 18 | "--inspect", 19 | "--debug-brk", 20 | ], 21 | "cwd": "${workspaceFolder}/", 22 | "program": "${workspaceFolder}/node_modules/jasmine/bin/jasmine", 23 | "sourceMaps": true 24 | }, 25 | ] 26 | } -------------------------------------------------------------------------------- /typescript-plugin-extract-interface/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "typescript-plugin-extract-interface", 3 | "version": "1.0.6", 4 | "description": "TypeScript Language Service plugin to extract an interface from a class", 5 | "main": "dist/index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 0", 8 | "build": "tsc", 9 | "prepare": "npm run build", 10 | "doc": "exit 0" 11 | }, 12 | "keywords": [ 13 | "TypeScript", 14 | "TypeScript Language Service", 15 | "plugin", 16 | "extract interface" 17 | ], 18 | "author": "Sebastian Gurin", 19 | "license": "MIT", 20 | "dependencies": { 21 | "hrtime-now": "^1.0.5", 22 | "shelljs": "^0.8.2", 23 | "typescript": "2.9.1", 24 | "typescript-ast-util": "file:../typescript-ast-util" 25 | }, 26 | "devDependencies": {}, 27 | "repository": "https://github.com/cancerberoSgx/typescript-plugins-of-mine/tree/master/typescript-plugin-extract-interface", 28 | "readme": "README.md" 29 | } 30 | -------------------------------------------------------------------------------- /input-ui-ipc-provider-vscode/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es6", 5 | "outDir": "dist", 6 | "lib": [ 7 | "es6" 8 | ], 9 | "declaration": true, 10 | "sourceMap": true, 11 | "rootDir": "src", 12 | /* Strict Type-Checking Option */ 13 | "strict": true, /* enable all strict type-checking options */ 14 | /* Additional Checks */ 15 | "noUnusedLocals": true /* Report errors on unused locals. */ 16 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ 17 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ 18 | // "noUnusedParameters": true, /* Report errors on unused parameters. */ 19 | }, 20 | "include": ["src/**/*ts"], 21 | "exclude": [ 22 | "node_modules", 23 | ".vscode-test", 24 | "dist" 25 | ] 26 | } -------------------------------------------------------------------------------- /ts-run/api/modules/_run_.md: -------------------------------------------------------------------------------- 1 | [ts-run](../README.md) > ["run"](../modules/_run_.md) 2 | 3 | # External module: "run" 4 | 5 | ## Index 6 | 7 | ### Functions 8 | 9 | * [run](_run_.md#run) 10 | 11 | --- 12 | 13 | ## Functions 14 | 15 | 16 | 17 | ### run 18 | 19 | ▸ **run**(options: *[TsRunOptions](../interfaces/_types_.tsrunoptions.md)*): `Promise`<[TsRunResult](../interfaces/_types_.tsrunresult.md)> 20 | 21 | *Defined in [run.ts:13](https://github.com/cancerberoSgx/typescript-plugins-of-mine/blob/d827319/ts-run/src/run.ts#L13)* 22 | 23 | run a ts-morph project without writing to FS (be able to run ts in the browser) 24 | 25 | TODO: if in a second run the config is the same, reuse the project, remove all .ts files and add new ones - reuse libs 26 | 27 | **Parameters:** 28 | 29 | | Name | Type | 30 | | ------ | ------ | 31 | | options | [TsRunOptions](../interfaces/_types_.tsrunoptions.md) | 32 | 33 | **Returns:** `Promise`<[TsRunResult](../interfaces/_types_.tsrunresult.md)> 34 | 35 | ___ 36 | 37 | -------------------------------------------------------------------------------- /ts-simple-ast-extra/spec/refactors/emptyLinesSpec.ts: -------------------------------------------------------------------------------- 1 | import { Project } from 'ts-morph' 2 | import { emptyLines } from '../../src' 3 | import { expectEqualsAndDiff, expectNoErrors } from '../testUtil' 4 | 5 | describe('should remove empty lines if consecutive', () => { 6 | it('simple all', () => { 7 | const project = new Project() 8 | const code = ` 9 | /** 10 | hello 11 | 12 | ff 13 | 14 | 15 | ss 16 | 17 | 18 | */ 19 | 20 | 21 | export var a = 1 22 | 23 | 24 | 25 | function f(){} 26 | 27 | 28 | 29 | export const e = f() 30 | `.trim() 31 | const expected = ` 32 | /** 33 | hello 34 | 35 | ff 36 | 37 | ss 38 | 39 | */ 40 | 41 | export var a = 1 42 | 43 | function f(){} 44 | 45 | export const e = f() 46 | `.trim() 47 | const file = project.createSourceFile('f1.ts', code) 48 | expectNoErrors(project) 49 | emptyLines({ file, project, emptyLinesMax: 1 }) 50 | expectEqualsAndDiff(file.getFullText().trim(), expected) 51 | expectNoErrors(project) 52 | }) 53 | }) 54 | -------------------------------------------------------------------------------- /ts-simple-ast-extra/src/flags.ts: -------------------------------------------------------------------------------- 1 | import { getEnumKeyAndValue } from 'misc-utils-of-mine-generic' 2 | import { ObjectFlags, Symbol, SymbolFlags, Type, TypeFlags } from 'ts-morph' 3 | 4 | export function getSymbolFlags(s: Symbol): string[] { 5 | const v: string[] = [] 6 | getEnumKeyAndValue(SymbolFlags).map(({ key, value }) => { 7 | if (typeof key !== 'number' && s.hasFlags(value)) { 8 | v.push(key) 9 | } 10 | }) 11 | return v 12 | } 13 | 14 | export function getTypeFlags(s: Type): string[] { 15 | const v: string[] = [] 16 | const f = s.getFlags() 17 | getEnumKeyAndValue(TypeFlags).map(({ key, value }) => { 18 | if (typeof key !== 'number' && f & value) { 19 | v.push(key) 20 | } 21 | }) 22 | return v 23 | } 24 | 25 | export function getObjectFlags(s: Type): string[] { 26 | const v: string[] = [] 27 | const f = s.getObjectFlags() 28 | getEnumKeyAndValue(ObjectFlags).map(({ key, value }) => { 29 | if (typeof key !== 'number' && f & value) { 30 | v.push(key) 31 | } 32 | }) 33 | return v 34 | } 35 | -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/spec/tests/newExpr.ts: -------------------------------------------------------------------------------- 1 | // not an issue - just use getFullStart, getFullWidth, etc 2 | 3 | import Project, { TypeGuards, Identifier } from 'ts-morph'; 4 | 5 | const project1 = new Project({ 6 | useVirtualFileSystem: true 7 | }) 8 | const sourceFile = project1.createSourceFile('src/index.ts', ` 9 | class A{ 10 | 11 | } 12 | new A().foo() 13 | 14 | const oo = { 15 | bar: 1 16 | } 17 | `) 18 | const id = sourceFile.getFirstDescendant(d=>TypeGuards.isIdentifier(d)&&d.getText()==='foo') as Identifier 19 | 20 | const decl = sourceFile.getClass('A') 21 | const constr1 = decl.addConstructor({ 22 | parameters: [{name: 'foo', type: 'number'}] 23 | }) 24 | 25 | const construcText = sourceFile.getText().substring(constr1.getFullStart(), constr1.getEnd()) 26 | console.log(construcText); 27 | console.log(constr1.getText()); 28 | 29 | const bar = sourceFile.getFirstDescendant(c=>c.getText()==='bar: 1') 30 | 31 | console.log(bar.getParent().getKindName()); 32 | 33 | // class A{ 34 | // constructor(foo: number) { 35 | // } 36 | // } 37 | -------------------------------------------------------------------------------- /typescript-plugin-util/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "typescript-plugin-util", 3 | "version": "1.0.16", 4 | "description": "Utilities for developing TypeScript Language Server Plugins", 5 | "main": "dist/src/index.js", 6 | "typings": "dist/src/index.d.ts", 7 | "scripts": { 8 | "test": "ts-node node_modules/jasmine/bin/jasmine", 9 | "build": "tsc", 10 | "prepare": "npm run build", 11 | "doc": "typedoc --mode modules --ignoreCompilerErrors --out ../docs/typescript-ast-util src/index.ts " 12 | }, 13 | "keywords": [ 14 | "TypeScript", 15 | "TypeScript Language Service", 16 | "plugin" 17 | ], 18 | "author": "Sebastian Gurin", 19 | "license": "MIT", 20 | "dependencies": { 21 | "ts-morph": "^3.1.3", 22 | "typescript": "^3.5.3" 23 | }, 24 | "devDependencies": { 25 | "@types/jasmine": "^3.4.0", 26 | "jasmine": "^3.4.0", 27 | "ts-node": "^8.3.0", 28 | "typedoc": "^0.15.0" 29 | }, 30 | "repository": "https://github.com/cancerberoSgx/typescript-plugin-of-mine/tree/master/typescript-plugin-util" 31 | } 32 | -------------------------------------------------------------------------------- /ts-run/spec/nodeSpec.ts: -------------------------------------------------------------------------------- 1 | import { ContentFile, RemoteFile, run } from '../src' 2 | import { resolve } from 'path'; 3 | describe('node', () => { 4 | it('research', async () => { 5 | expect(1).toBe(1) 6 | const result = await run({ 7 | tsLibBaseUrl: `file://${resolve('node_modules/typescript/lib')}/`, 8 | targetFile: new ContentFile('test1.ts', ` 9 | console.log('hello there!') 10 | export function f() { return 'hello' } 11 | `), 12 | tsConfigJson: new RemoteFile(`file://${resolve('tsconfig.json')}`) 13 | }) 14 | expect(result.exported.f()).toBe('hello') 15 | const result2 = await run({ 16 | targetFile: new ContentFile('test2.ts', ` 17 | import {a} from './test3'; 18 | console.log('imported: ' + a) 19 | export const c = 'exported: '+a 20 | `), 21 | files: [new ContentFile('test3.ts', ` 22 | export const a = 'hello world' 23 | `)], 24 | project: result.project 25 | }) 26 | expect(result2.exported.c).toBe('exported: hello world') 27 | }) 28 | }) 29 | -------------------------------------------------------------------------------- /typescript-plugins-text-based-user-interaction/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "typescript-plugins-text-based-user-interaction", 3 | "version": "0.0.17", 4 | "description": "Helpers for TypeScript Language Service Plugins that wants to interact with the user via the source file itself", 5 | "main": "dist/src/index.js", 6 | "typings": "dist/src/index.d.ts", 7 | "license": "MIT", 8 | "scripts": { 9 | "test": "ts-node node_modules/jasmine/bin/jasmine", 10 | "build": "tsc", 11 | "prepare": "npm run build", 12 | "doc": "exit 0" 13 | }, 14 | "keywords": [ 15 | "Language Server Plugin", 16 | "TypeScript", 17 | "refactor", 18 | "editor", 19 | "IDE" 20 | ], 21 | "dependencies": { 22 | "typescript": "^3.1.4" 23 | }, 24 | "devDependencies": { 25 | "@types/jasmine": "^2.8.9", 26 | "@types/node": "^10.12.1", 27 | "jasmine": "^3.3.0", 28 | "ts-node": "^7.0.1" 29 | }, 30 | "repository": "https://github.com/cancerberoSgx/typescript-plugins-of-mine/tree/master/typescript-plugins-text-based-user-interaction" 31 | } 32 | -------------------------------------------------------------------------------- /ts-simple-ast-extra/src/astPath/selectNode.ts: -------------------------------------------------------------------------------- 1 | import { Node } from 'ts-morph' 2 | import { getChildrenByPassSyntaxList, getChildrenForEachChild } from '../node' 3 | import { AstPath, SelectOptions } from './types' 4 | /** 5 | * Will select a node from given AstPath. Will look up from rootNode will loop up for a node in a 6 | * SourceFile given a path. 7 | * @param path the AstPath used to select the node previously built using `buildAstPath` 8 | * @param rootNode ancestor node from where to select, previously used to build astPath with `buildAstPath` 9 | */ 10 | export function selectNode(astPath: AstPath, rootNode: Node, options?: SelectOptions): T | undefined { 11 | let n: Node = rootNode 12 | let c: Node | undefined 13 | let { path } = astPath 14 | const tail = path.slice(1, path.length) 15 | ;[...tail].forEach(pathNode => { 16 | const children = 17 | astPath.createOptions.mode === 'getChildren' ? getChildrenByPassSyntaxList(n) : getChildrenForEachChild(n) 18 | c = children[pathNode.index] 19 | n = c 20 | }) 21 | return n as T 22 | } 23 | -------------------------------------------------------------------------------- /ts-run/api/interfaces/_types_.file.md: -------------------------------------------------------------------------------- 1 | [ts-run](../README.md) > ["types"](../modules/_types_.md) > [File](../interfaces/_types_.file.md) 2 | 3 | # Interface: File 4 | 5 | ## Hierarchy 6 | 7 | **File** 8 | 9 | ## Implemented by 10 | 11 | * [ContentFile](../classes/_file_.contentfile.md) 12 | * [RemoteFile](../classes/_file_.remotefile.md) 13 | 14 | ## Index 15 | 16 | ### Methods 17 | 18 | * [getContent](_types_.file.md#getcontent) 19 | * [getFilePath](_types_.file.md#getfilepath) 20 | 21 | --- 22 | 23 | ## Methods 24 | 25 | 26 | 27 | ### getContent 28 | 29 | ▸ **getContent**(): `Promise`<`string`> 30 | 31 | *Defined in [types.ts:5](https://github.com/cancerberoSgx/typescript-plugins-of-mine/blob/d827319/ts-run/src/types.ts#L5)* 32 | 33 | **Returns:** `Promise`<`string`> 34 | 35 | ___ 36 | 37 | 38 | ### getFilePath 39 | 40 | ▸ **getFilePath**(): `string` 41 | 42 | *Defined in [types.ts:4](https://github.com/cancerberoSgx/typescript-plugins-of-mine/blob/d827319/ts-run/src/types.ts#L4)* 43 | 44 | **Returns:** `string` 45 | 46 | ___ 47 | 48 | -------------------------------------------------------------------------------- /typescript-plugin-extract-interface-client-project1/src/tests/test4.ts: -------------------------------------------------------------------------------- 1 | const c = 1 2 | 3 | // const a = 2 + 3 4 | // function bigfish() { return 1 } 5 | // const bigger = f() 6 | // var hoo = ['asd'] 7 | // const cece = a + bigfish() 8 | // let arr = ['s', 't'] 9 | // function x() { return arr && arr.length ? arr : [1, 28276382736827368472364, 3] } 10 | 11 | // interface Person{} 12 | // interface Shoe{ 13 | // wear(p: Person):void 14 | // } 15 | // class Shoe { 16 | // color = 123 17 | // } 18 | 19 | 20 | var asdfsdf = 1 21 | 22 | function ff(): number { 23 | return 'a' 24 | } 25 | 26 | class casdasd { 27 | constructor() { 28 | this.prop = 1; 29 | } 30 | } 31 | class A { 32 | m1(foo) { return ''+foo } 33 | } 34 | function gg() { return new A() } 35 | 36 | const cc = gg() 37 | 38 | const fff = foo => { return new A().m1(foo) } 39 | const f = 'a'+'be' 40 | 41 | function hhg(): string{ 42 | return 1 43 | } 44 | 45 | export function a (){} 46 | 47 | function fsdfsdfsd(): Promise { 48 | return new Promise(resolve=>{resolve()}).then(r=>{}) 49 | } 50 | 51 | -------------------------------------------------------------------------------- /typescript-ast-util/spec/findAscendantSpec.ts: -------------------------------------------------------------------------------- 1 | import { compileSource, findChild, findAscendant, getKindName, filterChildren, getAscendants } from "../src"; 2 | import { SyntaxKind, FunctionDeclaration, Node } from "typescript"; 3 | 4 | describe('findAscendant', () => { 5 | it('should work', () => { 6 | const {program, fileName, tsconfigPath} = compileSource('function f (a, b, c){return (false && a > 313) && b < c}') 7 | const number313 = findChild(program.getSourceFile(fileName), (c=>c.getText()==='313')) 8 | expect(number313.getText()).toBe('313') 9 | const fd = findAscendant(number313, (a)=>a.kind===SyntaxKind.FunctionDeclaration) as FunctionDeclaration 10 | 11 | const isExpression = (node:Node)=>getKindName(node).endsWith('Expression') || node.kind === SyntaxKind.Identifier || getKindName(node).endsWith('Literal') 12 | expect(fd.name.getText()).toBe('f') 13 | 14 | expect(getAscendants(number313).map(getKindName).join(', ')).toBe('BinaryExpression, BinaryExpression, ParenthesizedExpression, BinaryExpression, ReturnStatement, Block, FunctionDeclaration, SourceFile') 15 | }) 16 | }) -------------------------------------------------------------------------------- /typescript-plugin-add-type/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "typescript-plugin-add-type", 3 | "version": "1.0.4", 4 | "description": "TypeScript Language Service plugin to extract an interface from a class", 5 | "main": "dist/index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 0", 8 | "watch": "tsc --watch", 9 | "build": "tsc", 10 | "prepare": "npm run build", 11 | "doc": "exit 0" 12 | }, 13 | "keywords": [ 14 | "TypeScript", 15 | "TypeScript Language Service", 16 | "plugin", 17 | "extract interface" 18 | ], 19 | "author": "Sebastian Gurin", 20 | "license": "MIT", 21 | "dependencies": { 22 | "hrtime-now": "^1.0.5", 23 | "ts-simple-ast": "^12.4.0", 24 | "typescript": "3.1.0", 25 | "typescript-ast-util": "file:../typescript-ast-util", 26 | "typescript-plugin-util": "file:../typescript-plugin-util" 27 | }, 28 | "devDependencies": { 29 | "yamat": "^0.1.1" 30 | }, 31 | "repository": "https://github.com/cancerberoSgx/typescript-plugins-of-mine/tree/master/typescript-ast-util", 32 | "readme": "README.md" 33 | } 34 | -------------------------------------------------------------------------------- /typescript-plugin-function-signature-refactors/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "node", 9 | "request": "launch", 10 | "protocol": "inspector", 11 | "name": "reOrderParamsLiteralObjectSpec", 12 | "preLaunchTask": "build", 13 | "args": [ 14 | // "--config=spec/support/jasmine-js.json", 15 | "/home/sg/git/typescript-plugins-of-mine/typescript-plugin-function-signature-refactors/dist/spec/reOrderParamsLiteralObjectSpec.js" 16 | ], 17 | "runtimeArgs": [ 18 | "--inspect", 19 | "--debug-brk", 20 | ], 21 | "cwd": "${workspaceFolder}/", 22 | "program": "${workspaceFolder}/node_modules/jasmine/bin/jasmine", 23 | "sourceMaps": true 24 | }, 25 | ] 26 | } -------------------------------------------------------------------------------- /ts-simple-ast-extra/spec/generalNodeSpec.ts: -------------------------------------------------------------------------------- 1 | import { pwd } from 'shelljs' 2 | import { Project, SyntaxKind } from 'ts-morph' 3 | import { GeneralNode, getGeneralNodeChildren, getGeneralNodeParent, getGeneralNodePath } from '../src' 4 | 5 | describe('generalNode', () => { 6 | it('should have path', () => { 7 | const p = new Project() 8 | p.createSourceFile('src/foo/bar.ts', ' export const a = 1') 9 | const d = p.getDirectories()[0] as GeneralNode 10 | expect(getGeneralNodePath(d, pwd())).toBe('src/foo') 11 | expect(getGeneralNodePath(getGeneralNodeParent(d)!, pwd())).toBe('src') 12 | expect(getGeneralNodeChildren(d).map(c => getGeneralNodePath(c, pwd()))).toEqual(['src/foo/bar.ts']) 13 | const f = p.createSourceFile('src/foo/d/a.ts', 'export function f(a: string[]){}') 14 | expect(getGeneralNodeChildren(d).map(c => getGeneralNodePath(c, pwd()))).toEqual(['src/foo/d', 'src/foo/bar.ts']) 15 | const a = f.getFirstDescendantByKindOrThrow(SyntaxKind.Parameter) 16 | expect(getGeneralNodePath(a, pwd())).toBe('src/foo/d/a.ts#FunctionDeclaration:nth-child(0)>Parameter:nth-child(2)') 17 | }) 18 | }) 19 | -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/spec/splitVariableDeclarationListSpec.ts: -------------------------------------------------------------------------------- 1 | import { splitVariableDeclarationList } from '../src/code-fix/splitVariableDeclarationList'; 2 | import { removeWhiteSpaces, testCodeFixRefactorEditInfo } from './testUtil'; 3 | 4 | describe('splitVariableDeclarationList', () => { 5 | it('add types', async () => { 6 | const code = `let i = 0, c = 's', arr = []` 7 | const result = testCodeFixRefactorEditInfo(code, code.indexOf('i = 0'), splitVariableDeclarationList.name) 8 | const s = removeWhiteSpaces(result.edits[0].textChanges[0].newText, ' ') 9 | expect(s).toContain(`let i: number = 0; let c: string = 's'; let arr: any[] = [];`) 10 | }) 11 | it('respect types', async () => { 12 | const code = `const i: Number = 0, c: String = 's', arr: boolean[] = []` 13 | const result = testCodeFixRefactorEditInfo(code, code.indexOf('er = 0, c: Str'), splitVariableDeclarationList.name) 14 | const s = removeWhiteSpaces(result.edits[0].textChanges[0].newText, ' ') 15 | expect(s).toContain(`const i: Number = 0; const c: String = 's'; const arr: boolean[] = [];`) 16 | }) 17 | }) 18 | 19 | -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/spec/changeReturnTypeSpec.ts: -------------------------------------------------------------------------------- 1 | import { applyTextChanges } from 'ts-morph-extra'; 2 | import { changeReturnType } from '../src/code-fix/changeReturnType'; 3 | import { testCodeFixRefactorEditInfo } from './testUtil'; 4 | 5 | describe('changeReturnType', () => { 6 | 7 | it('should be suggested when a return statement child is selected', () => { 8 | const code = ` 9 | class C { 10 | m(): number { 11 | return Math.random()>0.5 ? 's' : /a/g 12 | } 13 | } 14 | function main(): string{ 15 | return 1 + 1 16 | } 17 | ` 18 | let result = testCodeFixRefactorEditInfo(code, code.indexOf('return 1 + 1') + 4, changeReturnType.name) 19 | expect(applyTextChanges(code, result.edits[0].textChanges )).toContain('function main(): number{') 20 | 21 | result = testCodeFixRefactorEditInfo(code, code.indexOf( `return Math.random()>0.5 ? 's' : /a/g`) + 4, changeReturnType.name) 22 | expect(applyTextChanges(code, result.edits[0].textChanges )).toContain('m(): string | RegExp {') 23 | 24 | 25 | }) 26 | 27 | xit('test generic types and more complex types ' , ()=>{ 28 | 29 | }) 30 | }); 31 | -------------------------------------------------------------------------------- /vscode-typescript-refactors/src/test/index.ts: -------------------------------------------------------------------------------- 1 | // 2 | // PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING 3 | // 4 | // This file is providing the test runner to use when running extension tests. 5 | // By default the test runner in use is Mocha based. 6 | // 7 | // You can provide your own test runner if you want to override it by exporting 8 | // a function run(testRoot: string, clb: (error:Error) => void) that the extension 9 | // host can call to run the tests. The test runner is expected to use console.log 10 | // to report the results back to the caller. When the tests are finished, return 11 | // a possible error to the callback or null if none. 12 | 13 | import * as testRunner from 'vscode/lib/testrunner'; 14 | 15 | // You can directly control Mocha options by uncommenting the following lines 16 | // See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info 17 | testRunner.configure({ 18 | ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.) 19 | useColors: true // colored output from test results 20 | }); 21 | 22 | module.exports = testRunner; -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/spec/declareConstructorSpec.ts: -------------------------------------------------------------------------------- 1 | import { applyTextChanges } from 'ts-morph-extra'; 2 | import { codeFixCreateConstructor } from '../src/code-fix/declareConstructor'; 3 | import { removeWhiteSpaces,testCodeFixRefactorEditInfo } from './testUtil'; 4 | 5 | describe('declareConstructor', () => { 6 | 7 | it('Declare constructor fix when target kind is child.parent.kind === ts.SyntaxKind.NewExpression', () => { 8 | 9 | const code = ` 10 | class A{ 11 | 12 | } 13 | function main(){ 14 | const a = new A("12") 15 | } 16 | ` 17 | const result = testCodeFixRefactorEditInfo(code, code.indexOf('new A') + 4, codeFixCreateConstructor.name) 18 | const s = removeWhiteSpaces(result.edits[0].textChanges[0].newText, ' ') 19 | expect(s).toContain(`public constructor(aString0: string) { throw new Error('Not implemented'); }`) 20 | const output = applyTextChanges(code, result.edits[0].textChanges ) 21 | expect(removeWhiteSpaces(output , ' ')).toBe(`class A{ public constructor(aString0: string) { throw new Error('Not implemented'); } } function main(){ const a = new A("12") } `) 22 | }) 23 | }); 24 | -------------------------------------------------------------------------------- /ts-simple-ast-extra/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019 Sebastián Gurin 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /ts-simple-ast-extra/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019 Sebastián Gurin 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Sebastián Gurin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /input-ui-ipc-provider-test-vscode-extension/src/test/index.ts: -------------------------------------------------------------------------------- 1 | // 2 | // PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING 3 | // 4 | // This file is providing the test runner to use when running extension tests. 5 | // By default the test runner in use is Mocha based. 6 | // 7 | // You can provide your own test runner if you want to override it by exporting 8 | // a function run(testRoot: string, clb: (error:Error) => void) that the extension 9 | // host can call to run the tests. The test runner is expected to use console.log 10 | // to report the results back to the caller. When the tests are finished, return 11 | // a possible error to the callback or null if none. 12 | 13 | import * as testRunner from 'vscode/lib/testrunner'; 14 | 15 | // You can directly control Mocha options by uncommenting the following lines 16 | // See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info 17 | testRunner.configure({ 18 | ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.) 19 | useColors: true // colored output from test results 20 | }); 21 | 22 | module.exports = testRunner; -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/spec/declareClassSpec.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | import { declareClass } from '../src/code-fix/declareClass'; 4 | import { removeWhiteSpaces, testCodeFixRefactorEditInfo } from './testUtil'; 5 | 6 | describe('declareClass', () => { 7 | it('Declare class when extending non existent', () => { 8 | const code = ` 9 | class C extends NonExistentClass implements NonExistentInterface, ExistentInterface{ 10 | 11 | } 12 | 13 | class ExistentInterface{ 14 | 15 | }` 16 | 17 | const result = testCodeFixRefactorEditInfo(code, code.indexOf('NonExistentClass') + 1, declareClass.name) 18 | expect(removeWhiteSpaces(result.edits[0].textChanges[0].newText, ' ')).toContain(`class NonExistentClass { }`) 19 | 20 | }) 21 | 22 | 23 | it('declare interface', async () => { 24 | const code = ` 25 | class CCC implements III { 26 | a(): void{} 27 | } 28 | ` 29 | const result = testCodeFixRefactorEditInfo(code, code.indexOf('III') + 1, declareClass.name) 30 | expect(removeWhiteSpaces(result.edits[0].textChanges[0].newText, ' ')).toContain(`interface III { }`) 31 | }) 32 | 33 | 34 | // let uuu: SSSSS = {} 35 | }); 36 | -------------------------------------------------------------------------------- /ts-run/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Sebastián Gurin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /sample-ts-plugin1/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Sebastián Gurin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /ts-simple-ast-extra/spec/refactors/organizeImportsSpec.ts: -------------------------------------------------------------------------------- 1 | import { Project } from 'ts-morph' 2 | import { format } from '../../src' 3 | import { expectEqualsAndDiff } from '../testUtil' 4 | 5 | describe('should organizeImprots', () => { 6 | it('simple all', () => { 7 | const project = new Project() 8 | const code = ` 9 | import f from 'f' 10 | import {v3,g3,s3} from './a' 11 | import {h3} from 'f' 12 | import {v2, g2,s2} from "../../a/b/../../a/b/c" 13 | import {g3} from 'f' 14 | 15 | export a = v2()+s2()+h3()+f()+g3(s3()) 16 | 17 | import {tt} from './tumba' 18 | 19 | const tota = tt 20 | `.trim() 21 | const expected = ` 22 | import f, { h3 } from 'f' 23 | import { s2, v2 } from '../../a/b/../../a/b/c' 24 | import { g3, s3 } from './a' 25 | import { tt } from './tumba' 26 | 27 | export a = v2() + s2() + h3() + f() + g3(s3()) 28 | 29 | 30 | const tota = tt 31 | `.trim() 32 | const file = project.createSourceFile('f1.ts', code) 33 | format({ file, project, quotePreference: 'single', trailingSemicolons: 'never', organizeImports: true }) 34 | expectEqualsAndDiff(file.getFullText().trim(), expected) 35 | }) 36 | }) 37 | -------------------------------------------------------------------------------- /input-ui-ipc-provider/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Sebastián Gurin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /typescript-ast-util/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Sebastián Gurin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /typescript-node-ids/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Sebastián Gurin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /typescript-plugin-util/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Sebastián Gurin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /typescript-plugin-add-type/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Sebastián Gurin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /typescript-plugin-move-file/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Sebastián Gurin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vscode-typescript-refactors/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Sebastián Gurin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /input-ui-ipc-provider-vscode/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Sebastián Gurin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /ts-simple-ast-extra/spec/refactors/convertImportsSpec.ts: -------------------------------------------------------------------------------- 1 | import { removeWhites } from 'misc-utils-of-mine-generic' 2 | import { Project } from 'ts-morph' 3 | import { convertNamedImportsToNamespaceImport, convertNamespaceImportToNamedImports } from '../../src' 4 | 5 | describe('convertImports', () => { 6 | it('convertImportNamespaceToNamed', () => { 7 | const code = ` 8 | import * as m from "m"; 9 | m.a; 10 | m.b;` 11 | const project = new Project() 12 | const f = project.createSourceFile('f1.ts', code) 13 | convertNamespaceImportToNamedImports(project, f) 14 | expect(removeWhites(f.getText())).toBe( 15 | removeWhites(` 16 | import { a,b } from "m"; 17 | a; 18 | b; 19 | `) 20 | ) 21 | }) 22 | 23 | it('convertNamedImportsToNamespaceImport', () => { 24 | const code = `import {a,b,c} from './foo'; a(b,c)` 25 | const project = new Project() 26 | const f = project.createSourceFile('f1.ts', code) 27 | const i = f.getImportDeclarations()[0] 28 | convertNamedImportsToNamespaceImport(project, f) 29 | expect(f.getText()).toBe(`import * as foo from './foo'; foo.a(foo.b,foo.c)`) 30 | }) 31 | }) 32 | -------------------------------------------------------------------------------- /typescript-node-ids/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "typescript-node-ids", 3 | "version": "0.0.2", 4 | "description": "TypeScript support for naming Nodes uniquely and query them per SourceFile. This really make sense in libraries like ts-simple-ast when modifying AST in a loop. Implementations for native typescript compiler API and ts-simple-ast library", 5 | "main": "dist/src/index.js", 6 | "typings": "dist/src/index.d.ts", 7 | "scripts": { 8 | "test": "ts-node node_modules/jasmine/bin/jasmine", 9 | "build": "rm -rf dist && tsc", 10 | "doc": "exit 0" 11 | }, 12 | "keywords": [ 13 | "TypeScript", 14 | "ts-simple-ast", 15 | "ast", 16 | "parsing" 17 | ], 18 | "author": "Sebastian Gurin", 19 | "license": "MIT", 20 | "dependencies": { 21 | "ts-simple-ast": "^17.1.1", 22 | "ts-simple-ast-extra": "file:../ts-simple-ast-extra", 23 | "typescript": "^3.1.3", 24 | "typescript-ast-util": "file:../typescript-ast-util" 25 | }, 26 | "devDependencies": { 27 | "@types/jasmine": "^2.8.9", 28 | "@types/node": "^10.12.0", 29 | "hrtime-now": "^1.0.5", 30 | "jasmine": "^3.3.0", 31 | "ts-node": "^7.0.1" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /typescript-plugin-ast-inspector/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Sebastián Gurin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /typescript-plugin-subclasses-of/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Sebastián Gurin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /input-ui-ipc-provider-vscode/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "input-ui-ipc-provider-vscode", 3 | "description": "vscode implementation of https://github.com/cancerberoSgx/typescript-plugins-of-mine/tree/master/input-ui-ipc-provider", 4 | "version": "0.0.9", 5 | "main": "./dist/index", 6 | "typings": "./dist/index.d.ts", 7 | "scripts": { 8 | "postinstall": "node ./node_modules/vscode/bin/install", 9 | "vscode:prepublish": "npm run build", 10 | "build": "tsc -p ./", 11 | "doc": "exit 0", 12 | "watch": "tsc -watch -p ./", 13 | "test-vscode": "npm run build && node ./node_modules/vscode/bin/test" 14 | }, 15 | "dependencies": { 16 | "input-ui-ipc-provider": "file:../input-ui-ipc-provider", 17 | "vscode": "^1.1.21" 18 | }, 19 | "devDependencies": { 20 | "@types/mocha": "^5.2.5", 21 | "@types/node": "^10.12.1", 22 | "tslint": "^5.11.0", 23 | "typescript": "^3.1.4" 24 | }, 25 | "publisher": "cancerberosgx", 26 | "engines": { 27 | "vscode": "^1.24.0" 28 | }, 29 | "license": "MIT", 30 | "repository": { 31 | "type": "git", 32 | "url": "https://github.com/cancerberoSgx/typescript-plugins-of-mine.git" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /typescript-plugin-extract-interface/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Sebastián Gurin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /typescript-plugin-move-declaration/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Sebastián Gurin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/spec/removeCommentsSpec.ts: -------------------------------------------------------------------------------- 1 | 2 | import Project, { ClassDeclaration } from 'ts-morph'; 3 | import { removeComments } from '../src/code-fix/removeComments'; 4 | import { testCodeFixRefactorEditInfo2 } from './testUtil'; 5 | 6 | describe('removeComments', () => { 7 | 8 | it('basic', async () => { 9 | const code = ` 10 | var a =1 11 | //laksd lkaj sldas 12 | function f(){ 13 | // laksjldkajs 14 | const a = 6 15 | //TODO: something 16 | let i = 2 17 | // Heads up!: 18 | var hh=1 19 | //lksksks 20 | } 21 | //final 22 | ` 23 | 24 | const project = new Project() 25 | const file = project.createSourceFile('foo.ts', code) 26 | 27 | const result = testCodeFixRefactorEditInfo2(file, project, { pos: 0, end: code.length }, removeComments.name) 28 | expect(JSON.stringify(result.edits[0].textChanges)).toBe('[{"newText":"","span":{"start":10,"length":18}},{"newText":"","span":{"start":45,"length":14}},{"newText":"","span":{"start":76,"length":17}},{"newText":"","span":{"start":108,"length":14}},{"newText":"","span":{"start":136,"length":9}},{"newText":"","span":{"start":148,"length":7}}]') 29 | }) 30 | 31 | 32 | }) 33 | 34 | -------------------------------------------------------------------------------- /typescript-plugin-test-helper/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "typescript-plugin-test-helper", 3 | "version": "0.0.2", 4 | "description": "testing ts related techologies", 5 | "main": "dist/src/index.js", 6 | "typings": "dist/src/index.d.ts", 7 | "scripts": { 8 | "test": "ts-node node_modules/jasmine/bin/jasmine", 9 | "doc": "exit 0", 10 | "watch": "tsc --watch", 11 | "prepare": "npm run build", 12 | "build": "tsc" 13 | }, 14 | "keywords": [ 15 | "TypeScript", 16 | "TypeScript Language Service", 17 | "plugin" 18 | ], 19 | "author": "Sebastian Gurin", 20 | "license": "MIT", 21 | "dependencies": { 22 | "hrtime-now": "^1.0.1", 23 | "glob": "^7.1.2", 24 | "ts-simple-ast": "12.2.0", 25 | "typescript": "2.9.1", 26 | "typescript-ast-util": "1.0.7" 27 | }, 28 | "devDependencies": { 29 | "@types/jasmine": "^2.8.7", 30 | "@types/node": "^10.1.2", 31 | "@types/shelljs": "^0.7.9", 32 | "jasmine": "^3.1.0", 33 | "shelljs": "^0.8.2", 34 | "ts-node": "^6.0.3" 35 | }, 36 | "repository": "https://github.com/cancerberoSgx/typescript-plugins-of-mine/tree/master/typescript-plugin-proactive-code-fixes" 37 | } 38 | -------------------------------------------------------------------------------- /typescript-plugin-proactive-code-fixes/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Sebastián Gurin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /input-ui-ipc-provider-test-typescript-plugin/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Sebastián Gurin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /input-ui-ipc-provider-test-vscode-extension/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Sebastián Gurin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /ts-run/api/modules/_emit_.md: -------------------------------------------------------------------------------- 1 | [ts-run](../README.md) > ["emit"](../modules/_emit_.md) 2 | 3 | # External module: "emit" 4 | 5 | ## Index 6 | 7 | ### Functions 8 | 9 | * [emit](_emit_.md#emit) 10 | * [evaluate](_emit_.md#evaluate) 11 | 12 | --- 13 | 14 | ## Functions 15 | 16 | 17 | 18 | ### emit 19 | 20 | ▸ **emit**(options: *[TsRunOptions](../interfaces/_types_.tsrunoptions.md) & `object`*): `Promise`<`object`> 21 | 22 | *Defined in [emit.ts:7](https://github.com/cancerberoSgx/typescript-plugins-of-mine/blob/d827319/ts-run/src/emit.ts#L7)* 23 | 24 | **Parameters:** 25 | 26 | | Name | Type | 27 | | ------ | ------ | 28 | | options | [TsRunOptions](../interfaces/_types_.tsrunoptions.md) & `object` | 29 | 30 | **Returns:** `Promise`<`object`> 31 | 32 | ___ 33 | 34 | 35 | ### evaluate 36 | 37 | ▸ **evaluate**(code: *`string`*): `Promise`<`object`> 38 | 39 | *Defined in [emit.ts:38](https://github.com/cancerberoSgx/typescript-plugins-of-mine/blob/d827319/ts-run/src/emit.ts#L38)* 40 | 41 | **Parameters:** 42 | 43 | | Name | Type | 44 | | ------ | ------ | 45 | | code | `string` | 46 | 47 | **Returns:** `Promise`<`object`> 48 | 49 | ___ 50 | 51 | -------------------------------------------------------------------------------- /typescript-plugin-function-signature-refactors/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Sebastián Gurin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /typescript-plugins-text-based-user-interaction/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Sebastián Gurin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | --------------------------------------------------------------------------------