Add container name to lsp symbol entry#3447
Open
benjiwolff wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
worspace/symbolreturns context information (containerName) for each symbol (see spec).However, neovims
symbols_to_itemsignorescontainerName, so we add it manually to the picker entry.This is the smallest change required to use the existing
lsp_dynamic_workspace_symbolspicker and friends with a custom entry_maker, that includescontainerName.I am new to this codebase and don't know the reason behind using
symbols_to_items. It returnsvim.quickfix.entry[]which seems inappropriate forworkspace/symbols. Maybe, it could be dropped altogether.Fixes #2695
Type of change
How Has This Been Tested?
I used the following custom entry_maker with
seblyng/roslyn.nvim.custom entry_maker
M.workspace_symbols = function() telescope_builtin.lsp_dynamic_workspace_symbols({ entry_maker = workspace_symbols_entry_maker, }) endlocal lsp_type_highlight;
workspace_symbols_entry_maker = function(entry)
local symbol_type, symbol_name = entry.text:match("%[(.+)%]%s+(.*)")
end
lsp_type_highlight = {
["Class"] = "TelescopeResultsClass",
["Constant"] = "TelescopeResultsConstant",
["Field"] = "TelescopeResultsField",
["Function"] = "TelescopeResultsFunction",
["Method"] = "TelescopeResultsMethod",
["Property"] = "TelescopeResultsOperator",
["Struct"] = "TelescopeResultsStruct",
["Variable"] = "TelescopeResultsVariable",
}
Configuration:
Neovim version (nvim --version):
NVIM v0.12.0-dev-92+gfece489794
Build type: RelWithDebInfo
LuaJIT 2.1.1741730670
Operating system and version: macOS 15.3.1
Checklist: