Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow empty string for workspace symbol request #2071

Merged
merged 3 commits into from
Sep 30, 2022

Conversation

predragnikolic
Copy link
Member

/**
 * The parameters of a Workspace Symbol Request.
 */
interface WorkspaceSymbolParams extends WorkDoneProgressParams,
    PartialResultParams {
    /**
     * A query string to filter symbols by. Clients may send an empty
     * string here to request all symbols.
     */
    query: string;
}

closes #1008

/**
 * The parameters of a Workspace Symbol Request.
 */
interface WorkspaceSymbolParams extends WorkDoneProgressParams,
	PartialResultParams {
	/**
	 * A query string to filter symbols by. Clients may send an empty
	 * string here to request all symbols.
	 */
	query: string;
}
@predragnikolic
Copy link
Member Author

this is the second attempt,
the first was #1018

and was mainly closed due to #1018 (comment)


It might be possible that servers that support < 3.15 will assume the query-string is non-empty (and might crash if provided with an empty query string). But I might be splitting hairs here.

There was also this concern that a language server would could potentially crash if the client sends an empty string...
but we are still adhering to the spec, so that means that the server would have to fix.

@rchl
Copy link
Member

rchl commented Sep 27, 2022

I wonder why LSP menus for the main menu don't include lsp_workspace_symbols...
Would it be a good idea to add it here?

I'm gonna test this out but I remember doing it myself some time and for some reason not following up with it. Not sure why...

@rchl rchl merged commit 551941b into main Sep 30, 2022
@rchl rchl deleted the fix/allow-empty-string-for-workspace-symbols branch September 30, 2022 15:19
rchl added a commit that referenced this pull request Oct 11, 2022
* main:
  Allow empty string for workspace symbol request (#2071)
  Add code lens image to the docs (#2074)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Workspace Symbol command should accept an empty query string, since 3.15
2 participants