mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Syntax operations also need to ensure project is present for the open script infos since update could be pending to make sure open script info has project (#50418)
Also convert one relevant test case to baseline Fixes #50131
This commit is contained in:
@@ -1868,9 +1868,9 @@ namespace ts.server {
|
||||
|
||||
private getFileAndLanguageServiceForSyntacticOperation(args: protocol.FileRequestArgs) {
|
||||
// Since this is syntactic operation, there should always be project for the file
|
||||
// we wouldnt have to ensure project but rather throw if we dont get project
|
||||
// throw if we dont get project
|
||||
const file = toNormalizedPath(args.file);
|
||||
const project = this.getProject(args.projectFileName) || this.projectService.tryGetDefaultProjectForFile(file);
|
||||
const project = this.getProject(args.projectFileName) || this.projectService.ensureDefaultProjectForFile(file);
|
||||
if (!project) {
|
||||
return Errors.ThrowNoProject();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user