SortJavaScriptImports.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. //===--- SortJavaScriptImports.h - Sort ES6 Imports -------------*- C++ -*-===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. ///
  9. /// \file
  10. /// This file implements a sorter for JavaScript ES6 imports.
  11. ///
  12. //===----------------------------------------------------------------------===//
  13. #ifndef LLVM_CLANG_LIB_FORMAT_SORTJAVASCRIPTIMPORTS_H
  14. #define LLVM_CLANG_LIB_FORMAT_SORTJAVASCRIPTIMPORTS_H
  15. #include "clang/Basic/LLVM.h"
  16. #include "clang/Format/Format.h"
  17. #include "llvm/ADT/ArrayRef.h"
  18. #include "llvm/ADT/StringRef.h"
  19. namespace clang {
  20. namespace format {
  21. // Sort JavaScript ES6 imports/exports in ``Code``. The generated replacements
  22. // only monotonically increase the length of the given code.
  23. tooling::Replacements sortJavaScriptImports(const FormatStyle &Style,
  24. StringRef Code,
  25. ArrayRef<tooling::Range> Ranges,
  26. StringRef FileName);
  27. } // end namespace format
  28. } // end namespace clang
  29. #endif