elixir-editors / elixir-sublime-syntax

The most powerful Elixir for the most Sublime experience.
MIT License
46 stars 6 forks source link

"Find symbol in project" does not show nested modules #60

Closed demoj1 closed 1 year ago

demoj1 commented 1 year ago

Hi, thanks for work.

I have a large code base with many nested modules. I often use sublime function "find symbol in project". But sublime show only tail name, it make difficult find deep nested modules.

For example, i have set of modules: Foo.A.B.C.D.E.Repo Bar.A.B.C.D.E.Repo Buzz.A.B.C.D.E.Repo

When i call "find symbol in project" and type Repo, i see only one variant, but i would like start with: "Foo.A.B" and see what modules are there.

image

Click enter

image

For fix it i changed it rule:

variables:
  module_name: '[A-Z][a-zA-Z\d_]*+'
  atom_id_suffix: '[\w@]*+[?!]?+'

To:

variables:
  module_name: '[A-Z][\.?[A-Za-z\d_]+]*+' # <---------------
  atom_id_suffix: '[\w@]*+[?!]?+'

Now i can use fuzzy search like that:

image

Or if I want to restrict the search starting from:

image

But it break sublime goto, previously, i could put the cursor on the last part of the module name and press goto, now I can't, I have to select the module as a whole.

Maybe there is some way to fix it?

princemaple commented 1 year ago

That's tough luck... When the entity is indexed as a whole, the goto function doesn't find it. It appears that the goto function is not entity/syntax scoped. There might be better luck asking on Sublime Discord. https://forum.sublimetext.com/t/sublime-text-discord-server/26063

azizk commented 1 year ago

Yeah, I agree, it's tough luck. Not much we can do about it. It's a limitation of Sublime Text and I doubt they're gonna fix this or enhance it any time soon. It should ideally get the list of all symbols from the language server and maybe prioritize the module name over its fully qualified name when filtering...

azizk commented 1 year ago

Closing this because there's no real solution afaik.