-
Notifications
You must be signed in to change notification settings - Fork 10.5k
/
Copy pathNullEditorConsumer.h
64 lines (46 loc) · 2.27 KB
/
NullEditorConsumer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
#include "SourceKit/Core/LangSupport.h"
namespace SourceKit {
class NullEditorConsumer : public EditorConsumer {
bool needsSemanticInfo() override { return needsSema; }
void handleRequestError(const char *Description) override {
llvm_unreachable("unexpected error");
}
bool syntaxMapEnabled() override { return true; }
void handleSyntaxMap(unsigned Offset, unsigned Length, UIdent Kind) override {
}
void handleSemanticAnnotation(unsigned Offset, unsigned Length, UIdent Kind,
bool isSystem) override {}
bool documentStructureEnabled() override { return false; }
void beginDocumentSubStructure(
unsigned Offset, unsigned Length, UIdent Kind, UIdent AccessLevel,
UIdent SetterAccessLevel, unsigned NameOffset, unsigned NameLength,
unsigned BodyOffset, unsigned BodyLength, unsigned DocOffset,
unsigned DocLength, StringRef DisplayName, StringRef TypeName,
StringRef RuntimeName, StringRef SelectorName,
ArrayRef<StringRef> InheritedTypes,
ArrayRef<std::tuple<UIdent, unsigned, unsigned>> Attrs) override {}
void endDocumentSubStructure() override {}
void handleDocumentSubStructureElement(UIdent Kind, unsigned Offset,
unsigned Length) override {}
void recordAffectedRange(unsigned Offset, unsigned Length) override {}
void recordAffectedLineRange(unsigned Line, unsigned Length) override {}
bool diagnosticsEnabled() override { return false; }
void handleDiagnostics(ArrayRef<DiagnosticEntryInfo> DiagInfos,
UIdent DiagStage) override {}
void recordFormattedText(StringRef Text) override {}
void handleSourceText(StringRef Text) override {}
public:
bool needsSema = false;
};
} // end namespace SourceKit