Browse Source

Add cwd if no rootDir or rootDirs configured

typescript1
Tony Garnock-Jones 1 year ago
parent
commit
0b1208d2fd
  1. 4
      packages/ts-plugin/src/index.ts

4
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);
}
}

Loading…
Cancel
Save