graphql-language-service
Advanced tools
Comparing version 5.2.1 to 5.2.2-canary-8432eb69.0
@@ -6,5 +6,5 @@ import { GraphQLField, GraphQLType } from 'graphql'; | ||
export declare function hintList<T extends CompletionItemBase>(token: ContextTokenUnion, list: Array<T>): Array<T>; | ||
export declare const getInsertText: (prefix: string, type?: GraphQLType | undefined, fallback?: string | undefined) => string; | ||
export declare const getInputInsertText: (prefix: string, type: GraphQLType, fallback?: string | undefined) => string; | ||
export declare const getInsertText: (prefix: string, type?: GraphQLType, fallback?: string) => string; | ||
export declare const getInputInsertText: (prefix: string, type: GraphQLType, fallback?: string) => string; | ||
export declare const getFieldInsertText: (field: GraphQLField<null, null>) => string | undefined; | ||
//# sourceMappingURL=autocompleteUtils.d.ts.map |
@@ -72,3 +72,2 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
dependencies.filter(({ definition }) => definition.name && definition.name.value === typeName); | ||
const definitions = []; | ||
@@ -75,0 +74,0 @@ for (const { filePath, content, definition } of dependencies) { |
@@ -138,29 +138,29 @@ import type { Diagnostic as DiagnosticType, CompletionItem as CompletionItemType } from 'vscode-languageserver-types'; | ||
export declare namespace CompletionItemKind { | ||
const Text: 1; | ||
const Method: 2; | ||
const Function: 3; | ||
const Constructor: 4; | ||
const Field: 5; | ||
const Variable: 6; | ||
const Class: 7; | ||
const Interface: 8; | ||
const Module: 9; | ||
const Property: 10; | ||
const Unit: 11; | ||
const Value: 12; | ||
const Enum: 13; | ||
const Keyword: 14; | ||
const Snippet: 15; | ||
const Color: 16; | ||
const File: 17; | ||
const Reference: 18; | ||
const Folder: 19; | ||
const EnumMember: 20; | ||
const Constant: 21; | ||
const Struct: 22; | ||
const Event: 23; | ||
const Operator: 24; | ||
const TypeParameter: 25; | ||
const Text = 1; | ||
const Method = 2; | ||
const Function = 3; | ||
const Constructor = 4; | ||
const Field = 5; | ||
const Variable = 6; | ||
const Class = 7; | ||
const Interface = 8; | ||
const Module = 9; | ||
const Property = 10; | ||
const Unit = 11; | ||
const Value = 12; | ||
const Enum = 13; | ||
const Keyword = 14; | ||
const Snippet = 15; | ||
const Color = 16; | ||
const File = 17; | ||
const Reference = 18; | ||
const Folder = 19; | ||
const EnumMember = 20; | ||
const Constant = 21; | ||
const Struct = 22; | ||
const Event = 23; | ||
const Operator = 24; | ||
const TypeParameter = 25; | ||
} | ||
export declare type CompletionItemKind = 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; | ||
//# sourceMappingURL=types.d.ts.map |
import { DocumentNode, FragmentDefinitionNode } from 'graphql'; | ||
export declare const getFragmentDependencies: (operationString: string, fragmentDefinitions?: Map<string, FragmentDefinitionNode> | null | undefined) => FragmentDefinitionNode[]; | ||
export declare const getFragmentDependencies: (operationString: string, fragmentDefinitions?: Map<string, FragmentDefinitionNode> | null) => FragmentDefinitionNode[]; | ||
export declare const getFragmentDependenciesForAST: (parsedOperation: DocumentNode, fragmentDefinitions: Map<string, FragmentDefinitionNode>) => FragmentDefinitionNode[]; | ||
//# sourceMappingURL=fragmentDependencies.d.ts.map |
@@ -6,5 +6,5 @@ import { GraphQLField, GraphQLType } from 'graphql'; | ||
export declare function hintList<T extends CompletionItemBase>(token: ContextTokenUnion, list: Array<T>): Array<T>; | ||
export declare const getInsertText: (prefix: string, type?: GraphQLType | undefined, fallback?: string | undefined) => string; | ||
export declare const getInputInsertText: (prefix: string, type: GraphQLType, fallback?: string | undefined) => string; | ||
export declare const getInsertText: (prefix: string, type?: GraphQLType, fallback?: string) => string; | ||
export declare const getInputInsertText: (prefix: string, type: GraphQLType, fallback?: string) => string; | ||
export declare const getFieldInsertText: (field: GraphQLField<null, null>) => string | undefined; | ||
//# sourceMappingURL=autocompleteUtils.d.ts.map |
@@ -67,3 +67,2 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
dependencies.filter(({ definition }) => definition.name && definition.name.value === typeName); | ||
const definitions = []; | ||
@@ -70,0 +69,0 @@ for (const { filePath, content, definition } of dependencies) { |
@@ -138,29 +138,29 @@ import type { Diagnostic as DiagnosticType, CompletionItem as CompletionItemType } from 'vscode-languageserver-types'; | ||
export declare namespace CompletionItemKind { | ||
const Text: 1; | ||
const Method: 2; | ||
const Function: 3; | ||
const Constructor: 4; | ||
const Field: 5; | ||
const Variable: 6; | ||
const Class: 7; | ||
const Interface: 8; | ||
const Module: 9; | ||
const Property: 10; | ||
const Unit: 11; | ||
const Value: 12; | ||
const Enum: 13; | ||
const Keyword: 14; | ||
const Snippet: 15; | ||
const Color: 16; | ||
const File: 17; | ||
const Reference: 18; | ||
const Folder: 19; | ||
const EnumMember: 20; | ||
const Constant: 21; | ||
const Struct: 22; | ||
const Event: 23; | ||
const Operator: 24; | ||
const TypeParameter: 25; | ||
const Text = 1; | ||
const Method = 2; | ||
const Function = 3; | ||
const Constructor = 4; | ||
const Field = 5; | ||
const Variable = 6; | ||
const Class = 7; | ||
const Interface = 8; | ||
const Module = 9; | ||
const Property = 10; | ||
const Unit = 11; | ||
const Value = 12; | ||
const Enum = 13; | ||
const Keyword = 14; | ||
const Snippet = 15; | ||
const Color = 16; | ||
const File = 17; | ||
const Reference = 18; | ||
const Folder = 19; | ||
const EnumMember = 20; | ||
const Constant = 21; | ||
const Struct = 22; | ||
const Event = 23; | ||
const Operator = 24; | ||
const TypeParameter = 25; | ||
} | ||
export declare type CompletionItemKind = 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; | ||
//# sourceMappingURL=types.d.ts.map |
import { DocumentNode, FragmentDefinitionNode } from 'graphql'; | ||
export declare const getFragmentDependencies: (operationString: string, fragmentDefinitions?: Map<string, FragmentDefinitionNode> | null | undefined) => FragmentDefinitionNode[]; | ||
export declare const getFragmentDependencies: (operationString: string, fragmentDefinitions?: Map<string, FragmentDefinitionNode> | null) => FragmentDefinitionNode[]; | ||
export declare const getFragmentDependenciesForAST: (parsedOperation: DocumentNode, fragmentDefinitions: Map<string, FragmentDefinitionNode>) => FragmentDefinitionNode[]; | ||
//# sourceMappingURL=fragmentDependencies.d.ts.map |
{ | ||
"name": "graphql-language-service", | ||
"version": "5.2.1", | ||
"version": "5.2.2-canary-8432eb69.0", | ||
"description": "The official, runtime independent Language Service for GraphQL", | ||
@@ -5,0 +5,0 @@ "contributors": [ |
@@ -445,3 +445,3 @@ /** | ||
const typeSystemCompletionItems = [ | ||
const typeSystemCompletionItems: CompletionItem[] = [ | ||
{ label: 'type', kind: CompletionItemKind.Function }, | ||
@@ -455,3 +455,3 @@ { label: 'interface', kind: CompletionItemKind.Function }, | ||
const executableCompletionItems = [ | ||
const executableCompletionItems: CompletionItem[] = [ | ||
{ label: 'query', kind: CompletionItemKind.Function }, | ||
@@ -465,3 +465,5 @@ { label: 'mutation', kind: CompletionItemKind.Function }, | ||
// Helper functions to get suggestions for each kinds | ||
function getSuggestionsForTypeSystemDefinitions(token: ContextToken) { | ||
function getSuggestionsForTypeSystemDefinitions( | ||
token: ContextToken, | ||
): CompletionItem[] { | ||
return hintList(token, [ | ||
@@ -473,7 +475,11 @@ { label: 'extend', kind: CompletionItemKind.Function }, | ||
function getSuggestionsForExecutableDefinitions(token: ContextToken) { | ||
function getSuggestionsForExecutableDefinitions( | ||
token: ContextToken, | ||
): CompletionItem[] { | ||
return hintList(token, executableCompletionItems); | ||
} | ||
function getSuggestionsForUnknownDocumentMode(token: ContextToken) { | ||
function getSuggestionsForUnknownDocumentMode( | ||
token: ContextToken, | ||
): CompletionItem[] { | ||
return hintList(token, [ | ||
@@ -486,3 +492,5 @@ { label: 'extend', kind: CompletionItemKind.Function }, | ||
function getSuggestionsForExtensionDefinitions(token: ContextToken) { | ||
function getSuggestionsForExtensionDefinitions( | ||
token: ContextToken, | ||
): CompletionItem[] { | ||
return hintList(token, typeSystemCompletionItems); | ||
@@ -495,3 +503,3 @@ } | ||
options?: InternalAutocompleteOptions, | ||
): Array<CompletionItem> { | ||
): CompletionItem[] { | ||
if (typeInfo.parentType) { | ||
@@ -498,0 +506,0 @@ const { parentType } = typeInfo; |
@@ -130,6 +130,2 @@ /** | ||
): Promise<DefinitionQueryResult> { | ||
dependencies.filter( | ||
({ definition }) => definition.name && definition.name.value === typeName, | ||
); | ||
const definitions: Array<Definition> = []; | ||
@@ -136,0 +132,0 @@ |
@@ -145,4 +145,4 @@ /** | ||
: 'variable' in node && node.variable !== undefined | ||
? node.variable | ||
: node; | ||
? node.variable | ||
: node; | ||
if (highlightNode) { | ||
@@ -149,0 +149,0 @@ invariant( |
@@ -318,3 +318,2 @@ /** | ||
(state.rule[state.step] as Rule); | ||
// eslint-disable-next-line @typescript-eslint/prefer-optional-chain -- otherwise has type issue | ||
return step && step.isList; | ||
@@ -321,0 +320,0 @@ } |
@@ -124,4 +124,4 @@ /** | ||
: stream.match(/[\s\u00a0,]*:/, false) | ||
? 'AliasedField' | ||
: 'Field'; | ||
? 'AliasedField' | ||
: 'Field'; | ||
}, | ||
@@ -128,0 +128,0 @@ // Note: this minor deviation of "AliasedField" simplifies the lookahead. |
@@ -252,30 +252,30 @@ /** | ||
/** | ||
* The kind of a completion entry. | ||
* The kind of completion entry. | ||
*/ | ||
export namespace CompletionItemKind { | ||
export const Text = 1 as const; | ||
export const Method = 2 as const; | ||
export const Function = 3 as const; | ||
export const Constructor = 4 as const; | ||
export const Field = 5 as const; | ||
export const Variable = 6 as const; | ||
export const Class = 7 as const; | ||
export const Interface = 8 as const; | ||
export const Module = 9 as const; | ||
export const Property = 10 as const; | ||
export const Unit = 11 as const; | ||
export const Value = 12 as const; | ||
export const Enum = 13 as const; | ||
export const Keyword = 14 as const; | ||
export const Snippet = 15 as const; | ||
export const Color = 16 as const; | ||
export const File = 17 as const; | ||
export const Reference = 18 as const; | ||
export const Folder = 19 as const; | ||
export const EnumMember = 20 as const; | ||
export const Constant = 21 as const; | ||
export const Struct = 22 as const; | ||
export const Event = 23 as const; | ||
export const Operator = 24 as const; | ||
export const TypeParameter = 25 as const; | ||
export const Text = 1; | ||
export const Method = 2; | ||
export const Function = 3; | ||
export const Constructor = 4; | ||
export const Field = 5; | ||
export const Variable = 6; | ||
export const Class = 7; | ||
export const Interface = 8; | ||
export const Module = 9; | ||
export const Property = 10; | ||
export const Unit = 11; | ||
export const Value = 12; | ||
export const Enum = 13; | ||
export const Keyword = 14; | ||
export const Snippet = 15; | ||
export const Color = 16; | ||
export const File = 17; | ||
export const Reference = 18; | ||
export const Folder = 19; | ||
export const EnumMember = 20; | ||
export const Constant = 21; | ||
export const Struct = 22; | ||
export const Event = 23; | ||
export const Operator = 24; | ||
export const TypeParameter = 25; | ||
} | ||
@@ -282,0 +282,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15697
827120
1