Add cwd if no rootDir or rootDirs configured
This commit is contained in:
parent
49a036376a
commit
0b1208d2fd
|
@ -1,6 +1,7 @@
|
||||||
import { compile, Syntax } from '@syndicate-lang/compiler';
|
import { compile, Syntax } from '@syndicate-lang/compiler';
|
||||||
import tslib from 'typescript/lib/tsserverlibrary';
|
import tslib from 'typescript/lib/tsserverlibrary';
|
||||||
import crypto from 'crypto';
|
import crypto from 'crypto';
|
||||||
|
import path from 'path';
|
||||||
|
|
||||||
const boot: tslib.server.PluginModuleFactory = ({ typescript: ts }) => {
|
const boot: tslib.server.PluginModuleFactory = ({ typescript: ts }) => {
|
||||||
|
|
||||||
|
@ -616,6 +617,9 @@ const boot: tslib.server.PluginModuleFactory = ({ typescript: ts }) => {
|
||||||
if (options.rootDirs !== void 0) {
|
if (options.rootDirs !== void 0) {
|
||||||
options.rootDirs.forEach(d => syndicateRootDirs.add(d));
|
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);
|
return new SyndicateLanguageService(createInfo.languageService);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue