MCPcopy Create free account
hub / github.com/microsoft/typescript-go / DisplayName

Method DisplayName

internal/project/project.go:178–185  ·  view source on GitHub ↗

DisplayName returns a short, human-readable name for the project, relative to the given workspace root directory. For configured projects, this is the config file path made relative. For inferred projects, this is the last component of the current directory.

(cwd string)

Source from the content-addressed store, hash-verified

176// For configured projects, this is the config file path made relative.
177// For inferred projects, this is the last component of the current directory.
178func (p *Project) DisplayName(cwd string) string {
179 if p.Kind == KindInferred {
180 return tspath.GetBaseFileName(p.currentDirectory)
181 }
182 return tspath.ConvertToRelativePath(p.configFileName, tspath.ComparePathsOptions{
183 CurrentDirectory: cwd,
184 })
185}
186
187func (p *Project) ID() tspath.Path {
188 return p.configFilePath

Callers 3

TestDisplayNameFunction · 0.80
updateProgramMethod · 0.80

Implementers 1

Projectinternal/project/project.go

Calls 2

GetBaseFileNameFunction · 0.92
ConvertToRelativePathFunction · 0.92

Tested by 1

TestDisplayNameFunction · 0.64