Skip to content

Commit 6480bfa

Browse files
committed
[gardening] Move FuzzyStringMatcher to libIDE
1 parent d3f0de8 commit 6480bfa

File tree

6 files changed

+17
-14
lines changed

6 files changed

+17
-14
lines changed

tools/SourceKit/include/SourceKit/Support/FuzzyStringMatcher.h renamed to include/swift/IDE/FuzzyStringMatcher.h

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,23 @@
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
99
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#ifndef LLVM_SOURCEKIT_LIB_SUPPORT_FUZZYSTRINGMATCHER_H
14-
#define LLVM_SOURCEKIT_LIB_SUPPORT_FUZZYSTRINGMATCHER_H
13+
#ifndef SWIFT_IDE_FUZZYSTRINGMATCHER_H
14+
#define SWIFT_IDE_FUZZYSTRINGMATCHER_H
1515

16-
#include "SourceKit/Core/LLVM.h"
16+
#include "swift/Basic/LLVM.h"
1717
#include "llvm/ADT/BitVector.h"
1818
#include <string>
1919

20-
namespace SourceKit {
20+
namespace swift {
21+
namespace ide {
2122

2223
/// FuzzyStringMatcher compares candidate strings against a pattern
2324
/// string using a fuzzy matching algorithm and provides a numerical
@@ -49,6 +50,7 @@ class FuzzyStringMatcher {
4950
double scoreCandidate(StringRef candidate) const;
5051
};
5152

52-
} // end namespace SourceKit
53+
} // namespace ide
54+
} // namespace swift
5355

54-
#endif // LLVM_SOURCEKIT_LIB_SUPPORT_FUZZYSTRINGMATCHER_H
56+
#endif // SWIFT_IDE_FUZZYSTRINGMATCHER_H

lib/IDE/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ add_swift_host_library(swiftIDE STATIC
77
ConformingMethodList.cpp
88
ExprContextAnalysis.cpp
99
Formatting.cpp
10+
FuzzyStringMatcher.cpp
1011
Refactoring.cpp
1112
ModuleInterfacePrinting.cpp
1213
REPLCodeCompletion.cpp

tools/SourceKit/lib/Support/FuzzyStringMatcher.cpp renamed to lib/IDE/FuzzyStringMatcher.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,21 @@
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
99
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#include "SourceKit/Support/FuzzyStringMatcher.h"
13+
#include "swift/IDE/FuzzyStringMatcher.h"
1414
#include "clang/Basic/CharInfo.h"
1515
#include "llvm/ADT/ArrayRef.h"
1616
#include "llvm/ADT/SmallString.h"
1717

18-
using namespace SourceKit;
18+
using namespace swift;
19+
using namespace swift::ide;
1920
using clang::toUppercase;
2021
using clang::toLowercase;
2122
using clang::isUppercase;

tools/SourceKit/lib/Support/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
add_sourcekit_library(SourceKitSupport
22
Concurrency-libdispatch.cpp
3-
FuzzyStringMatcher.cpp
43
Logging.cpp
54
ImmutableTextBuffer.cpp
65
ThreadSafeRefCntPtr.cpp

tools/SourceKit/lib/SwiftLang/CodeCompletionOrganizer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
#include "CodeCompletionOrganizer.h"
14-
#include "SourceKit/Support/FuzzyStringMatcher.h"
1514
#include "swift/AST/ASTContext.h"
1615
#include "swift/AST/Module.h"
1716
#include "swift/IDE/CodeCompletionResultPrinter.h"
17+
#include "swift/IDE/FuzzyStringMatcher.h"
1818
#include "swift/Frontend/Frontend.h"
1919
#include "swift/Markup/XMLUtils.h"
2020
#include "clang/Basic/CharInfo.h"

unittests/SourceKit/Support/FuzzyStringMatcherTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#include "SourceKit/Support/FuzzyStringMatcher.h"
13+
#include "swift/IDE/FuzzyStringMatcher.h"
1414
#include "gtest/gtest.h"
1515

16-
using FuzzyStringMatcher = SourceKit::FuzzyStringMatcher;
16+
using FuzzyStringMatcher = swift::ide::FuzzyStringMatcher;
1717

1818
TEST(FuzzyStringMatcher, BasicMatching) {
1919
{

0 commit comments

Comments
 (0)