Skip to content

[FEATURE]: Support LSP detection via shebang line for extensionless scripts #15518

@manicolosi

Description

@manicolosi

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Scripts without file extensions (e.g., PEP 723 scripts using uv run --script) don't get LSP support because detection is extension-only.

Example:

#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.11"
# ///

This file has no .py extension but should use pyright.

Proposed solution:

Parse shebang line as fallback when no extension matches. Support common patterns like uv run, python, node, bash, etc.

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)discussionUsed for feature requests, proposals, ideas, etc. Open discussion

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions