cfml_completion_docs setting is being ignored
See original GitHub issueThank you for making this plugin. It makes ColdFusion development in Sublime Text sooooo much easier.
I am using the sublimetext-cfml v0.26.10 with Sublime Text 3.0 build 3143 on Windows 7. My corporate network blocks network requests that don’t go through the corporate proxy, including requests sublimetext-cfml makes to cfdocs.org.
My User/cfml_package.sublime-settings
file has both of the docs
settings turned off:
{
"cfml_hover_docs": false,
"cfml_completion_docs": false
}
However, the entire Sublime Text application still freezes up for about 20 seconds when I am editing a CF function (tags do not cause a problem). When a freeze occurs, this is the error in my console:
Traceback (most recent call last):
File "./python3.3/urllib/request.py", line 1248, in do_open
File "./python3.3/http/client.py", line 1065, in request
File "./python3.3/http/client.py", line 1103, in _send_request
File "./python3.3/http/client.py", line 1061, in endheaders
File "./python3.3/http/client.py", line 906, in _send_output
File "./python3.3/http/client.py", line 844, in send
File "./python3.3/http/client.py", line 1198, in connect
File "./python3.3/socket.py", line 435, in create_connection
File "./python3.3/socket.py", line 426, in create_connection
TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 591, in on_query_completions
res = callback.on_query_completions(v, prefix, locations)
File "C:\Users\EPARYJ6\AppData\Roaming\Sublime Text 3\Packages\sublimetext-cfml-master\cfml_plugin.py", line 54, in on_query_completions
return completions.get_completions(view, locations[0], prefix)
File "C:\Users\EPARYJ6\AppData\Roaming\Sublime Text 3\Packages\sublimetext-cfml-master\src\completions.py", line 28, in get_completions
completionlist = callback(cfml_view)
File "C:\Users\EPARYJ6\AppData\Roaming\Sublime Text 3\Packages\sublimetext-cfml-master\src\basecompletions\__init__.py", line 12, in get_completions
return basecompletions.get_script_completions(cfml_view)
File "C:\Users\EPARYJ6\AppData\Roaming\Sublime Text 3\Packages\sublimetext-cfml-master\src\basecompletions\basecompletions.py", line 55, in get_script_completions
param_completions = get_param_completions(cfml_view)
File "C:\Users\EPARYJ6\AppData\Roaming\Sublime Text 3\Packages\sublimetext-cfml-master\src\basecompletions\basecompletions.py", line 174, in get_param_completions
data, success = cfdocs.get_cfdoc(cfml_view.function_call_params.function_name)
File "C:\Users\EPARYJ6\AppData\Roaming\Sublime Text 3\Packages\sublimetext-cfml-master\src\cfdocs\cfdocs.py", line 93, in get_cfdoc
return fetch_cfdoc(function_or_tag)
File "C:\Users\EPARYJ6\AppData\Roaming\Sublime Text 3\Packages\sublimetext-cfml-master\src\cfdocs\cfdocs.py", line 132, in fetch_cfdoc
json_string = urllib.request.urlopen(full_url).read().decode("utf-8")
File "./python3.3/urllib/request.py", line 156, in urlopen
File "./python3.3/urllib/request.py", line 469, in open
File "./python3.3/urllib/request.py", line 487, in _open
File "./python3.3/urllib/request.py", line 447, in _call_chain
File "./python3.3/urllib/request.py", line 1289, in https_open
File "./python3.3/urllib/request.py", line 1251, in do_open
urllib.error.URLError: <urlopen error [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond>
I suspect the cfml_completion_docs
setting is being ignored and a request to cfdocs.org is still being attempted. Is there another docs
setting I should turn off in order to prevent the package from making requests to cfdocs.org?
As a short-term fix, I have changed src/cfdocs/cfdocs.py Line 93 from
return fetch_cfdoc(function_or_tag)
to
return None
This has “fixed” the freezing issue, but I’m sure it’s not an ideal solution. When I do edit a CF function, I get the following error in console (although the application does not freeze):
Traceback (most recent call last):
File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 591, in on_query_completions
res = callback.on_query_completions(v, prefix, locations)
File "C:\Users\EPARYJ6\AppData\Roaming\Sublime Text 3\Packages\sublimetext-cfml-master\cfml_plugin.py", line 54, in on_query_completions
return completions.get_completions(view, locations[0], prefix)
File "C:\Users\EPARYJ6\AppData\Roaming\Sublime Text 3\Packages\sublimetext-cfml-master\src\completions.py", line 28, in get_completions
completionlist = callback(cfml_view)
File "C:\Users\EPARYJ6\AppData\Roaming\Sublime Text 3\Packages\sublimetext-cfml-master\src\basecompletions\__init__.py", line 12, in get_completions
return basecompletions.get_script_completions(cfml_view)
File "C:\Users\EPARYJ6\AppData\Roaming\Sublime Text 3\Packages\sublimetext-cfml-master\src\basecompletions\basecompletions.py", line 55, in get_script_completions
param_completions = get_param_completions(cfml_view)
File "C:\Users\EPARYJ6\AppData\Roaming\Sublime Text 3\Packages\sublimetext-cfml-master\src\basecompletions\basecompletions.py", line 174, in get_param_completions
data, success = cfdocs.get_cfdoc(cfml_view.function_call_params.function_name)
TypeError: 'NoneType' object is not iterable
I’m sorry I can’t write a real Pull Request to help address this issue, but I don’t know Python at all.
Thank you
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Incidentally, that
return None
you edited is supposed to return a tuple, which is why you are still seeing an error after editing it - you could tryreturn None, False
instead.I have added a setting
"cfdocs_enabled"
to the package settings which you can set tofalse
to disable the cfdocs integration.