missionpinball / mpf-ls

Mission Pinball Framework Language Server
5 stars 8 forks source link

Standalone shows still broken #11

Open mattkemp opened 2 years ago

mattkemp commented 2 years ago

installed dev branch using:

pip3 install git+https://github.com/missionpinball/mpf-ls.git@dev

now have this version:

mpf-language-server     0.55.0.dev1+8.g4d9055d

standalone shows are causing this error:

Internal error while verifying: Failed to split 0 Traceback (most recent call last):
  File "c:\users\matt\mpfenv\lib\site-packages\mpfls\mpf_ls.py", line 1148, in _get_spec
    spec_names = spec_name_str.split(",")
AttributeError: 'int' object has no attribute 'split'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "c:\users\matt\mpfenv\lib\site-packages\mpfls\mpf_ls.py", line 1355, in lint_internal
    diagnostics = self._walk_diagnostics_root(document, document.config_roundtrip)
  File "c:\users\matt\mpfenv\lib\site-packages\mpfls\mpf_ls.py", line 1045, in _walk_diagnostics_root
    root_spec = self._get_spec(key)
  File "c:\users\matt\mpfenv\lib\site-packages\mpfls\mpf_ls.py", line 1150, in _get_spec
    raise AssertionError("Failed to split {}".format(spec_name_str)) from e
AssertionError: Failed to split 0
mpf-ls(998)
mattkemp commented 2 years ago

a standalone show in my root directory like /shows/flash_red.yaml is fine, but if I copy that same show into a mode's shows directory /modes/modeX/shows/flash_red.yaml it goes red and has the error above.

YAML for flash_red.yaml:

#show_version=5

- time: 0
  lights:
    (led): red
- time: +1
  lights:
    (led): off
- time: +1 #is this necessary?
jabdoa2 commented 2 years ago

yeah it does not currently understand shows. this would be something to add. i think i started this a while ago but did not work on this for at least half a year.

mattkemp commented 2 years ago

I guess it's not really a high priority as the shows still work.

It seems like it does understand the shows (in the root), it's just a sub directory issue.

ericselk2018 commented 1 year ago

This solves the issue for me: https://github.com/missionpinball/mpf-ls/pull/19