acquireDocument
Request a stored SourceFile with a given fileName and compilationSettings. The first call to acquire will call createLanguageServiceSourceFile to generate the SourceFile if was not found in the registry.
Parameters
The name of the file requested
Some compilation settings like target affects the shape of a the resulting SourceFile. This allows the DocumentRegistry to store multiple copies of the same file for different compilation settings. A minimal resolution cache is needed to fully define a source file's shape when the compilation settings include module: node16
+, so providing a cache host object should be preferred. A common host is a language service ConfiguredProject
.
Text of the file. Only used if the file was not found in the registry and a new one was created.
Current version of the file. Only used if the file was not found in the registry and a new one was created.