kotlin-language-server
kotlin-language-server copied to clipboard
Accessing text document content
What is the preferred way to access content inside tests after invoking open(file) in a test fixture?
Best I could find is do something like this:
val file = "DocumentSymbols.kt"
private val fileId = TextDocumentIdentifier(uri(file).toString())
private val params = DocumentSymbolParams(fileId)
private val documentUri by lazy { parseURI(params.textDocument.uri) }
private val content by lazy { languageServer.textDocumentService.sp.content(documentUri) }
Is there a simpler way?