Skip to content

Commit

Permalink
feat: kind to symbol kind
Browse files Browse the repository at this point in the history
  • Loading branch information
acao committed Apr 12, 2020
1 parent d572fc7 commit 93b215d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
1 change: 1 addition & 0 deletions packages/graphiql/resources/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const resultConfig = {
devtool: isDev ? 'cheap-module-eval-source-map' : 'source-map',
node: {
fs: 'empty',
module: 'empty',
},
externals: {
react: 'React',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,19 @@ const {
} = Kind;

const KIND_TO_SYMBOL_KIND: { [key: string]: SymbolKind } = {
Field: SymbolKind.Field,
OperationDefinition: SymbolKind.Class,
FragmentDefinition: SymbolKind.Class,
FragmentSpread: SymbolKind.Struct,
ObjectTypeDefinition: SymbolKind.Class,
EnumTypeDefinition: SymbolKind.Enum,
EnumValueDefinition: SymbolKind.EnumMember,
InputObjectTypeDefinition: SymbolKind.Class,
InputValueDefinition: SymbolKind.Field,
FieldDefinition: SymbolKind.Field,
InterfaceTypeDefinition: SymbolKind.Interface,
Document: SymbolKind.File,
[Kind.FIELD]: SymbolKind.Field,
[Kind.OPERATION_DEFINITION]: SymbolKind.Class,
[Kind.FRAGMENT_DEFINITION]: SymbolKind.Class,
[Kind.FRAGMENT_SPREAD]: SymbolKind.Struct,
[Kind.OBJECT_TYPE_DEFINITION]: SymbolKind.Class,
[Kind.ENUM_TYPE_DEFINITION]: SymbolKind.Enum,
[Kind.ENUM_VALUE_DEFINITION]: SymbolKind.EnumMember,
[Kind.INPUT_OBJECT_TYPE_DEFINITION]: SymbolKind.Class,
[Kind.INPUT_VALUE_DEFINITION]: SymbolKind.Field,
[Kind.FIELD_DEFINITION]: SymbolKind.Field,
[Kind.INTERFACE_TYPE_DEFINITION]: SymbolKind.Interface,
[Kind.DOCUMENT]: SymbolKind.File,
// novel, for symbols only
FieldWithArguments: SymbolKind.Method,
};

Expand Down

0 comments on commit 93b215d

Please sign in to comment.