Skip to content

Commit

Permalink
Merge pull request #336 from mcecode/vscode-haskell-support
Browse files Browse the repository at this point in the history
feat(vscode-plugin): Add Haskell Support
  • Loading branch information
elijah-potter authored Dec 30, 2024
2 parents 25a110d + 5eb59f7 commit 2b1f4a5
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 3 deletions.
11 changes: 11 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions harper-comments/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ tree-sitter-bash = "0.20.0"
tree-sitter-java = "0.20.0"
tree-sitter-nix = "0.0.1"
itertools = "0.13.0"
tree-sitter-haskell = "0.15.0"

[dev-dependencies]
paste = "1.0.15"
2 changes: 2 additions & 0 deletions harper-comments/src/comment_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ impl CommentParser {
"lua" => tree_sitter_lua::language(),
"shellscript" => tree_sitter_bash::language(),
"java" => tree_sitter_java::language(),
"haskell" => tree_sitter_haskell::language(),
_ => return None,
};

Expand Down Expand Up @@ -85,6 +86,7 @@ impl CommentParser {
"sh" => "shellscript",
"bash" => "shellscript",
"java" => "java",
"hs" => "haskell",
_ => return None,
})
}
Expand Down
2 changes: 1 addition & 1 deletion packages/vscode-plugin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Unreleased

- Linting Python, Shellscript/Bash, and Git Commit files now work properly.
- Add support for Nix and Plaintext files.
- Add support for Haskell, Nix, and Plaintext files.
- Add the `harper-ls.path` setting to optionally use a different `harper-ls` executable.

## 0.12.0
Expand Down
1 change: 1 addition & 0 deletions packages/vscode-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"onLanguage:csharp",
"onLanguage:git-commit",
"onLanguage:go",
"onLanguage:haskell",
"onLanguage:html",
"onLanguage:java",
"onLanguage:javascript",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
main :: IO ()
-- Errorz
main = putStrLn "Hello World!"
5 changes: 3 additions & 2 deletions packages/vscode-plugin/src/tests/suite/languages.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ describe('Languages >', () => {
// Uncomment when #65 is fixed.
// { type: 'Shellscript without extension', file: 'shellscript', row: 2, column: 2 },

// VSCode doesn't support Nix and TOML files out of the box. Uncomment when you figure out how
// to support them during testing.
// VSCode doesn't support Haskell, Nix, and TOML files out of the box. Uncomment when you figure
// out how to support them during testing.
// { type: 'Haskell', file: 'haskell.hs', row: 1, column: 3 },
// { type: 'Nix', file: 'nix.nix', row: 1, column: 2 },
// { type: 'TOML', file: 'toml.toml', row: 1, column: 2 },

Expand Down

0 comments on commit 2b1f4a5

Please sign in to comment.