diff --git a/src/constants.js b/src/constants.js index a4986a6..d56eb95 100644 --- a/src/constants.js +++ b/src/constants.js @@ -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, diff --git a/src/kite.js b/src/kite.js index 5e16d13..7df1b80 100644 --- a/src/kite.js +++ b/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,