This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG5ab25a42ba70: Reland "[clang-repl] support code
completion at a REPL." (authored by capfredf, committed by v.g.vassilev).
Changed prior to commit:
capfredf updated this revision to Diff 554002.
capfredf added a comment.
fix memory issues
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154382/new/
https://reviews.llvm.org/D154382
Files:
clang-tools-extra/clangd/CodeComplete.cpp
clang/includ
capfredf updated this revision to Diff 553762.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154382/new/
https://reviews.llvm.org/D154382
Files:
clang-tools-extra/clangd/CodeComplete.cpp
clang/include/clang/Frontend/ASTUnit.h
clang/include/cla
capfredf updated this revision to Diff 553759.
capfredf added a comment.
fix potential memory issues
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154382/new/
https://reviews.llvm.org/D154382
Files:
clang-tools-extra/clangd/CodeComplete.cpp
cl
sammccall added inline comments.
Comment at: clang-tools-extra/clangd/CodeComplete.cpp:845
case CodeCompletionContext::CCC_NewName:
+ case CodeCompletionContext::CCC_TopLevelOrExpression:
return false;
This should be `true` rather than `false`, since bot
v.g.vassilev added inline comments.
Comment at: clang/unittests/Interpreter/CodeCompletionTest.cpp:38
+
+ std::vector Results;
+
We should make this an out parameter instead of returning it by copy.
Comment at: clang/unittests/Interpreter/Code
capfredf updated this revision to Diff 552736.
capfredf added a comment.
Herald added a subscriber: kadircet.
Herald added a project: clang-tools-extra.
fix code in Clangd
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154382/new/
https://reviews.ll
This revision was automatically updated to reflect the committed changes.
Closed by commit rGeb0e6c3134ef: [clang-repl] support code completion at a
REPL. (authored by capfredf, committed by v.g.vassilev).
Changed prior to commit:
https://reviews.llvm.org/D154382?vs=552418&id=552696#toc
Reposi
capfredf updated this revision to Diff 552418.
capfredf edited the summary of this revision.
capfredf added a comment.
update the commit message
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154382/new/
https://reviews.llvm.org/D154382
Files:
cl
v.g.vassilev accepted this revision.
v.g.vassilev added a comment.
Thanks for working on this @capfredf. Let me know if I should land that for you.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154382/new/
https://reviews.llvm.org/D154382
sammccall accepted this revision.
sammccall added a comment.
This revision is now accepted and ready to land.
LGTM, thanks!
Comment at: clang/include/clang/Sema/CodeCompleteConsumer.h:341
+
+/// Code completion at a top level in a REPL session.
+CCC_TopLevelOrExpression
v.g.vassilev added a comment.
@sammccall could you take another look? It seems quite ready to me to land.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154382/new/
https://reviews.llvm.org/D154382
___
cf
capfredf updated this revision to Diff 551218.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154382/new/
https://reviews.llvm.org/D154382
Files:
clang/include/clang/Frontend/ASTUnit.h
clang/include/clang/Interpreter/CodeCompletion.h
clang/incl
capfredf updated this revision to Diff 550940.
capfredf added a comment.
up
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154382/new/
https://reviews.llvm.org/D154382
Files:
clang/include/clang/Frontend/ASTUnit.h
clang/include/clang/Interprete
capfredf added a comment.
@sammccall Thank you very much for your valuable input.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154382/new/
https://reviews.llvm.org/D154382
___
cfe-commits mailing list
c
capfredf added inline comments.
Comment at: clang/include/clang/Frontend/ASTUnit.h:901
+SmallVectorImpl &OwnedBuffers,
+std::function
AfterBeginSourceFile = [](CompilerInstance& CI) -> void {});
sammccall wrote:
> capfre
capfredf updated this revision to Diff 550489.
capfredf marked 7 inline comments as done.
capfredf added a comment.
address @sammccall 's comments
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154382/new/
https://reviews.llvm.org/D154382
Files:
sammccall added a comment.
This mostly looks good.
My main concern is adding code to the parser to suppress errors when code
completing: this is unlikely to be the only such place. Existing consumers seem
happy to ignore errors, if this doesn't work for clang-repl it'd be good to
understand wh
capfredf updated this revision to Diff 549760.
capfredf added a comment.
format
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154382/new/
https://reviews.llvm.org/D154382
Files:
clang/include/clang/Frontend/ASTUnit.h
clang/include/clang/Interp
capfredf updated this revision to Diff 549759.
capfredf added a comment.
move everything into InterpreterCodeCompletion.
the entry point for code completion is now a function, codeCompletion
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154382/new/
v.g.vassilev added inline comments.
Comment at: clang/lib/Interpreter/CodeCompletion.cpp:1
+//===-- CodeCompletion.cpp - Code Completion for ClangRepl ---===//
+//
I would propose to rename this file to `InterpreterCodeCompletion.cpp` and
implement the `
capfredf updated this revision to Diff 549751.
capfredf added a comment.
use auto
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154382/new/
https://reviews.llvm.org/D154382
Files:
clang/include/clang/Frontend/ASTUnit.h
clang/include/clang/Inte
capfredf updated this revision to Diff 549750.
capfredf added a comment.
up
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154382/new/
https://reviews.llvm.org/D154382
Files:
clang/include/clang/Frontend/ASTUnit.h
clang/include/clang/Interprete
capfredf updated this revision to Diff 549749.
capfredf added a comment.
up
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154382/new/
https://reviews.llvm.org/D154382
Files:
clang/include/clang/Frontend/ASTUnit.h
clang/include/clang/Interprete
v.g.vassilev added a reviewer: sammccall.
v.g.vassilev added a subscriber: sammccall.
v.g.vassilev added a comment.
This looks mostly good to me. I noticed that @sammccall has done some work in
that area in clangd and I was wondering if he has some thoughts about this
patch.
Repository:
rG L
v.g.vassilev added inline comments.
Comment at: clang/lib/Interpreter/IncrementalParser.h:91
+
+class IncrementalSyntaxOnlyAction : public SyntaxOnlyAction {
+ const CompilerInstance *ParentCI;
Can we not move this class definition locally to the CodeComplete in
capfredf updated this revision to Diff 549739.
capfredf added a comment.
Herald added a subscriber: ChuanqiXu.
changes per discussions
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154382/new/
https://reviews.llvm.org/D154382
Files:
clang/includ
capfredf added inline comments.
Comment at: clang/include/clang/Frontend/ASTUnit.h:901
+SmallVectorImpl &OwnedBuffers,
+std::function
AfterBeginSourceFile = [](CompilerInstance& CI) -> void {});
@v.g.vassilev Not sure i
capfredf updated this revision to Diff 549658.
capfredf added a comment.
use ASTUnit::codeComplete
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154382/new/
https://reviews.llvm.org/D154382
Files:
clang/include/clang/Frontend/ASTUnit.h
clang/i
capfredf updated this revision to Diff 547241.
capfredf marked 2 inline comments as done.
capfredf added a comment.
changes per discussions
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154382/new/
https://reviews.llvm.org/D154382
Files:
clang/i
capfredf marked 5 inline comments as done.
capfredf added inline comments.
Comment at: clang/lib/Interpreter/CodeCompletion.cpp:111
+ auto *CConsumer = new ReplCompletionConsumer(Results);
+ auto Interp = Interpreter::createForCodeCompletion(
+ CB, MainInterp.getCompilerIn
v.g.vassilev added a comment.
I think we are getting there. I added a few suggestions how to improve the
current design.
Comment at: clang/include/clang/Interpreter/CodeCompletion.h:15
+#define LLVM_CLANG_INTERPRETER_CODE_COMPLETION_H
+#include "llvm/LineEditor/LineEditor.h"
+
capfredf updated this revision to Diff 543000.
capfredf added a comment.
changes per @v.g.vassilev's comments
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154382/new/
https://reviews.llvm.org/D154382
Files:
clang/include/clang/Interpreter/CodeC
v.g.vassilev added inline comments.
Comment at: clang/unittests/Interpreter/CodeCompletionTest.cpp:71
+Completer(std::string("void app("), 9);
+ EXPECT_EQ((size_t)0, out.length());
+}
capfredf wrote:
> @v.g.vassilev The way I fixed this is a bit hacky. Do yo
capfredf added inline comments.
Comment at: clang/unittests/Interpreter/CodeCompletionTest.cpp:71
+Completer(std::string("void app("), 9);
+ EXPECT_EQ((size_t)0, out.length());
+}
@v.g.vassilev The way I fixed this is a bit hacky. Do you have a better idea?
capfredf updated this revision to Diff 542622.
capfredf added a comment.
handle cases where code completion in a function declaration
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154382/new/
https://reviews.llvm.org/D154382
Files:
clang/include
capfredf updated this revision to Diff 541753.
capfredf added a comment.
Remove unnecessary braces
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154382/new/
https://reviews.llvm.org/D154382
Files:
clang/include/clang/Interpreter/CodeCompletion.h
capfredf added inline comments.
Comment at: clang/lib/Interpreter/CodeCompletion.cpp:102
+ std::vector Results;
+ auto *CConsumer = new ReplCompletionConsumer(Results);
+ auto Interp = Interpreter::createForCodeCompletion(
v.g.vassilev wrote:
> Let's move this
capfredf added inline comments.
Comment at: clang/lib/Interpreter/Interpreter.cpp:304
+llvm::Expected>
+Interpreter::createForCodeCompletion(
+IncrementalCompilerBuilder &CB, const CompilerInstance *ParentCI,
v.g.vassilev wrote:
> I still do not entirely unde
v.g.vassilev added inline comments.
Comment at: clang/include/clang/Sema/CodeCompleteConsumer.h:342
+/// Code completion at a top level in a REPL session.
+CCC_ReplTopLevel,
};
Comment at: clang/lib/Interpreter/CodeCompletion.cpp:10
capfredf updated this revision to Diff 539578.
capfredf edited the summary of this revision.
capfredf added a comment.
@v.g.vassilev I moved the ReplCodeCompletionConsumer class out of the header
file, since it is not needed elsewhere.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST A
capfredf updated this revision to Diff 539572.
capfredf marked 2 inline comments as done.
capfredf edited the summary of this revision.
capfredf added a comment.
Herald added a subscriber: arphaman.
- rename
- Do not export ReplCompletionConsumer
- remove commented code
Repository:
rG LLVM Git
capfredf marked 5 inline comments as done.
capfredf added inline comments.
Comment at: clang/include/clang/Interpreter/Interpreter.h:117
ASTContext &getASTContext();
+ void CodeComplete(llvm::StringRef Input, size_t Col, size_t Line = 1);
const CompilerInstance *getCompile
v.g.vassilev added a reviewer: aaron.ballman.
v.g.vassilev added a subscriber: aaron.ballman.
v.g.vassilev added a comment.
@capfredf this seems to be heading in a good direction. Please find another
round of comments.
@aaron.ballman, I could not find a person that's active in that area. Could y
capfredf updated this revision to Diff 537933.
capfredf marked an inline comment as not done.
capfredf added a comment.
get rid of the wrapping
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154382/new/
https://reviews.llvm.org/D154382
Files:
cla
capfredf marked an inline comment as not done.
capfredf added inline comments.
Comment at: clang/lib/Interpreter/CodeCompletion.cpp:84
+ std::string AllCodeText =
+ MainInterp.getAllInput() + "\nvoid dummy(){\n" + Buffer.str() + "}";
+ auto Lines = std::count(AllCodeText.b
capfredf updated this revision to Diff 537915.
capfredf added a comment.
remove an unused decl
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154382/new/
https://reviews.llvm.org/D154382
Files:
clang/include/clang/Interpreter/CodeCompletion.h
c
capfredf updated this revision to Diff 537912.
capfredf added a comment.
move the comment up
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154382/new/
https://reviews.llvm.org/D154382
Files:
clang/include/clang/Interpreter/CodeCompletion.h
cla
capfredf updated this revision to Diff 537910.
capfredf added a comment.
move the comment up
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154382/new/
https://reviews.llvm.org/D154382
Files:
clang/lib/Interpreter/CodeCompletion.cpp
Index: clan
capfredf updated this revision to Diff 537883.
capfredf edited the summary of this revision.
capfredf added a comment.
update
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154382/new/
https://reviews.llvm.org/D154382
Files:
clang/include/clang/I
capfredf updated this revision to Diff 537766.
capfredf edited the summary of this revision.
capfredf added a comment.
changes per discussions
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154382/new/
https://reviews.llvm.org/D154382
Files:
clan
capfredf added inline comments.
Comment at: clang/lib/Interpreter/CodeCompletion.cpp:84
+ std::string AllCodeText =
+ MainInterp.getAllInput() + "\nvoid dummy(){\n" + Buffer.str() + "}";
+ auto Lines = std::count(AllCodeText.begin(), AllCodeText.end(), '\n') + 1;
-
v.g.vassilev added a comment.
Can you extend the commit log to include a description of how things are
currently done? For example, it would be good to read about design and
technical decisions, etc.
Comment at: clang/lib/Interpreter/CodeCompletion.cpp:79
+ if (auto Err = In
capfredf created this revision.
capfredf added a reviewer: v.g.vassilev.
Herald added a project: All.
capfredf requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
This patch enabled users to use code completion in a REPL session. The solution
54 matches
Mail list logo