Add cwd if no rootDir or rootDirs configured

This commit is contained in:
Tony Garnock-Jones 2021-01-24 00:17:40 +01:00
parent 49a036376a
commit 0b1208d2fd
1 changed files with 4 additions and 0 deletions

View File

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