This repository has been archived by the owner on Jul 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move OperatingSystem to Lib and add CodebaseApi
- Loading branch information
Showing
7 changed files
with
80 additions
and
33 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
module Code.CodebaseApi exposing (..) | ||
|
||
import Code.EntityId exposing (EntityId) | ||
import Code.FullyQualifiedName exposing (FQN) | ||
import Code.Perspective exposing (Perspective) | ||
import Code.Syntax as Syntax | ||
import Lib.Api as Api | ||
|
||
|
||
|
||
{- | ||
CodebaseApi | ||
=========== | ||
The CodebaseApi module, describes the endpoints used for the Code library to | ||
connect to a codebase, but is merely that; a description. Consumers of the Code | ||
library will need to provide an implementation of `ToApiEndpointUrl` in order | ||
to perform the actual HTTP requests. | ||
-} | ||
|
||
|
||
type CodebaseEndpoint | ||
= Find | ||
{ perspective : Perspective | ||
, withinFqn : Maybe FQN | ||
, limit : Int | ||
, sourceWidth : Syntax.Width | ||
, query : String | ||
} | ||
| Browse { perspective : Perspective, namespaceId : Maybe EntityId } | ||
| Definition { perspective : Perspective, definitionId : EntityId } | ||
|
||
|
||
type alias ToApiEndpointUrl = | ||
CodebaseEndpoint -> Api.EndpointUrl |
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,19 @@ | ||
module Code.EntityId exposing (EntityId, toString) | ||
|
||
import Code.FullyQualifiedName as FQN exposing (FQN) | ||
import Code.Hash as Hash exposing (Hash) | ||
|
||
|
||
type EntityId | ||
= HashId Hash | ||
| NameId FQN | ||
|
||
|
||
toString : EntityId -> String | ||
toString id = | ||
case id of | ||
HashId h -> | ||
Hash.toString h | ||
|
||
NameId fqn -> | ||
FQN.toString fqn |
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
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