-
Notifications
You must be signed in to change notification settings - Fork 304
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow to have non-existent import entries in
projectview
that point…
…ing to … (#5689) * Introduce `try_import` directive for project view files that allows to have non-existent entries in `projectview` that pointing to optional files missing for some of the users
- Loading branch information
1 parent
76ff407
commit fec469b
Showing
12 changed files
with
126 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
base/src/com/google/idea/blaze/base/projectview/section/sections/TryImportSection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.google.idea.blaze.base.projectview.section.sections; | ||
|
||
import com.google.idea.blaze.base.model.primitives.WorkspacePath; | ||
import com.google.idea.blaze.base.projectview.parser.ParseContext; | ||
import com.google.idea.blaze.base.projectview.parser.ProjectViewParser; | ||
import com.google.idea.blaze.base.projectview.section.ScalarSection; | ||
import com.google.idea.blaze.base.projectview.section.SectionKey; | ||
import com.google.idea.blaze.base.projectview.section.SectionParser; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
/** "try_import" section. */ | ||
public class TryImportSection extends ImportSection { | ||
|
||
public static final SectionKey<WorkspacePath, ScalarSection<WorkspacePath>> KEY = | ||
SectionKey.of("try_import"); | ||
|
||
public static final SectionParser PARSER = new TryImportSectionParser(); | ||
|
||
private static class TryImportSectionParser extends ImportSectionParser { | ||
|
||
public TryImportSectionParser() { | ||
super(KEY, ' '); | ||
} | ||
|
||
@Nullable | ||
@Override | ||
protected WorkspacePath parseItem( | ||
ProjectViewParser parser, ParseContext parseContext, String text) { | ||
return parseItem(parser, parseContext, text, false); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters