-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Dotnet Wrapper #390
Closed
TiwariAbhishek23
wants to merge
8
commits into
facebookincubator:main
from
TiwariAbhishek23:dotnet_wrapper
Closed
Added Dotnet Wrapper #390
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
800b626
updated CI for protobuf setup
TiwariAbhishek23 23dfe4d
updated the URL for test
TiwariAbhishek23 68316f2
Updated the ci path for protobuf
TiwariAbhishek23 c44c9b3
updated the path for ci
TiwariAbhishek23 50b3abf
Updated the arch from aarch to x86
TiwariAbhishek23 04d18f2
wrapper for dotnet
TiwariAbhishek23 1057825
removed extra code and white space
TiwariAbhishek23 0a46ffc
Merge branch 'facebookincubator:main' into dotnet_wrapper
TiwariAbhishek23 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{- | ||
Copyright (c) Meta Platforms, Inc. and affiliates. | ||
All rights reserved. | ||
|
||
This source code is licensed under the BSD-style license found in the | ||
LICENSE file in the root directory of this source tree. | ||
-} | ||
|
||
{-# LANGUAGE ApplicativeDo #-} | ||
module Glean.Indexer.DotnetScip ( indexer ) where | ||
|
||
import Options.Applicative | ||
|
||
import Glean.Indexer | ||
import Glean.Indexer.External (sendJsonBatches) | ||
import Glean.Indexer.SCIP (derive) | ||
import Glean.SCIP.Driver as SCIP | ||
|
||
newtype DotnetScip = DotnetScip { dotnetScipBinary :: FilePath } | ||
|
||
options :: Parser DotnetScip | ||
options = do | ||
dotnetScipBinary <- strOption $ | ||
long "scip-dotnet" <> | ||
value "scip-dotnet" <> | ||
help "path to scip-dotnet binary" | ||
return DotnetScip{..} | ||
|
||
indexer :: Indexer DotnetScip | ||
indexer = Indexer { | ||
indexerShortName = "dotnet-scip", | ||
indexerDescription = "Index C# code with `scip-dotnet`", | ||
indexerOptParser = options, | ||
indexerRun = \DotnetScip{..} backend repo IndexerParams{..} -> do | ||
val <- SCIP.runIndexer ScipIndexerParams { | ||
scipBinary = dotnetScipBinary, | ||
scipArgs = const [ "index"], | ||
scipRoot = indexerRoot, | ||
scipWritesLocal = True, | ||
scipLanguage = Just SCIP.CSharp | ||
} | ||
sendJsonBatches backend repo (dotnetScipBinary <> "/scip") val | ||
derive backend repo | ||
} |
21 changes: 21 additions & 0 deletions
21
glean/lang/dotnet-scip/tests/Glean/Regression/DotnetScip/Main.hs
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,21 @@ | ||
{- | ||
Copyright (c) Meta Platforms, Inc. and affiliates. | ||
All rights reserved. | ||
|
||
This source code is licensed under the BSD-style license found in the | ||
LICENSE file in the root directory of this source tree. | ||
-} | ||
|
||
module Glean.Regression.DotnetScip.Main ( main ) where | ||
|
||
import System.Environment | ||
|
||
import Glean.Indexer.DotnetScip as DotnetScip | ||
import Glean.Regression.Snapshot | ||
import Glean.Regression.Snapshot.Driver | ||
|
||
main :: IO () | ||
main = getArgs >>= \args -> withArgs (args ++ ["--root", path]) $ | ||
testMain (driverFromIndexer DotnetScip.indexer) | ||
where | ||
path = "glean/lang/dotnet-scip/tests/cases" | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add new line to end of file or linter will complain when we import it.