Skip to content

Commit c1fff5e

Browse files
srawlinsCommit Queue
authored andcommitted
DAS: rename Kythe constants to be lowerCamelCase
Change-Id: I3b15e19c23a97a1ccaca569870b381f684e5ea18 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/459860 Reviewed-by: Keerti Parthasarathy <keertip@google.com> Commit-Queue: Samuel Rawlins <srawlins@google.com>
1 parent 6c0c10f commit c1fff5e

File tree

2 files changed

+58
-58
lines changed

2 files changed

+58
-58
lines changed

pkg/analysis_server/lib/src/services/kythe/kythe_visitors.dart

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ String? _getNodeKind(Element e) {
2626
if (e is FieldElement && e.isEnumConstant) {
2727
// FieldElement is a kind of VariableElement, so this test case must be
2828
// before the e is VariableElement check.
29-
return schema.CONSTANT_KIND;
29+
return schema.constantKind;
3030
} else if (e is VariableElement || e is PrefixElement) {
31-
return schema.VARIABLE_KIND;
31+
return schema.variableKind;
3232
} else if (e is ExecutableElement) {
33-
return schema.FUNCTION_KIND;
33+
return schema.functionKind;
3434
} else if (e is InterfaceElement || e is TypeParameterElement) {
3535
// TODO(jwren): this should be using absvar instead, see
3636
// https://kythe.io/docs/schema/#absvar
37-
return schema.RECORD_KIND;
37+
return schema.recordKind;
3838
}
3939
return null;
4040
}
@@ -82,7 +82,7 @@ String _getPath(
8282
}
8383

8484
/// If a non-null element is passed, the [_SignatureElementVisitor] is used to
85-
/// generate and return a [String] signature, otherwise [schema.DYNAMIC_KIND] is
85+
/// generate and return a [String] signature, otherwise [schema.dynamicKind] is
8686
/// returned.
8787
String _getSignature(
8888
ResourceProvider provider,
@@ -91,9 +91,9 @@ String _getSignature(
9191
String corpus, {
9292
String? sdkRootPath,
9393
}) {
94-
assert(nodeKind != schema.ANCHOR_KIND); // Call _getAnchorSignature instead
94+
assert(nodeKind != schema.anchorKind); // Call _getAnchorSignature instead
9595
if (element == null) {
96-
return schema.DYNAMIC_KIND;
96+
return schema.dynamicKind;
9797
}
9898
if (element is LibraryElement) {
9999
return _getPath(
@@ -118,14 +118,14 @@ class CiderKytheHelper {
118118

119119
/// Returns a URI that can be used to query Kythe.
120120
String toKytheUri(Element e) {
121-
var nodeKind = _getNodeKind(e) ?? schema.RECORD_KIND;
121+
var nodeKind = _getNodeKind(e) ?? schema.recordKind;
122122
var vname = _vNameFromElement(e, nodeKind);
123123
return 'kythe://$corpus?lang=dart?path=${vname.path}#${vname.signature}';
124124
}
125125

126126
/// Returns the Kythe name for the [element].
127127
_KytheVName _vNameFromElement(Element? e, String nodeKind) {
128-
assert(nodeKind != schema.FILE_KIND);
128+
assert(nodeKind != schema.fileKind);
129129
// general case
130130
return _KytheVName(
131131
path: _getPath(

pkg/analysis_server/lib/src/services/kythe/schema.dart

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -6,85 +6,85 @@
66
/// kythe.io/docs/schema/
77
library;
88

9-
const ANCHOR_END_FACT = '/kythe/loc/end';
9+
const anchorEndFact = '/kythe/loc/end';
1010

1111
/// Kythe node kinds
12-
const ANCHOR_KIND = 'anchor';
13-
const ANCHOR_START_FACT = '/kythe/loc/start';
12+
const anchorKind = 'anchor';
13+
const anchorStartFact = '/kythe/loc/start';
1414

1515
/// Kythe edge kinds
16-
const ANNOTATED_BY_EDGE = '${EDGE_PREFIX}annotatedby';
16+
const annotatedByEdge = '${edgePrefix}annotatedby';
1717

18-
const CHILD_OF_EDGE = '${EDGE_PREFIX}childof';
18+
const childOfEdge = '${edgePrefix}childof';
1919

2020
/// Kythe node subkinds
21-
const CLASS_SUBKIND = 'class';
21+
const classSubkind = 'class';
2222

23-
const COMPLETE_FACT = '/kythe/complete';
24-
const CONSTANT_KIND = 'constant';
23+
const completeFact = '/kythe/complete';
24+
const constantKind = 'constant';
2525

26-
const CONSTRUCTOR_SUBKIND = 'constructor';
26+
const constructorSubkind = 'constructor';
2727

2828
/// Dart specific facts, labels, and kinds
29-
const DART_LANG = 'dart';
29+
const dartLang = 'dart';
3030

3131
/// DEFAULT_TEXT_ENCODING is the assumed value of the TEXT_ENCODING_FACT if it
3232
/// is empty or missing from a node with a TEXT_FACT.
33-
const DEFAULT_TEXT_ENCODING = 'UTF-8';
34-
const DEFINES_BINDING_EDGE = '${EDGE_PREFIX}defines/binding';
33+
const defaultTextEncoding = 'UTF-8';
34+
const definesBindingEdge = '${edgePrefix}defines/binding';
3535

3636
/// Kythe edge kinds associated with anchors
37-
const DEFINES_EDGE = '${EDGE_PREFIX}defines';
37+
const definesEdge = '${edgePrefix}defines';
3838

39-
const DEFINITION = 'definition';
39+
const definition = 'definition';
4040

41-
const DOC_KIND = 'doc';
41+
const docKind = 'doc';
4242

43-
const DOCUMENTS_EDGE = '${EDGE_PREFIX}documents';
44-
const DYNAMIC_KIND = 'dynamic#builtin';
43+
const documentsEdge = '${edgePrefix}documents';
44+
const dynamicKind = 'dynamic#builtin';
4545

4646
/// EdgePrefix is the standard Kythe prefix for all edge kinds.
47-
const EDGE_PREFIX = '/kythe/edge/';
48-
const ENUM_CLASS_SUBKIND = 'enumClass';
49-
const ENUM_KIND = 'enum';
50-
const EXTENDS_EDGE = '${EDGE_PREFIX}extends';
51-
const FIELD_SUBKIND = 'field';
52-
const FILE_KIND = 'file';
53-
const FN_BUILTIN = 'fn#builtin';
54-
const FUNCTION_KIND = 'function';
47+
const edgePrefix = '/kythe/edge/';
48+
const enumClassSubkind = 'enumClass';
49+
const enumKind = 'enum';
50+
const extendsEdge = '${edgePrefix}extends';
51+
const fieldSubkind = 'field';
52+
const fileKind = 'file';
53+
const fnBuiltin = 'fn#builtin';
54+
const functionKind = 'function';
5555

56-
const IMPLICIT_SUBKIND = 'implicit';
56+
const implicitSubkind = 'implicit';
5757

5858
/// Kythe complete states
59-
const INCOMPLETE = 'incomplete';
60-
const INSTANTIATES_EDGE = '${EDGE_PREFIX}instantiates';
61-
const LOCAL_PARAMETER_SUBKIND = 'local/parameter';
62-
const LOCAL_SUBKIND = 'local';
59+
const incomplete = 'incomplete';
60+
const instantiatesEdge = '${edgePrefix}instantiates';
61+
const localParameterSubkind = 'local/parameter';
62+
const localSubkind = 'local';
6363

6464
/// Kythe node fact labels
65-
const NODE_KIND_FACT = '/kythe/node/kind';
65+
const nodeKindFact = '/kythe/node/kind';
6666

6767
/// Kythe ordinal
68-
const ORDINAL = '/kythe/ordinal';
68+
const ordinal = '/kythe/ordinal';
6969

70-
const OVERRIDES_EDGE = '${EDGE_PREFIX}overrides';
71-
const PACKAGE_KIND = 'package';
70+
const overridesEdge = '${edgePrefix}overrides';
71+
const packageKind = 'package';
7272

73-
const PARAM_EDGE = '${EDGE_PREFIX}param';
73+
const paramEdge = '${edgePrefix}param';
7474

75-
const RECORD_KIND = 'record';
75+
const recordKind = 'record';
7676

77-
const REF_CALL_EDGE = '${EDGE_PREFIX}ref/call';
78-
const REF_EDGE = '${EDGE_PREFIX}ref';
79-
const REF_IMPORTS_EDGE = '${EDGE_PREFIX}ref/imports';
80-
const SNIPPET_END_FACT = '/kythe/snippet/end';
81-
const SNIPPET_START_FACT = '/kythe/snippet/start';
82-
const SUBKIND_FACT = '/kythe/subkind';
83-
const TAPP_KIND = 'tapp';
77+
const refCallEdge = '${edgePrefix}ref/call';
78+
const refEdge = '${edgePrefix}ref';
79+
const refImportsEdge = '${edgePrefix}ref/imports';
80+
const snippetEndFact = '/kythe/snippet/end';
81+
const snippetStartFact = '/kythe/snippet/start';
82+
const subkindFact = '/kythe/subkind';
83+
const tappKind = 'tapp';
8484

85-
const TEXT_ENCODING_FACT = '/kythe/text/encoding';
86-
const TEXT_FACT = '/kythe/text';
87-
const TEXT_FORMAT = '/kythe/format';
88-
const TYPED_EDGE = '${EDGE_PREFIX}typed';
89-
const VARIABLE_KIND = 'variable';
90-
const VOID_BUILTIN = 'void#builtin';
85+
const textEncodingFact = '/kythe/text/encoding';
86+
const textFact = '/kythe/text';
87+
const textFormat = '/kythe/format';
88+
const typedEdge = '${edgePrefix}typed';
89+
const variableKind = 'variable';
90+
const voidBuiltin = 'void#builtin';

0 commit comments

Comments
 (0)