graphql-language-service-interface
Advanced tools
Comparing version 2.9.6-canary-1a140c54.0 to 2.9.6-canary-8af33604.0
import { FragmentDefinitionNode, GraphQLDirective, GraphQLSchema } from 'graphql'; | ||
import { CompletionItem, AllTypeInfo, IPosition } from 'graphql-language-service-types'; | ||
import { CharacterStream, ContextToken, State, ContextTokenForCodeMirror } from 'graphql-language-service-parser'; | ||
export declare const SuggestionCommand: { | ||
command: string; | ||
title: string; | ||
}; | ||
export declare type AutocompleteSuggestionOptions = { | ||
@@ -5,0 +9,0 @@ fillLeafsOnComplete?: boolean; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getTypeInfo = exports.canUseDirective = exports.runOnlineParser = exports.getTokenAtPosition = exports.getFragmentDefinitions = exports.getVariableCompletions = exports.getAutocompleteSuggestions = void 0; | ||
exports.getTypeInfo = exports.canUseDirective = exports.runOnlineParser = exports.getTokenAtPosition = exports.getFragmentDefinitions = exports.getVariableCompletions = exports.getAutocompleteSuggestions = exports.SuggestionCommand = void 0; | ||
const vscode_languageserver_types_1 = require("vscode-languageserver-types"); | ||
@@ -9,2 +9,6 @@ const graphql_1 = require("graphql"); | ||
const autocompleteUtils_1 = require("./autocompleteUtils"); | ||
exports.SuggestionCommand = { | ||
command: 'editor.action.triggerSuggest', | ||
title: 'Suggestions', | ||
}; | ||
const collectFragmentDefs = (op) => { | ||
@@ -62,6 +66,3 @@ const externalFragments = []; | ||
insertText: argDef.name + ': ', | ||
command: { | ||
command: 'editor.action.triggerSuggest', | ||
title: 'Suggestions', | ||
}, | ||
command: exports.SuggestionCommand, | ||
detail: String(argDef.type), | ||
@@ -166,5 +167,2 @@ documentation: (_a = argDef.description) !== null && _a !== void 0 ? _a : undefined, | ||
var _a; | ||
if (field.name === 'securityAdvisories') { | ||
console.log(field); | ||
} | ||
const suggestion = { | ||
@@ -185,2 +183,3 @@ sortText: String(index) + field.name, | ||
suggestion.insertTextFormat = vscode_languageserver_types_1.InsertTextFormat.Snippet; | ||
suggestion.command = exports.SuggestionCommand; | ||
} | ||
@@ -187,0 +186,0 @@ return suggestion; |
import { FragmentDefinitionNode, GraphQLDirective, GraphQLSchema } from 'graphql'; | ||
import { CompletionItem, AllTypeInfo, IPosition } from 'graphql-language-service-types'; | ||
import { CharacterStream, ContextToken, State, ContextTokenForCodeMirror } from 'graphql-language-service-parser'; | ||
export declare const SuggestionCommand: { | ||
command: string; | ||
title: string; | ||
}; | ||
export declare type AutocompleteSuggestionOptions = { | ||
@@ -5,0 +9,0 @@ fillLeafsOnComplete?: boolean; |
@@ -6,2 +6,6 @@ import { CompletionItemKind, InsertTextFormat, } from 'vscode-languageserver-types'; | ||
import { forEachState, getDefinitionState, getFieldDef, hintList, objectValues, } from './autocompleteUtils'; | ||
export const SuggestionCommand = { | ||
command: 'editor.action.triggerSuggest', | ||
title: 'Suggestions', | ||
}; | ||
const collectFragmentDefs = (op) => { | ||
@@ -59,6 +63,3 @@ const externalFragments = []; | ||
insertText: argDef.name + ': ', | ||
command: { | ||
command: 'editor.action.triggerSuggest', | ||
title: 'Suggestions', | ||
}, | ||
command: SuggestionCommand, | ||
detail: String(argDef.type), | ||
@@ -162,5 +163,2 @@ documentation: (_a = argDef.description) !== null && _a !== void 0 ? _a : undefined, | ||
var _a; | ||
if (field.name === 'securityAdvisories') { | ||
console.log(field); | ||
} | ||
const suggestion = { | ||
@@ -181,2 +179,3 @@ sortText: String(index) + field.name, | ||
suggestion.insertTextFormat = InsertTextFormat.Snippet; | ||
suggestion.command = SuggestionCommand; | ||
} | ||
@@ -183,0 +182,0 @@ return suggestion; |
{ | ||
"name": "graphql-language-service-interface", | ||
"version": "2.9.6-canary-1a140c54.0", | ||
"version": "2.9.6-canary-8af33604.0", | ||
"description": "Interface to the GraphQL Language Service", | ||
@@ -34,3 +34,3 @@ "contributors": [ | ||
"graphql-language-service-types": "^1.8.6", | ||
"graphql-language-service-utils": "^2.7.0-canary-1a140c54.0", | ||
"graphql-language-service-utils": "^2.7.0-canary-8af33604.0", | ||
"vscode-languageserver-types": "^3.15.1" | ||
@@ -37,0 +37,0 @@ }, |
@@ -22,39 +22,47 @@ /** | ||
import { getAutocompleteSuggestions } from '../getAutocompleteSuggestions'; | ||
import { | ||
getAutocompleteSuggestions, | ||
SuggestionCommand, | ||
} from '../getAutocompleteSuggestions'; | ||
const commonInsert = { | ||
insertTextFormat: 2, | ||
command: SuggestionCommand, | ||
}; | ||
const expectedResults = { | ||
droid: { | ||
...commonInsert, | ||
label: 'droid', | ||
detail: 'Droid', | ||
insertTextFormat: 2, | ||
insertText: `droid {\n $1\n}`, | ||
}, | ||
hero: { | ||
...commonInsert, | ||
label: 'hero', | ||
detail: 'Character', | ||
insertTextFormat: 2, | ||
insertText: `hero {\n $1\n}`, | ||
}, | ||
human: { | ||
...commonInsert, | ||
label: 'human', | ||
detail: 'Human', | ||
insertTextFormat: 2, | ||
insertText: `human {\n $1\n}`, | ||
}, | ||
inputTypeTest: { | ||
...commonInsert, | ||
label: 'inputTypeTest', | ||
detail: 'TestType', | ||
insertTextFormat: 2, | ||
insertText: `inputTypeTest {\n $1\n}`, | ||
}, | ||
appearsIn: { | ||
...commonInsert, | ||
label: 'appearsIn', | ||
detail: '[Episode]', | ||
insertTextFormat: 2, | ||
insertText: `appearsIn {\n $1\n}`, | ||
}, | ||
friends: { | ||
...commonInsert, | ||
label: 'friends', | ||
detail: '[Character]', | ||
insertTextFormat: 2, | ||
insertText: `friends {\n $1\n}`, | ||
@@ -61,0 +69,0 @@ }, |
@@ -79,2 +79,7 @@ /** | ||
export const SuggestionCommand = { | ||
command: 'editor.action.triggerSuggest', | ||
title: 'Suggestions', | ||
}; | ||
const collectFragmentDefs = (op: string | undefined) => { | ||
@@ -179,6 +184,3 @@ const externalFragments: FragmentDefinitionNode[] = []; | ||
insertText: argDef.name + ': ', | ||
command: { | ||
command: 'editor.action.triggerSuggest', | ||
title: 'Suggestions', | ||
}, | ||
command: SuggestionCommand, | ||
detail: String(argDef.type), | ||
@@ -336,5 +338,2 @@ documentation: argDef.description ?? undefined, | ||
fields.map<CompletionItem>((field, index) => { | ||
if (field.name === 'securityAdvisories') { | ||
console.log(field); | ||
} | ||
const suggestion: CompletionItem = { | ||
@@ -358,2 +357,3 @@ // This will sort the fields in the same order they are listed in the schema | ||
suggestion.insertTextFormat = InsertTextFormat.Snippet; | ||
suggestion.command = SuggestionCommand; | ||
} | ||
@@ -360,0 +360,0 @@ return suggestion; |
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
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
391569
6837