Open lczech opened 6 years ago
Excellent point. I don't see how anyone would need to switch to a header or source in a different project.
On that note, I also sometimes have trouble with files named the same, but in different directories. For example, foo.hpp
header and foo.cpp
implementation in on dir, and foo.cpp
in the test dir. I tried changing the regex to start with ^
, so that the whole directory is matched only, but that also just resulted in opening the file from the other project, as explained above.
Is there a way to tell the plugin to prefer opening files from the same dir?
Is there a way to tell the plugin to prefer opening files from the same dir?
I see a problem in the switchMap
design.
Currently, the switchMap
is built with basename as key, and a list of full paths as value. In this list, files can be found in multiple projects, and they can even have the same name (not only basename, e.g. ["src/Class.h", "tst/Class.h"]
), resulting in a weird source switching.
This map should index things differently to solve different pending issues. Let's start with one thought:
"Class.h"
["src/Class.cpp", "tst/Class.cpp"]
This is a start, and a call for ideas. Maybe the full path should be used in the key? Of course, the map will use more memory… But we don't need a light-but-buggy packages :smile:
The configuration says
but it opens files from other Project Folders, too. In my particular case, I am working on a library, but also have a project that uses the library as a git submodule. So, when invoking the plugin, it sometimes switches to the copy in the submodule...