@@ -149,35 +149,18 @@ def init_api_completer(self):
149149 from peek import __file__ as package_root
150150
151151 package_root = os .path .dirname (package_root )
152- if self .app .config .as_bool ('prefer_elasticsearch_specification' ):
153- _logger .info ('Use elasticsearch-specification schema for autocompletion' )
154- from peek .es_api_spec .api_completer import SchemaESApiCompleter
155-
156- schema_filepath = os .path .join (config_location (), 'schema.json' )
157- if not os .path .exists (schema_filepath ):
158- schema_filepath = os .path .join (package_root , 'specs' , 'schema.json' )
159- if os .path .exists (schema_filepath ):
160- return SchemaESApiCompleter (schema_filepath )
161- else :
162- from peek .es_api_spec .api_completer import NoopESApiCompleter
163-
164- return NoopESApiCompleter ()
152+ _logger .info ('Use elasticsearch-specification schema for autocompletion' )
153+ from peek .es_api_spec .api_completer import SchemaESApiCompleter
154+
155+ schema_filepath = os .path .join (config_location (), 'schema.json' )
156+ if not os .path .exists (schema_filepath ):
157+ schema_filepath = os .path .join (package_root , 'specs' , 'schema.json' )
158+ if os .path .exists (schema_filepath ):
159+ return SchemaESApiCompleter (schema_filepath )
165160 else :
166- kibana_dir = self .app .config ['kibana_dir' ]
167- if not kibana_dir :
168- config_dir = config_location ()
169- if os .path .exists (config_dir ):
170- kibana_dirs = [
171- os .path .join (config_dir , d ) for d in os .listdir (config_dir ) if d .startswith ('kibana-' )
172- ]
173- if kibana_dirs :
174- kibana_dir = kibana_dirs [0 ]
175- if not kibana_dir :
176- kibana_dir = os .path .join (package_root , 'specs' , 'kibana-7.8.1' )
177- _logger .info (f'Attempt to build Elasticsearch API specs from: { kibana_dir } ' )
178- from peek .es_api_spec .kspec import KibanaSpecESApiCompleter
179-
180- return KibanaSpecESApiCompleter (self .app , kibana_dir )
161+ from peek .es_api_spec .api_completer import NoopESApiCompleter
162+
163+ return NoopESApiCompleter ()
181164
182165 def get_completions (self , document : Document , complete_event : CompleteEvent ) -> Iterable [Completion ]:
183166 _logger .debug (f'Document: { document } , Event: { complete_event } ' )
0 commit comments