Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Commit

Permalink
Enable autocomplete caching
Browse files Browse the repository at this point in the history
Summary:
Just using the generic autocompletion cache seems fine.

I also noticed a `RuntimeError` being occasionally thrown on completion: I've added a `catch` for that and filed an issue at davidhalter/jedi#1031.

Reviewed By: pelmers

Differential Revision: D6781655

fbshipit-source-id: 38cf49422632757001f07855736f4582f45e1546
  • Loading branch information
hansonw authored and facebook-github-bot committed Jan 25, 2018
1 parent cc1cb1f commit 6a987df
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/nuclide-python-rpc/python/jediserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def _get_params(self, completion):
lambda x: x != '...' and x != 'args' and x != 'kwargs',
names,
))
except AttributeError:
except (AttributeError, RuntimeError):
return None

def get_definitions(self, script):
Expand Down
11 changes: 9 additions & 2 deletions pkg/nuclide-python/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ import {
ServerConnection,
} from '../../nuclide-remote-connection';
import {getNotifierByConnection} from '../../nuclide-open-files';
import {AtomLanguageService} from '../../nuclide-language-service';
import {
AtomLanguageService,
updateAutocompleteFirstResults,
updateAutocompleteResults,
} from '../../nuclide-language-service';
import createPackage from 'nuclide-commons-atom/createPackage';
import {
getShowGlobalVariables,
Expand Down Expand Up @@ -74,7 +78,10 @@ const atomConfig: AtomLanguageServiceConfig = {
eventName: 'nuclide-python',
shouldLogInsertedSuggestion: false,
},
autocompleteCacherConfig: null,
autocompleteCacherConfig: {
updateResults: updateAutocompleteResults,
updateFirstResults: updateAutocompleteFirstResults,
},
},
definition: {
version: '0.1.0',
Expand Down

0 comments on commit 6a987df

Please sign in to comment.