Skip to content
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

feat(vscode-plugin): Add Haskell Support #336

Merged
merged 4 commits into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading