Skip to content

Provide API to add a new language to the LSP service #11326

@hlouzada

Description

@hlouzada

Issue Report Checklist

  • Searched the issues page for similar reports
  • Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • Could not reproduce inside jupyter qtconsole (if console-related)
  • Tried basic troubleshooting (if a bug/error)
    • Restarted Spyder
    • Reset preferences with spyder --reset
    • Reinstalled the latest version of Anaconda
    • Tried the other applicable steps from the Troubleshooting Guide
  • Completed the Problem Description, Steps to Reproduce and Version sections below

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 restarted

What steps reproduce the problem?

fIDE.zip

  1. Install the extension
  2. Open Spyder
  3. Open preferences: setup a new server in LSP server editor; command file to lunch the server is located in plugin_install_location/fIDE/spyder_fIDE/server/bin/br.ifsc.ciermag.flang.ide; the port is 5008; host is set to 127.0.0.1
  4. Close Spyder
  5. Open preferences

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

  • Spyder version: 4.0.1
  • Python version: 3.7.5
  • Qt version: 5.9.6
  • PyQt version: 5.9.2
  • Operating System name/version: Linux 5.0.0-38-generic

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions