mirror of
https://github.com/github/semantic.git
synced 2024-11-24 00:42:33 +03:00
This should fix the issues associated with off-by-ones
This commit is contained in:
parent
39d9ad8e86
commit
b3eae027f6
@ -38,7 +38,7 @@ instance Primitive Language where
|
||||
primType _ = primType (Proxy @(Enumerated Language))
|
||||
encodePrimitive f = encodePrimitive f . Enumerated . Right
|
||||
decodePrimitive = decodePrimitive >>= \case
|
||||
(Enumerated (Right r)) -> pure (succ r)
|
||||
(Enumerated (Right r)) -> pure r
|
||||
other -> Prelude.fail ("Language decodeMessageField: unexpected value" <> show other)
|
||||
|
||||
-- | Returns a Language based on the file extension (including the ".").
|
||||
|
19
types.proto
19
types.proto
@ -3,14 +3,15 @@ package semantic;
|
||||
enum Language {Unknown = 0;
|
||||
Go = 1;
|
||||
Haskell = 2;
|
||||
JavaScript = 3;
|
||||
JSON = 4;
|
||||
JSX = 5;
|
||||
Markdown = 6;
|
||||
Python = 7;
|
||||
Ruby = 8;
|
||||
TypeScript = 9;
|
||||
PHP = 10;}
|
||||
Java = 3;
|
||||
JavaScript = 4;
|
||||
JSON = 5;
|
||||
JSX = 6;
|
||||
Markdown = 7;
|
||||
Python = 8;
|
||||
Ruby = 9;
|
||||
TypeScript = 10;
|
||||
PHP = 11;}
|
||||
message Blob { bytes blobSource = 1;
|
||||
string blobPath = 2;
|
||||
Language blobLanguage = 3;
|
||||
@ -43,4 +44,4 @@ message Term { oneof syntax {Array array = 1;
|
||||
KeyValue keyValue = 5;
|
||||
Null null = 6;
|
||||
TextElement textElement = 7;}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user