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

[Feature request] Add support for Makefile's #108

Closed
lixvbnet opened this issue May 27, 2022 · 6 comments
Closed

[Feature request] Add support for Makefile's #108

lixvbnet opened this issue May 27, 2022 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@lixvbnet
Copy link

Is it possible to add support for Makefile's? (e.g. list all make targets). It would make it easier to navigate a large Makefile. (There seems to be no LSP for Makefile)

@stevearc
Copy link
Owner

Done! Support added for treesitter backend. It's pretty basic, just enumerating all the rules. LMK if you think there's anything else that could be added.

@lixvbnet
Copy link
Author

@stevearc this works great for me! Thank you for making this happen! 👍

@lixvbnet
Copy link
Author

@stevearc Btw, how do I customize the icon, or could you change the default one? (for Makefile only, other icons look beautiful). I'd like to set it to be like that in IDEA, which looks prettier,

image

@lixvbnet lixvbnet reopened this May 27, 2022
@stevearc
Copy link
Owner

At the moment the symbol types are tied to the LSP spec, so I used 'Interface' (customized by icons = { Interface = '' } option in setup). I think that, now that aerial supports Makefiles, markdown, and rst, perhaps it's time to extend the symbol spec. I'll investigate that this weekend

@stevearc
Copy link
Owner

Okay I wrote up an implementation that added a Title symbol, tested it, committed it, and then scrapped it because I didn't like the approach 😅

What I ended up doing instead was making the icons option take a filetype map. This means that you can specify the icons directly (this was how it worked before):

require('aerial').setup({
  icons = {
    Interface = 'I',
    Function = 'F',
  }
})

OR you can specify them on a per-filetype basis

require('aerial').setup({
  icons = {
    markdown = {
      Interface = 'I',
    },
    make = {
      Interface = 'T',
    },
    ['_'] = {
      -- The underscore key is for any unmatched filetypes
    },
  }
})

This should allow you to customize the icons for any filetype as much as you want.

@lixvbnet
Copy link
Author

image

Bravo!! 🎉🎉

(I customized the hightlight to use the blue color from 'Function')

aerial.setup {
    icons = {
         markdown = {
            Interface = "I",
         },
         make = {
            Interface = "",
         },
         ["_"] = {
            -- The underscore key is for any unmatched filetypes
         },
      },
}

vim.cmd([[
      " customize highlight
      hi link AerialInterfaceIcon Function
]])

Many thanks! @stevearc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants