Commit 6d8c160
check if a file is in a project when it opens
Summary:
ELP has an assumption that all the files belonging to a given project have some common root directory, and when using buck this is marked by an `.elp.toml` file.
Now that we are using buck to generate some files as part of the build process, this assumption is no longer valid, as the generated files end up in the `buck out` directory, which is outside the normal project.
Further, ELP can handle more than one project at a time. So when a new file is opened in the client, we check if it belongs to one of the existing projects, and if not we configure a new project for it.
This leads to a situation where if we open one of the generated files, ELP will try to make a new project for it. This causes the ELP project-wide information to become invalid, as it is now spread over more than one. In particular this shows up as generated include files no longer being resolved.
## This diff
This diff addresses the issue by making use of the fact that every file in a buck project is explicitly enumerated, precisely because there it no simple directory enclosure mechanism to determine project owner.
So when a new file is opened, provided ELP is already in `Running` state and thus the internal database is valid, we check if the file is already known. If so we do not check for a possible new project.
Reviewed By: robertoaloi
Differential Revision: D85234832
fbshipit-source-id: 4858bbfa2d51d1e3f030f666f706a2ffb155e0f11 parent f417b8a commit 6d8c160
1 file changed
+26
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
724 | 724 | | |
725 | 725 | | |
726 | 726 | | |
727 | | - | |
728 | | - | |
| 727 | + | |
729 | 728 | | |
730 | 729 | | |
731 | 730 | | |
732 | 731 | | |
733 | | - | |
| 732 | + | |
734 | 733 | | |
735 | 734 | | |
736 | 735 | | |
737 | 736 | | |
738 | 737 | | |
739 | 738 | | |
740 | 739 | | |
741 | | - | |
742 | | - | |
| 740 | + | |
| 741 | + | |
743 | 742 | | |
744 | 743 | | |
745 | | - | |
746 | | - | |
747 | | - | |
748 | | - | |
749 | | - | |
750 | | - | |
751 | | - | |
752 | | - | |
753 | | - | |
754 | | - | |
755 | | - | |
756 | | - | |
757 | | - | |
758 | | - | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
759 | 766 | | |
760 | 767 | | |
761 | 768 | | |
| |||
0 commit comments