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

Winbar(Breadcrumbs) not working as Expected. #1463

Open
Tanish2002 opened this issue Jun 11, 2024 · 6 comments
Open

Winbar(Breadcrumbs) not working as Expected. #1463

Tanish2002 opened this issue Jun 11, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@Tanish2002
Copy link

Describe the bug

The winbar provided by lspsaga only contains the File path. And not the lsp related symbols(functions, classes, etc)
I tried navic and that seems to work fine, However I would like to use LspSaga for this since it provides nice highlighting..

Attaching some screenshots for your reference:
LspSaga:
image

Navic:
image

Both screenshots are taken inside the same file and same function scope

Steps to reproduce

Relevant Config:

require("lspsaga").setup({})

Expected behavior

Lspsaga shows function name as well as folder and file in winbar.

Neovim version (nvim -v)

v0.9.5

lspsaga commit

Terminal name/version

st

@Tanish2002 Tanish2002 added the bug Something isn't working label Jun 11, 2024
@glepnir
Copy link
Member

glepnir commented Jun 11, 2024

Can you provide this js code that can reproduce

@Tanish2002
Copy link
Author

@glepnir

I can't provide the exact code since it's confidential company code..
But here is a small reproduction of the same:

var Q = require('q');
var md5 = require('md5');
var Utils = require('../../../../lib/common-utils');
var QuotesValidator = require('../validation/QuotesValidation');
var PolicyCasesController = require('../../../common/controllers/PolicyCasesController');
let CommonController = require('../../../common/controllers/CommonController');
var WinstonLogUtils = require('../../../../lib/winston-log-utils');
let fwService = require('../services/fw_services');
let mySqlCommonService = require('../../../common/services/MySqlCommonService');
let Guid = require('guid');
let request = require('request');

var quotesRedis = require('../../../../lib/quotes-redis-connection');

function Quotes() {

  this.quotes = {};
  this.errors = {};
}

Quotes.prototype.getQuotes = async function(req, res) {
  // some code 
  //
}

// some more very legacy code.. :<

module.exports = Quotes;

@Tanish2002
Copy link
Author

Tanish2002 commented Jun 11, 2024

Just found that it seems to work but weirdly,

for example If I keep my cursor over PolicyCasesController or WinstonLogUtils it shows them in winbar, but not for any of the other imports or functions..

Screenshots:
image
image

Not working:
image

@hsayed21
Copy link

+1

@hsayed21
Copy link

hsayed21 commented Jun 14, 2024

For me working goods with some languages and not for others.

Can someone explain why nvimdev/lspsaga.nvim not working with certain languages ?
Although I have installed LSP and tree-sitter and it works perfectly for text objects and syntax highlighting.

For Example:
this working fine with lua
image

and this not working with C# (always appear the file path)
image

Neovim version:
3

MyConfig:

{
	"nvim-lualine/lualine.nvim",
	dependencies = 
	{ 
		{
			"nvim-tree/nvim-web-devicons"
		},
		{
			"nvimdev/lspsaga.nvim",
			event = { "LspAttach" },
			dependencies = {
				"neovim/nvim-lspconfig",
				"nvim-treesitter/nvim-treesitter",
			},
		}
	},
	config = function()
		local lualine = require("lualine")
		local lazy_status = require("lazy.status") -- to configure lazy pending updates count

		local lspsaga = require('lspsaga')
		lspsaga.setup({})
		local lspsaga_bar = require("lspsaga.symbol.winbar")
		
		local function breadcrumbs()
			local bar = lspsaga_bar.get_bar()
			if bar == nil then
				return ""
			end
			return bar
		end


		lualine.setup({
			options = {
				theme = "catppuccin",
				section_separators = { left = "", right = "" },
				component_separators = { left = "", right = ""},
			},
			icons_enabled = true,
			tabline = {},
			globalstatus = true,
			sections = {
				lualine_a = { 'mode' },
				lualine_b = { 'branch', 'diff', 'diagnostics' },
				lualine_c = { 'filename' },
				lualine_x = {
					{
						lazy_status.updates,
						cond = lazy_status.has_updates,
						color = { fg = "#ff9e64" }
					},
					{ "encoding" },
					{ "fileformat" },
					{ "filetype" },
				},
				lualine_y = { 'progress', 'searchcount' },
				lualine_z = { 'location' }
			},
			inactive_sections = {
				lualine_a = {},
				lualine_b = {},
				lualine_c = { 'filename' },
				lualine_x = { 'location' },
				lualine_y = {},
				lualine_z = {}
			},
			winbar = {
				lualine_a = {},
				lualine_b = {},
				lualine_c = { breadcrumbs },
				lualine_x = {},
				lualine_y = {},
				lualine_z = {}
			},
			inactive_winbar = {
				lualine_a = {},
				lualine_b = {},
				lualine_c = { breadcrumbs },
				lualine_x = {},
				lualine_y = {},
				lualine_z = {}
			},
			extensions = {}
		}
	)
	end,
}

@ggeorgiu
Copy link

ggeorgiu commented Jun 28, 2024

I'm experiencing a similar issue.
I noticed that the breadcrumbs are consistently not appearing on the first file opened whenever starting nvim.
It works fine for the rest.

Not working:
Screenshot 2024-06-28 at 22 07 46

Working:
Screenshot 2024-06-28 at 22 08 02
Screenshot 2024-06-28 at 22 08 31

Note: autocmds.lua is the first file I opened. If I close nvim, re-open it and open globals.lua first the breadcrumbs are not working in that file.

Ex:
Screenshot 2024-06-28 at 22 12 52
Screenshot 2024-06-28 at 22 13 27
Screenshot 2024-06-28 at 22 13 43

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants