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

Incorrect switch if same file name exists elsewhere #32

Open
tophmatthews opened this issue May 14, 2018 · 5 comments
Open

Incorrect switch if same file name exists elsewhere #32

tophmatthews opened this issue May 14, 2018 · 5 comments

Comments

@tophmatthews
Copy link

When on test/src/kernels/MatDiffusion.C, switch goes to modules/phase_field_include/kernels/MatDiffusion.h

@dschwen
Copy link
Owner

dschwen commented May 14, 2018

Yeah, that's a tough one. How to you propose this should be handled?

@tophmatthews
Copy link
Author

Only having one MatDiffusion in the repo? I'm surprised that is even "allowed".

The other way would be to check the path that differs by the include or src subdirectory first.

@dschwen
Copy link
Owner

dschwen commented May 14, 2018

They are never both used in the same app. The include/src check would severely limit the usefulness of the plugin (I use it to switch between .h,.C, and .md files using (.*)(\.(h|C|md))$ as my _Tracked file regular expression`).

@tophmatthews
Copy link
Author

They aren't used in the same app, but they're still all accessible in my atom Moose window. I didn't know you could switch with the md now, that's handy.

All in all, not really a big deal since this seems like a one-off. Just an FYI.

@maddanio
Copy link

How about preferring switch targets by "closeness" in filesystem? At the very least on name colisions prefer the one that is in the same directory, and beyond that maybe use a metric based on how far apart in the directory tree two files are? should be simple, no? at least the "same dir" check should be. would help a lot :).

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

No branches or pull requests

3 participants