Skip to content

Commit

Permalink
Use standard "python" language id, add support for missing .py exte…
Browse files Browse the repository at this point in the history
…nsion

https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocumentItem
has a list of language ids, and it recommends "python", not "py".
  • Loading branch information
jfly authored and elijah-potter committed Oct 23, 2024
1 parent 334434b commit 6539871
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion harper-comments/src/comment_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl CommentParser {
"rust" => tree_sitter_rust::language(),
"typescriptreact" => tree_sitter_typescript::language_tsx(),
"typescript" => tree_sitter_typescript::language_typescript(),
"py" => tree_sitter_python::language(),
"python" => tree_sitter_python::language(),
"javascript" => tree_sitter_javascript::language(),
"javascriptreact" => tree_sitter_typescript::language_tsx(),
"go" => tree_sitter_go::language(),
Expand Down Expand Up @@ -65,6 +65,7 @@ impl CommentParser {
/// [`Self::new_from_language_id`]
fn filename_to_filetype(path: &Path) -> Option<&'static str> {
Some(match path.extension()?.to_str()? {
"py" => "python",
"rs" => "rust",
"ts" => "typescript",
"tsx" => "typescriptreact",
Expand Down

0 comments on commit 6539871

Please sign in to comment.