diff --git a/packages/ts-plugin/src/index.ts b/packages/ts-plugin/src/index.ts index 0531a51..8683038 100644 --- a/packages/ts-plugin/src/index.ts +++ b/packages/ts-plugin/src/index.ts @@ -1,6 +1,7 @@ import { compile, Syntax } from '@syndicate-lang/compiler'; import tslib from 'typescript/lib/tsserverlibrary'; import crypto from 'crypto'; +import path from 'path'; const boot: tslib.server.PluginModuleFactory = ({ typescript: ts }) => { @@ -616,6 +617,9 @@ const boot: tslib.server.PluginModuleFactory = ({ typescript: ts }) => { if (options.rootDirs !== void 0) { options.rootDirs.forEach(d => syndicateRootDirs.add(d)); } + if (options.rootDir === void 0 && options.rootDirs === void 0) { + syndicateRootDirs.add(path.resolve('.')); + } return new SyndicateLanguageService(createInfo.languageService); } }