( configFileName string, kind Kind, currentDirectory string, builder *ProjectCollectionBuilder, logger *logging.LogTree, )
| 133 | } |
| 134 | |
| 135 | func NewProject( |
| 136 | configFileName string, |
| 137 | kind Kind, |
| 138 | currentDirectory string, |
| 139 | builder *ProjectCollectionBuilder, |
| 140 | logger *logging.LogTree, |
| 141 | ) *Project { |
| 142 | if logger != nil { |
| 143 | logger.Log(fmt.Sprintf("Creating %sProject: %s, currentDirectory: %s", kind.String(), configFileName, currentDirectory)) |
| 144 | } |
| 145 | project := &Project{ |
| 146 | configFileName: configFileName, |
| 147 | Kind: kind, |
| 148 | currentDirectory: currentDirectory, |
| 149 | dirty: true, |
| 150 | } |
| 151 | |
| 152 | project.configFilePath = tspath.ToPath(configFileName, currentDirectory, builder.fs.fs.UseCaseSensitiveFileNames()) |
| 153 | project.programFilesWatch = NewWatchedFiles( |
| 154 | "program files for "+configFileName, |
| 155 | lsproto.WatchKindCreate|lsproto.WatchKindChange|lsproto.WatchKindDelete, |
| 156 | lsproto.GetClientCapabilities(builder.ctx).Workspace.DidChangeWatchedFiles.RelativePatternSupport, |
| 157 | createResolutionLookupGlobMapper(builder.sessionOptions.CurrentDirectory, builder.sessionOptions.DefaultLibraryPath, project.currentDirectory, builder.fs.fs.UseCaseSensitiveFileNames()), |
| 158 | ) |
| 159 | if builder.sessionOptions.TypingsLocation != "" { |
| 160 | project.typingsWatch = NewWatchedFiles( |
| 161 | "typings installer files", |
| 162 | lsproto.WatchKindCreate|lsproto.WatchKindChange|lsproto.WatchKindDelete, |
| 163 | lsproto.GetClientCapabilities(builder.ctx).Workspace.DidChangeWatchedFiles.RelativePatternSupport, |
| 164 | core.Identity, |
| 165 | ) |
| 166 | } |
| 167 | return project |
| 168 | } |
| 169 | |
| 170 | func (p *Project) Name() string { |
| 171 | return p.configFileName |
no test coverage detected