Provide a way to determine whether a SourceFile is an untitled, inexistent file #37987
Closed
5 tasks done
Labels
API
Relates to the public API for TypeScript
Good First Issue
Well scoped, documented and has the green light
Help Wanted
You can do this
Search Terms
tsserverlibrary, untitled, isdynamic
Suggestion
Currently I'm trying to write a language service for typescript and I find myself unable to determine whether a file is untitled.
What I've noticed so far is that untitled files send
untitled:^Untitled-1
as its filename to thegetSymanticDiagnostics
function. This naming convention could change anytime and also it's not consistently containing an URI or a filepath.Is there some way to check whether a
SourceFile
is untitled?Use Cases
I'm passing the files to a linter. If the file is untitled I'll get an incorrect results if I pass the filename which, at runtime, equals
untitled:^Untitled-1
.Examples
Checklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: