Skip to content

Commit f2f9054

Browse files
Catherine Gasnierfacebook-github-bot
authored andcommitted
add a custom Swift schema extending the SCIP schema
Summary: This diff adds a custom Swift schema swift.angle which imports the scip schema. This should allow more flexibility in how we index swift in the future. The schema contains one predicate for now, SymbolLanguage, matching symbols to languages. This will allow to fix cross language references, which is currently broken. Currently, it relies on symbols starting with `c:objc`, but that's unfortunately not always correct. Some ObjC symbols are of the form `c:@...@objc`. In a future diff, we'll modify the indexer to demangle symbols and detect that pattern to add facts in this new predicate (for now, a vague proof of concept is in D79262434). Reviewed By: aahanaggarwal Differential Revision: D79261787 fbshipit-source-id: fbfaaa7e5fce433eee3fed0536baec48f0f19571
1 parent d71b844 commit f2f9054

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

glean/schema/source/swift.angle

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright (c) Meta, Inc. and affiliates.
2+
3+
schema swift.1 {
4+
5+
import scip.1
6+
import lsif.types.1
7+
8+
predicate SymbolLanguage:
9+
{
10+
symbol: scip.Symbol,
11+
language: lsif.types.LanguageId
12+
}
13+
}

0 commit comments

Comments
 (0)