Bug
LSP servers configured with extensionless filenames in the extensions array never activate. This affects any extensionless file that should be treated as Python, such as wscript files used by the waf build system.
Root cause
The extension matching logic falls back to the full absolute path when a file has no extension:
let m = z1.parse(K).ext || K
For /home/user/project/subdir/wscript, path.parse(K).ext is "", so m becomes the full path. extensions.includes(m) then never matches "wscript".
Suggested fix
let m = z1.parse(K).ext || z1.basename(K)
Reproduction
Open any file named wscript. The LSP server never starts.
Version
OpenCode 1.17.9
Bug
LSP servers configured with extensionless filenames in the
extensionsarray never activate. This affects any extensionless file that should be treated as Python, such aswscriptfiles used by the waf build system.Root cause
The extension matching logic falls back to the full absolute path when a file has no extension:
For
/home/user/project/subdir/wscript,path.parse(K).extis"", sombecomes the full path.extensions.includes(m)then never matches"wscript".Suggested fix
Reproduction
Open any file named
wscript. The LSP server never starts.Version
OpenCode 1.17.9