add support for haskell projects
@@ -38,6 +38,16 @@ def getRootPath(filepath: str, languageId: str) -> str:
rootPath = traverseUp(filepath, isDotnetRoot)
elif languageId == "java":
rootPath = traverseUp(filepath, isJavaRoot)
+ elif languageId == "haskell":
+ rootPath = (traverseUp(
+ filepath,
+ lambda folder:
+ os.path.exists(os.path.join(folder, "stack.yaml"))) or
+ traverseUp(
+ filepath,
+ lambda folder:
+ os.path.exists(os.path.join(folder, ".cabal"))))
+
# TODO: detect for other filetypes
if not rootPath:
rootPath = traverseUp(
@@ -81,7 +91,6 @@ def isJavaRoot(folder: str) -> bool:
return False
-
def pathToURI(filepath: str) -> str:
if not os.path.isabs(filepath):
return None
