kotlin-language-server icon indicating copy to clipboard operation
kotlin-language-server copied to clipboard

Accessing text document content

Open pajatopmr opened this issue 4 years ago • 1 comments

What is the preferred way to access content inside tests after invoking open(file) in a test fixture?

pajatopmr avatar Mar 10 '21 10:03 pajatopmr

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?

pajatopmr avatar Mar 10 '21 20:03 pajatopmr