Skip to content

Commit a607ddf

Browse files
author
Orta Therox
authored
Merge pull request #739 from msieurtoph/fix-pr-733
Add setting to manage word completions inhibition
2 parents 229f0d6 + 28b2a88 commit a607ddf

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ These settings can be overridden in `Packages/User/TypeScript.sublime-settings`,
121121
- `node_args`: array of command line arguments sent to the tsserver Node.js process before the tsserver script path (useful for e.g. changing max heap size or attaching debugger to the tsserver process)
122122
- `tsserver_args`: array of command line arguments sent to tsserver Node.js process after the tsserver script path (useful for e.g. overriding tsserver error message locale)
123123
- `tsserver_env`: environment variables to set for the tsserver Node.js process (useful for e.g. setting `TSS_LOG`). These variables are merged with the environment variables available to Sublime.
124+
- `auto_complete_api_completions_only`: boolean to make the autocompletion only provides typescript suggestions and hides the standard completions (aka, all the words of the page). (Default value: `false`).
124125

125126
Project System
126127
------

TypeScript.sublime-settings

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"auto_complete_triggers" : [ {"selector": "source.ts", "characters": "."} ],
3+
"auto_complete_api_completions_only": false,
34
"use_tab_stops": false,
45
"word_separators": "./\\()\"'-:,.;<>~!@#%^&*|+=[]{}`~?",
56

typescript/listeners/completion.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,10 @@ def handle_completion_info(self, completions_resp):
142142
self.run_auto_complete()
143143

144144
def run_auto_complete(self):
145+
settings = sublime.load_settings("TypeScript.sublime-settings")
145146
active_view().run_command("auto_complete", {
146147
'disable_auto_insert': True,
147-
'api_completions_only': False,
148+
'api_completions_only': settings.get('auto_complete_api_completions_only', False),
148149
'next_completion_if_showing': False,
149150
'auto_complete_commit_on_tab': True,
150151
})

0 commit comments

Comments
 (0)