-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Promote synthetic definitions into normal definitions if they share n…
…ames Previously, we generated synthetic definitions for all synthetic definitions. However, this meant that "find references" never showed results for synthetic symbols share the same name as the non-synthetic definition. This commit changes that so synthetic definitions that share the same name as the non-synthetic symbol are included with "find references" results. While testing this change I noticed that we don't handle synthetic constructor parameters so I added support for those along the way.
- Loading branch information
Showing
18 changed files
with
192 additions
and
108 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
26 changes: 26 additions & 0 deletions
26
lsif-semanticdb/src/main/java/com/sourcegraph/lsif_semanticdb/SymbolOccurrences.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,26 @@ | ||
package com.sourcegraph.lsif_semanticdb; | ||
|
||
import com.sourcegraph.semanticdb_javac.Semanticdb; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class SymbolOccurrences { | ||
public List<Semanticdb.SymbolOccurrence> occurrences = new ArrayList<>(); | ||
|
||
public void addSyntheticDefinition(String sym) { | ||
occurrences.add( | ||
Semanticdb.SymbolOccurrence.newBuilder() | ||
.setSymbol(sym) | ||
.setRole(Semanticdb.SymbolOccurrence.Role.SYNTHETIC_DEFINITION) | ||
.build()); | ||
} | ||
|
||
public void addDefinition(String sym) { | ||
occurrences.add( | ||
Semanticdb.SymbolOccurrence.newBuilder() | ||
.setSymbol(sym) | ||
.setRole(Semanticdb.SymbolOccurrence.Role.DEFINITION) | ||
.build()); | ||
} | ||
} |
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
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
Oops, something went wrong.