mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-21 08:25:43 -05:00
Allow dynamic files without external project and also use file names starting with ^ as dynamic file
Fixes #21204
This commit is contained in:
@@ -898,7 +898,7 @@ namespace ts.server {
|
||||
|
||||
const project = this.getOrCreateInferredProjectForProjectRootPathIfEnabled(info, projectRootPath) ||
|
||||
this.getOrCreateSingleInferredProjectIfEnabled() ||
|
||||
this.createInferredProject(getDirectoryPath(info.path));
|
||||
this.createInferredProject(info.isDynamic ? this.currentDirectory : getDirectoryPath(info.path));
|
||||
|
||||
project.addRoot(info);
|
||||
project.updateGraph();
|
||||
@@ -1655,7 +1655,7 @@ namespace ts.server {
|
||||
}
|
||||
|
||||
private getOrCreateInferredProjectForProjectRootPathIfEnabled(info: ScriptInfo, projectRootPath: NormalizedPath | undefined): InferredProject | undefined {
|
||||
if (!this.useInferredProjectPerProjectRoot) {
|
||||
if (info.isDynamic || !this.useInferredProjectPerProjectRoot) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
|
||||
@@ -196,7 +196,7 @@ namespace ts.server {
|
||||
|
||||
/*@internal*/
|
||||
export function isDynamicFileName(fileName: NormalizedPath) {
|
||||
return getBaseFileName(fileName)[0] === "^";
|
||||
return fileName[0] === "^" || getBaseFileName(fileName)[0] === "^";
|
||||
}
|
||||
|
||||
export class ScriptInfo {
|
||||
|
||||
Reference in New Issue
Block a user