-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide API to add a new language to the LSP service #11326
Comments
There's no entry for the F language server here: so that's probably why you're having the error above. So I think you need to add it in a PR for your plugin to work. The available LSP languages are available here: |
Hi @ccordoba12, yes, as you pointed that is the problem, but instead of adding that language to the Spyder main project, may Spyder can provide a function to add new languages as plugins using LSP, so when the plugin is installed, Spyder adds the new language configuration needed without hard-coded changes. |
I agree: we should provide an API for external plugins to register a new LSP language along with its configuration. @andfoy, please take a look at that. However, for that @jogufe would have to wait a couple of months because right now we're busy fixing some important bugs. So it's his call. |
Thank you for your reply. I will stick with modifying the code until the API is provided. |
Hi there, as part of the Improving external completion plugins development support in Spyder NumFOCUS Small Development Grant and the interest shown for AI code assistants integration with Spyder at #20632 (which checking seems like most of them rely on the LSP in some extend) some elements/ideas that could be important to take into account when creating/defining a public API to extend the LSP based functionality that has Spyder:
And not completly related with the LSP support but related to its usage and the response handling from the Editor:
|
Issue Report Checklist
conda update spyder
(orpip
, if not using Anaconda)jupyter qtconsole
(if console-related)spyder --reset
Problem Description
I am trying to add a new language support in Spyder to connect via LSP in a user plugin. My plugin should modify the dictionary and lists containing the languages and show them in the setup a new server options on the LSP server editor preferences panel. If reseted preferences with
spyder --reset
it will work until Spyder is restartedWhat steps reproduce the problem?
fIDE.zip
plugin_install_location/fIDE/spyder_fIDE/server/bin/br.ifsc.ciermag.flang.ide
; the port is5008
; host is set to127.0.0.1
What is the expected output? What do you see instead?
It is expected that the spyder automatically lunches and connects to the F language server, but nothing happens and when the preferences is opend there is an error.
Paste Traceback/Error Below (if applicable)
Traceback (most recent call last):
File "/home/hendrik/anaconda3/envs/fIDE/lib/python3.7/site-packages/spyder/app/mainwindow.py", line 3128, in show_preferences
widget = completion_plugin._create_configwidget(dlg, self)
File "/home/hendrik/anaconda3/envs/fIDE/lib/python3.7/site-packages/spyder/plugins/base.py", line 117, in _create_configwidget
configwidget.initialize()
File "/home/hendrik/anaconda3/envs/fIDE/lib/python3.7/site-packages/spyder/preferences/configdialog.py", line 71, in initialize
self.setup_page()
File "/home/hendrik/anaconda3/envs/fIDE/lib/python3.7/site-packages/spyder/plugins/completion/languageserver/confpage.py", line 1115, in setup_page
self.table = LSPServerTable(self, text_color=ima.MAIN_FG_COLOR)
File "/home/hendrik/anaconda3/envs/fIDE/lib/python3.7/site-packages/spyder/plugins/completion/languageserver/confpage.py", line 589, in init
self.load_servers()
File "/home/hendrik/anaconda3/envs/fIDE/lib/python3.7/site-packages/spyder/plugins/completion/languageserver/confpage.py", line 624, in load_servers
server.language = LSP_LANGUAGE_NAME[server.language.lower()]
KeyError: 'f'
Versions
Dependencies
atomicwrites >=1.2.0 : 1.3.0 (OK)
chardet >=2.0.0 : 3.0.4 (OK)
cloudpickle >=0.5.0 : 1.2.2 (OK)
diff_match_patch >=20181111 : 20181111 (OK)
intervaltree : None (OK)
IPython >=4.0 : 7.11.1 (OK)
jedi =0.14.1 : 0.14.1 (OK)
keyring : None (OK)
nbconvert >=4.0 : 5.6.1 (OK)
numpydoc >=0.6.0 : 0.9.2 (OK)
pexpect >=4.4.0 : 4.7.0 (OK)
pickleshare >=0.4 : 0.7.5 (OK)
psutil >=0.3 : 5.6.7 (OK)
pygments >=2.0 : 2.5.2 (OK)
pylint >=0.25 : 2.4.4 (OK)
pyls >=0.31.2;<0.32.0 : 0.31.2 (OK)
xdg >=0.26 : 0.26 (OK)
zmq >=17 : 18.1.0 (OK)
qdarkstyle >=2.7 : 2.7 (OK)
qtawesome >=0.5.7 : 0.6.0 (OK)
qtconsole >=4.6.0 : 4.6.0 (OK)
qtpy >=1.5.0 : 1.9.0 (OK)
rtree >=0.8.3 : 0.8.3 (OK)
sphinx >=0.6.6 : 2.3.1 (OK)
spyder_kernels >=1.8.1;<2.0.0: 1.8.1 (OK)
watchdog : None (OK)
cython >=0.21 : None (NOK)
matplotlib >=2.0.0 : None (NOK)
numpy >=1.7 : None (NOK)
pandas >=0.13.1 : None (NOK)
scipy >=0.17.0 : None (NOK)
sympy >=0.7.3 : None (NOK)
The text was updated successfully, but these errors were encountered: