-
Notifications
You must be signed in to change notification settings - Fork 457
Conversation
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.
Ready for review!
import Analysis.File as A | ||
import Analysis.Reference as A | ||
import Data.Aeson | ||
import Source.Language as Language | ||
import Source.Source as Source | ||
import qualified System.Path as Path | ||
import qualified System.Path.PartClass as Path.PartClass | ||
import Analysis.File as A | ||
import Analysis.Reference as A | ||
import Data.Aeson | ||
import Source.Language as Language | ||
import Source.Source as Source |
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.
Expect lots of this sort of thing due to autoformatter. Apologies.
Right pth <- fmap Path.parse (b .: "path") | ||
pth <- b .: "path" |
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.
Simpler terms.
fromSource :: Path.PartClass.AbsRel ar => Path.File ar -> Language -> Source -> Blob | ||
fromSource :: FilePath -> Language -> Source -> Blob |
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.
Simpler types.
blobFilePath = Path.toString . blobPath | ||
blobFilePath = blobPath |
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.
I opted not to eliminate this in favour of blobPath
because I didn't want to get dragged into that refactoring in the same PR. Still, it would be nice.
let ?project = Path.relDir "external/tree-sitter-ql" | ||
let ?project = "external/tree-sitter-ql" |
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.
We aren't currently building with bazel, but I did my best to keep these changes bazel-friendly at least.
useJD <- (Path.hasExtension ".json" (Path.absRel ref) &&) <$> fmap isJust (Path.findExecutable "jd") | ||
useJD <- (takeExtension ref == ".json" &&) <$> fmap isJust (findExecutable "jd") |
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.
pathtype
generally mimics filepath
's API pretty closely, so most of the changes either just drop conversions to/from strings, or drop the module prefix and use the mimicked symbol. In this case, pathtype
does something completely different for some reason, so there's some actual logic to this change.
I did double-check that takeExtension
returns the .
.
This PR removes uses of and dependencies on
pathtype
from the rest of the repo.Depends on #687. In particular, CI won't succeed until we publish
semantic-source
0.2 to hackage.