mirror of
https://github.com/kiteco/vscode-plugin.git
synced 2024-11-04 14:40:57 +03:00
Merge pull request #316 from kiteco/more-python-completions
This commit is contained in:
commit
831a2108a6
@ -7,8 +7,13 @@ const EVENT_SUPPORT = (fileName) => {
|
||||
};
|
||||
|
||||
const COMPLETIONS_SUPPORT = [
|
||||
{ pattern: "**/*.{py,go,js,jsx,vue}", scheme: "file" },
|
||||
{ pattern: "**/*.{py,go,js,jsx,vue}", scheme: "untitled" }
|
||||
{ pattern: "**/*.{go,js,jsx,vue}", scheme: "file" },
|
||||
{ pattern: "**/*.{go,js,jsx,vue}", scheme: "untitled" }
|
||||
];
|
||||
|
||||
const FULL_COMPLETIONS_SUPPORT = [
|
||||
{ pattern: "**/*.{py}", scheme: "file" },
|
||||
{ pattern: "**/*.{py}", scheme: "untitled" }
|
||||
];
|
||||
|
||||
const DEFINITIONS_SUPPORT = [
|
||||
@ -60,6 +65,7 @@ module.exports = {
|
||||
INTERVAL,
|
||||
EVENT_SUPPORT,
|
||||
COMPLETIONS_SUPPORT,
|
||||
FULL_COMPLETIONS_SUPPORT,
|
||||
DEFINITIONS_SUPPORT,
|
||||
HOVER_SUPPORT,
|
||||
SIGNATURES_SUPPORT,
|
||||
|
11
src/kite.js
11
src/kite.js
@ -10,6 +10,7 @@ const {
|
||||
ERROR_COLOR,
|
||||
EVENT_SUPPORT,
|
||||
COMPLETIONS_SUPPORT,
|
||||
FULL_COMPLETIONS_SUPPORT,
|
||||
DEFINITIONS_SUPPORT,
|
||||
HOVER_SUPPORT,
|
||||
SIGNATURES_SUPPORT,
|
||||
@ -120,6 +121,16 @@ const Kite = {
|
||||
new KiteCompletionProvider(Kite, completionsTriggers, optionalCompletionsTriggers), ...completionsTriggers.concat(optionalCompletionsTriggers))
|
||||
);
|
||||
|
||||
// More triggers for Python because we have semantic completions.
|
||||
// We leave out open quotes because we can't suggest string constants.
|
||||
var pythonCompletionsTriggers = ['.', ',', ' ', '(', '[', '{', '='];
|
||||
|
||||
this.disposables.push(
|
||||
vscode.languages.registerCompletionItemProvider(
|
||||
FULL_COMPLETIONS_SUPPORT,
|
||||
new KiteCompletionProvider(Kite, pythonCompletionsTriggers), ...pythonCompletionsTriggers)
|
||||
);
|
||||
|
||||
this.disposables.push(
|
||||
vscode.languages.registerSignatureHelpProvider(
|
||||
SIGNATURES_SUPPORT,
|
||||
|
Loading…
Reference in New Issue
Block a user