You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This version of semshi throws an error when trying to open a file involving Python 3.10's match/case syntax. (I've switched to this from the original numirias/semshi because that just treats a use of match as an error in your Python code!) It's possible this is my fault for switching from numirias/semshi incorrectly, but all other Python files seem to open just fine - it's only files using the match/case syntax that throw an error.
Steps to reproduce:
Save a file containing the following code:
def test(arg):
match arg:
case True:
print('worked')
case False:
print('didnt work')
test(False)
Reopen the test file with neovim
You should get a large error like the following (probably not partially in Norwegian, but you get the idea):
Feil oppdaget under prosessering av BufReadPost Autokommandoer for "*":
Error executing lua callback: /usr/share/nvim/runtime/filetype.lua:24: Error executing lua: /usr/share/nvim/runtime/filetype.lua:25: BufReadPost Autokommandoer for "*"..FileType Autokommandoer for "*"..function <SNR>12_filetype_changed[4]..remote#define#CommandBootstrap[5]..remote#define#request, line 2: Vim(let):Error invoking '/home/[USER]/.local/share/nvim/plugged/semshi/rplugin/python3/semshi:command:Semshi' on channel 3 (pytho
n3-rplugin-host):Feil oppdaget under prosessering av BufReadPost Autokommandoer for "*":
Error executing lua callback: /usr/share/nvim/runtime/filetype.lua:24: Error executing lua: /usr/share/nvim/runtime/filetype.lua:25: BufReadPost Autokommandoer for "*"..FileType Autokommandoer for "*"..function <SNR>12_filetype_changed[4]..remote#define#CommandBootstrap[5]..remote#define#request, line 2: Vim(let):Error invoking '/home/[USER]/.local/share/nvim/plugged/semshi/rplugin/python3/semshi:command:Semshi' on channel 3 (pytho
n3-rplugin-host):
error caught in request handler '/home/[USER]/.local/share/nvim/plugged/semshi/rplugin/python3/semshi:command:Semshi [['enable']]':
Traceback (most recent call last):
File "/home/[USER]/.local/share/nvim/plugged/semshi/rplugin/python3/semshi/plugin.py", line 151, in cmd_semshi
func(self, *args[1:])
File "/home/[USER]/.local/share/nvim/plugged/semshi/rplugin/python3/semshi/plugin.py", line 35, in wrapper
func(self, *args, **kwargs)
File "/home/[USER]/.local/share/nvim/plugged/semshi/rplugin/python3/semshi/plugin.py", line 174, in enable
self.highlight()
File "/home/[USER]/.local/share/nvim/plugged/semshi/rplugin/python3/semshi/plugin.py", line 35, in wrapper
func(self, *args, **kwargs)
File "/home/[USER]/.local/share/nvim/plugged/semshi/rplugin/python3/semshi/plugin.py", line 197, in highlight
self._cur_handler.update(force=True, sync=True)
File "/home/[USER]/.local/share/nvim/plugged/semshi/rplugin/python3/semshi/handler.py", line 71, in update
self._update_step(force=force, sync=True)
File "/home/[USER]/.local/share/nvim/plugged/semshi/rplugin/python3/semshi/util.py", line 19, in wrapper
res = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/home/[USER]/.local/share/nvim/plugged/semshi/rplugin/python3/semshi/handler.py", line 163, in _update_step
add, rem = self._parser.parse(code, force)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/[USER]/.local/share/nvim/plugged/semshi/rplugin/python3/semshi/util.py", line 19, in wrapper
res = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/home/[USER]/.local/share/nvim/plugged/semshi/rplugin/python3/semshi/parser.py", line 47, in parse
return self._parse(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/[USER]/.local/share/nvim/plugged/semshi/rplugin/python3/semshi/parser.py", line 68, in _parse
new_nodes = self._make_nodes(code, new_lines, change_lineno)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/[USER]/.local/share/nvim/plugged/semshi/rplugin/python3/semshi/parser.py", line 108, in _make_nodes
return visitor(lines, symtable_root, ast_root)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/[USER]/.local/share/nvim/plugged/semshi/rplugin/python3/semshi/util.py", line 19, in wrapper
res = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/home/[USER]/.local/share/nvim/plugged/semshi/rplugin/python3/semshi/visitor.py", line 50, in visitor
visitor.visit(ast_root)
File "/home/[USER]/.local/share/nvim/plugged/semshi/rplugin/python3/semshi/visitor.py", line 130, in visit
self._iter_node(node)
File "/home/[USER]/.local/share/nvim/plugged/semshi/rplugin/python3/semshi/visitor.py", line 413, in _iter_node
self.visit(item)
File "/home/[USER]/.local/share/nvim/plugged/semshi/rplugin/python3/semshi/visitor.py", line 120, in visit
self._iter_node(node)
File "/home/[USER]/.local/share/nvim/plugged/semshi/rplugin/python3/semshi/visitor.py", line 413, in _iter_node
self.visit(item)
File "/home/[USER]/.local/share/nvim/plugged/semshi/rplugin/python3/semshi/visitor.py", line 135, in visit
self._iter_node(node)
File "/home/[USER]/.local/share/nvim/plugged/semshi/rplugin/python3/semshi/visitor.py", line 413, in _iter_node
self.visit(item)
File "/home/[USER]/.local/share/nvim/plugged/semshi/rplugin/python3/semshi/visitor.py", line 135, in visit
self._iter_node(node)
File "/home/[USER]/.local/share/nvim/plugged/semshi/rplugin/python3/semshi/visitor.py", line 417, in _iter_node
self.visit(value)
File "/home/[USER]/.local/share/nvim/plugged/semshi/rplugin/python3/semshi/visitor.py", line 135, in visit
self._iter_node(node)
File "/home/[USER]/.local/share/nvim/plugged/semshi/rplugin/python3/semshi/visitor.py", line 417, in _iter_node
self.visit(value)
File "/home/[USER]/.local/share/nvim/plugged/semshi/rplugin/python3/semshi/visitor.py", line 135, in visit
self._iter_node(node)
File "/home/[USER]/.local/share/nvim/plugged/semshi/rplugin/python3/semshi/visitor.py", line 404, in _iter_node
for field in node._fields:
^^^^^^^^^^^^
AttributeError: 'bool' object has no attribute '_fields'
stack traceback:
[C]: in function 'nvim_cmd'
/usr/share/nvim/runtime/filetype.lua:25: in function </usr/share/nvim/runtime/filetype.lua:24>
[C]: in function 'nvim_buf_call'
/usr/share/nvim/runtime/filetype.lua:24: in function </usr/share/nvim/runtime/filetype.lua:10>
stack traceback:
[C]: in function 'nvim_buf_call'
/usr/share/nvim/runtime/filetype.lua:24: in function </usr/share/nvim/runtime/filetype.lua:10>
Trykk ENTER eller skriv kommando for å fortsette
You can bypass the error to continue editing the file, but the highlighting rules aren't fully operational.
If you replace the match/case syntax in the test code with an if/else statement, the file should open normally.
The text was updated successfully, but these errors were encountered:
This version of semshi throws an error when trying to open a file involving Python 3.10's
match
/case
syntax. (I've switched to this from the original numirias/semshi because that just treats a use ofmatch
as an error in your Python code!) It's possible this is my fault for switching from numirias/semshi incorrectly, but all other Python files seem to open just fine - it's only files using thematch
/case
syntax that throw an error.Steps to reproduce:
You should get a large error like the following (probably not partially in Norwegian, but you get the idea):
You can bypass the error to continue editing the file, but the highlighting rules aren't fully operational.
If you replace the
match
/case
syntax in the test code with anif
/else
statement, the file should open normally.The text was updated successfully, but these errors were encountered: