1
1
mirror of https://github.com/github/semantic.git synced 2025-01-04 13:34:31 +03:00

Merge branch 'master' into log-file-paths-part-duex

This commit is contained in:
Rick Winfrey 2019-02-19 13:24:10 -08:00 committed by GitHub
commit a387750c0f
3 changed files with 22 additions and 0 deletions

View File

@ -187,6 +187,11 @@ message Symbol {
string kind = 2;
string line = 3;
Span span = 4;
Docstring docs = 5;
}
message Docstring {
string docstring = 1;
}
message Position {

View File

@ -76,4 +76,5 @@ parseSymbols blobs = ParseTreeSymbolResponse . V.fromList . toList <$> distribut
, kind = kind
, line = fromMaybe mempty line
, span = spanToSpan span
, docs = fmap Docstring docs
}

View File

@ -470,6 +470,7 @@ data Symbol = Symbol
, kind :: Text
, line :: Text
, span :: Maybe Span
, docs :: Maybe Docstring
} deriving stock (Eq, Ord, Show, Generic)
deriving anyclass (Named, FromJSON, ToJSON)
@ -479,12 +480,27 @@ instance Message Symbol where
, encodeMessageField 2 kind
, encodeMessageField 3 line
, encodeMessageField 4 (Nested span)
, encodeMessageField 5 (Nested docs)
]
decodeMessage _ = Symbol
<$> at decodeMessageField 1
<*> at decodeMessageField 2
<*> at decodeMessageField 3
<*> at decodeMessageField 4
<*> at decodeMessageField 5
dotProto = undefined
data Docstring = Docstring
{ docstring :: Text
} deriving stock (Eq, Ord, Show, Generic)
deriving anyclass (Named, FromJSON, ToJSON)
instance Message Docstring where
encodeMessage _ Docstring{..} = mconcat
[ encodeMessageField 1 docstring
]
decodeMessage _ = Docstring
<$> at decodeMessageField 1
dotProto = undefined
data Position = Position