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

feat: icon_fetcher adds symbol parameter #109

Merged
merged 2 commits into from
Jan 5, 2025

Conversation

epheien
Copy link

@epheien epheien commented Dec 27, 2024

For example, access control information can be added at the icon location.
However, it is known that clangd currently does not return access spec information, while ctags can.

local access_icons = {
  public = '',
  protected = '',
  private = '',
}
    ...
    icon_fetcher = function(kindstr, bufnr, symbol) ---@diagnostic disable-line
      local cfg = require('outline.config')
      local icon = cfg.o.symbols.icons[kindstr].icon
      if symbol and symbol.access then
        return icon .. ' ' .. access_icons[symbol.access]
      end
      return icon
    end,
    ...

Copy link
Owner

@hedyhli hedyhli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great idea. Thanks! Could you update the readme to reflect this new parameter, and add an example for it such as the example you showed?

@epheien
Copy link
Author

epheien commented Dec 27, 2024

Done.

Copy link
Owner

@hedyhli hedyhli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright. Thanks for adding this.

@hedyhli hedyhli merged commit 12ec5f2 into hedyhli:main Jan 5, 2025
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.

2 participants