Repository navigation
feat: rewrite the scanner in C - #56
Conversation
|
Hey @amaanq, thanks for the PR :) I think there are a couple other places to adjust with relation to bindings (ref), can you also please adjust those? (FTR why we switch tree-sitter/tree-sitter-cpp#209) |
| // =, ==, ===, =~, => | ||
| } else if (lexer->lookahead == '=') { |
There was a problem hiding this comment.
Ideally, I would keep the original formatting :)
There was a problem hiding this comment.
it'd be nice if there was a clang-format file for that standard..having to manually do that is a bit annoying 😅 if the main want is indents being 2 spaces then thats much easier to do
There was a problem hiding this comment.
To be fair there is no standard, I didn't use a formatter :D
If there's an easy way to add a formatter task then that works for me (otherwise whoever changes the file may reformat it using different tool or IDE). Perhaps the clang-format npm package would do? Then we could add it to the formatting tasks we have:
tree-sitter-elixir/package.json
Lines 19 to 20 in 4ba9dab
There was a problem hiding this comment.
auto formatting happens from the clangd lsp, a .clang-format file in the project root can set this up easily and clangd will pick it up and override the users config. Here's my config for example to show you a few options that can be configured:
AlignArrayOfStructures: Left
BasedOnStyle: LLVM
IndentCaseLabels: true
IndentGotoLabels: true
IndentPPDirectives: AfterHash
IndentWidth: 4
KeepEmptyLinesAtTheStartOfBlocks: false
SeparateDefinitionBlocks: Always
SortIncludes: CaseInsensitive
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceBeforeCaseColon: falseRest are here https://clang.llvm.org/docs/ClangFormatStyleOptions.html
There was a problem hiding this comment.
Yeah, my point is that we should have a way to easily run it with CLI and also check formatting on CI. Here's the package I found, which as far as I understand calls the clang formatter.
There was a problem hiding this comment.
hmm..sure that could be fine - I'm not against it but a clang-format file could be enough if anyone's using the lsp/format
There was a problem hiding this comment.
Sure, but with the file alone we can't enforce it on CI, and we assume they use LSP (which for example I don't :)).
There was a problem hiding this comment.
Yep..understandable. Added the dep + format script, but it has no easy "just show me the errors" option so I just used diff (returns 1 on differences, 0 if none)
done |
|
Forgot to add the .clang-format file 🙈 |
|
thank you too! |
No description provided.