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

Method ToURI

internal/api/proto.go:268–273  ·  view source on GitHub ↗

ToURI returns the document URI for this identifier. An explicitly provided URI is returned as-is; a file name is first normalized to an absolute path against cwd before being converted to a URI.

(cwd string)

Source from the content-addressed store, hash-verified

266// is returned as-is; a file name is first normalized to an absolute path against
267// cwd before being converted to a URI.
268func (d DocumentIdentifier) ToURI(cwd string) lsproto.DocumentUri {
269 if d.URI != "" {
270 return d.URI
271 }
272 return lsconv.FileNameToDocumentURI(tspath.GetNormalizedAbsolutePath(d.FileName, cwd))
273}
274
275func (d DocumentIdentifier) ToAbsoluteFileName(cwd string) string {
276 if d.URI != "" {

Callers 3

handleUpdateSnapshotMethod · 0.80
toFileChangeSummaryMethod · 0.80

Calls 2

FileNameToDocumentURIFunction · 0.92

Tested by

no test coverage detected