This will allow us to add code completion, which is too expensive at
every token, to --check too.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Thanks! Just some random nits/ideas.
clang-tools-extra/clangd/tool/Check.cpp | ||
---|---|---|
206 | you already have the line number as Pos.start.line | |
clang-tools-extra/clangd/tool/ClangdMain.cpp | ||
64 | You could also pass in a function_ref<bool(const Position&)> which feels a bit more self-documenting | |
352 | nit: check-lines, which documents the units? | |
354 | seems likely the common case will be a single line, and --check-range=254-254 is a little awkward. | |
921 | (I'd omit this if the flag is just ignored and harmless. There should be no danger of expecting it to check something if you didn't provide a filename...) |
addressed review comments + rebase to latest version
clang-tools-extra/clangd/tool/ClangdMain.cpp | ||
---|---|---|
354 | Good idea. Done | |
921 | I'd rather keep it. If you specify --check-lines without --check you're doing something wrong and going into LSP mode is unlikely to be useful. If it's part of the script, you might wait a minute or two until you realize it's not actually working. |
Still LG
clang-tools-extra/clangd/tool/ClangdMain.cpp | ||
---|---|---|
898–917 | nit: consider pulling out a helper function to parse this that returns std:;function |
clang-tools-extra/clangd/tool/ClangdMain.cpp | ||
---|---|---|
898–917 | It gets a bit ugly, since we need a way to report an error. So it's either returning some ErrorOr<std::function> or elog() + exit(1) from a getShouldCheckLines() function. If you prefer, I can do that, but I feel like this will hurt readability because of the error handling. |
you already have the line number as Pos.start.line