From fe43ce202d38fd7a90d9dec8cf0b61715935b796 Mon Sep 17 00:00:00 2001 From: Roman Perehonchuk Date: Wed, 10 Apr 2024 06:36:18 -0700 Subject: [PATCH] comments schema for erlang Summary: add comments predicate to erlang schema according to the [docs](https://www.internalfb.com/intern/staticdocs/glean/docs/schema/changing/) it should be backward compatible www sync: D55924286 Reviewed By: phlalx Differential Revision: D55917964 fbshipit-source-id: 753a00ceb8fba34bbd34cb4d363c5ef002823e45 --- glean/schema/source/codemarkup.angle | 3 +++ glean/schema/source/codemarkup.erlang.angle | 11 +++++++++++ glean/schema/source/erlang.angle | 8 ++++++++ 3 files changed, 22 insertions(+) diff --git a/glean/schema/source/codemarkup.angle b/glean/schema/source/codemarkup.angle index 65747b504..ad50e50e4 100644 --- a/glean/schema/source/codemarkup.angle +++ b/glean/schema/source/codemarkup.angle @@ -763,6 +763,9 @@ predicate EntityComments: { java = Decl } = Entity; codemarkup.java.JavaEntityDocumentation { Decl, File, Span }; nothing = Text + ) | ( + { erlang = Decl } = Entity; + codemarkup.erlang.ErlangEntityDocumentation { Decl, File, Span, Text} ) | ( { fbthrift = Decl } = Entity; codemarkup.fbthrift.FbthriftEntityDocumentation { Decl, File, Span }; diff --git a/glean/schema/source/codemarkup.erlang.angle b/glean/schema/source/codemarkup.erlang.angle index 21ff89b0d..e3ca73524 100644 --- a/glean/schema/source/codemarkup.erlang.angle +++ b/glean/schema/source/codemarkup.erlang.angle @@ -92,4 +92,15 @@ predicate ErlangEntityInfo: { E, { kind = K, isAbstract = false } } where ErlangEntityKind { E, K } + predicate ErlangEntityDocumentation : + { + entity : code.erlang.Entity, + file : src.File, + span : src.ByteSpan, + text : maybe string, + } + { Entity, File, Span, Text } where + { decl = Decl } = Entity; + erlang.DeclarationComment { Decl1, File, Span, Text }; + erlang.Declaration { func = Decl1 } = Decl } diff --git a/glean/schema/source/erlang.angle b/glean/schema/source/erlang.angle index b54382faf..24a2e4530 100644 --- a/glean/schema/source/erlang.angle +++ b/glean/schema/source/erlang.angle @@ -20,6 +20,14 @@ predicate FunctionDeclaration : span : src.ByteSpan, } +predicate DeclarationComment: + { + declaration : FunctionDeclaration, + file : src.File, + span : src.ByteSpan, + text : maybe string, + } + ## types type Declaration =