Author: hokein Date: Thu Jan 3 07:36:18 2019 New Revision: 350325 URL: http://llvm.org/viewvc/llvm-project?rev=350325&view=rev Log: [clangd] Move helpers from global namespace into anonymous namespace, NFC.
Modified: clang-tools-extra/trunk/clangd/CodeComplete.cpp Modified: clang-tools-extra/trunk/clangd/CodeComplete.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/CodeComplete.cpp?rev=350325&r1=350324&r2=350325&view=diff ============================================================================== --- clang-tools-extra/trunk/clangd/CodeComplete.cpp (original) +++ clang-tools-extra/trunk/clangd/CodeComplete.cpp Thu Jan 3 07:36:18 2019 @@ -1152,28 +1152,6 @@ Optional<FuzzyFindRequest> speculativeFu return CachedReq; } -} // namespace - -clang::CodeCompleteOptions CodeCompleteOptions::getClangCompleteOpts() const { - clang::CodeCompleteOptions Result; - Result.IncludeCodePatterns = EnableSnippets && IncludeCodePatterns; - Result.IncludeMacros = IncludeMacros; - Result.IncludeGlobals = true; - // We choose to include full comments and not do doxygen parsing in - // completion. - // FIXME: ideally, we should support doxygen in some form, e.g. do markdown - // formatting of the comments. - Result.IncludeBriefComments = false; - - // When an is used, Sema is responsible for completing the main file, - // the index can provide results from the preamble. - // Tell Sema not to deserialize the preamble to look for results. - Result.LoadExternal = !Index; - Result.IncludeFixIts = IncludeFixIts; - - return Result; -} - // Returns the most popular include header for \p Sym. If two headers are // equally popular, prefer the shorter one. Returns empty string if \p Sym has // no include header. @@ -1584,6 +1562,28 @@ private: } }; +} // namespace + +clang::CodeCompleteOptions CodeCompleteOptions::getClangCompleteOpts() const { + clang::CodeCompleteOptions Result; + Result.IncludeCodePatterns = EnableSnippets && IncludeCodePatterns; + Result.IncludeMacros = IncludeMacros; + Result.IncludeGlobals = true; + // We choose to include full comments and not do doxygen parsing in + // completion. + // FIXME: ideally, we should support doxygen in some form, e.g. do markdown + // formatting of the comments. + Result.IncludeBriefComments = false; + + // When an is used, Sema is responsible for completing the main file, + // the index can provide results from the preamble. + // Tell Sema not to deserialize the preamble to look for results. + Result.LoadExternal = !Index; + Result.IncludeFixIts = IncludeFixIts; + + return Result; +} + Expected<StringRef> speculateCompletionFilter(StringRef Content, Position Pos) { auto Offset = positionToOffset(Content, Pos); if (!Offset) _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits