File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
lsif-java/src/main/scala/com/sourcegraph/lsif_java/commands Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -49,8 +49,8 @@ case class SnapshotLsifCommand(
4949 @ PositionalArguments () input : List [Path ] = List (Paths .get(" dump.lsif" ))
5050) extends Command {
5151
52- private val finalOutput = AbsolutePath .of(output, sourceroot)
5352 def sourceroot : Path = AbsolutePath .of(app.env.workingDirectory)
53+ private val finalOutput = AbsolutePath .of(output, sourceroot)
5454
5555 def run (): Int = {
5656 Files .walkFileTree(finalOutput, new DeleteVisitor ())
@@ -59,7 +59,12 @@ case class SnapshotLsifCommand(
5959 in = AbsolutePath .of(inputPath, sourceroot)
6060 doc <- SnapshotLsifCommand .parseTextDocument(in, sourceroot)
6161 } {
62- SnapshotCommand .writeSnapshot(doc, finalOutput)
62+ val docPath = AbsolutePath
63+ .of(Paths .get(doc.getUri), sourceroot)
64+ .toRealPath()
65+ if (docPath.toAbsolutePath.startsWith(sourceroot)) {
66+ SnapshotCommand .writeSnapshot(doc, finalOutput)
67+ }
6368 }
6469 0
6570 }
You can’t perform that action at this time.
0 commit comments