Skip to content

List symbols empty response array #886

Answered by rchl
sansmoraxz asked this question in Q&A
Discussion options

You must be logged in to vote

Generally server requires that the file is opened first. Many methods will return an empty result or null if file is not opened. For example:

async documentSymbol(params: lsp.DocumentSymbolParams, token?: lsp.CancellationToken): Promise<lsp.DocumentSymbol[] | lsp.SymbolInformation[]> {
const document = this.tsClient.toOpenDocument(params.textDocument.uri);
if (!document) {
return [];
}

And note that this path is not a valid URI: https://github.com/sansmoraxz/tambla/blob/f28812b14ccef628c22177ede4c4342ff60b173c/test/lsp.test.ts#L66-L69

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@sansmoraxz
Comment options

@rchl
Comment options

rchl Jul 4, 2024
Maintainer

Answer selected by sansmoraxz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants