Skip to content

feat: Add Deno LSP support - #1048

Closed
nktkas wants to merge 6 commits into
oraios:mainfrom
nktkas:feature/add-deno-language-server
Closed

feat: Add Deno LSP support#1048
nktkas wants to merge 6 commits into
oraios:mainfrom
nktkas:feature/add-deno-language-server

Conversation

@nktkas

@nktkas nktkas commented Feb 16, 2026

Copy link
Copy Markdown

Summary

Add support for https://deno.com/ projects.

Deno

  • Uses the built-in deno lsp
  • Uses deno from PATH when available, otherwise auto-installs via https://www.npmjs.com/package/deno
  • Supports .ts, .tsx, .js, .jsx files
  • Auto-detected when deno.json, deno.jsonc, or deno.lock is found in the project root (replaces TypeScript LS)

Changes

Category Files
Language Server src/solidlsp/language_servers/deno_language_server.py
Config src/solidlsp/ls_config.py, pyproject.toml
Auto-detection src/serena/util/inspection.py
Tests test/solidlsp/deno/test_deno_basic.py, test/serena/test_serena_agent.py, test/resources/repos/deno/test_repo/*
Docs README.md, docs/01-about/020_programming-languages.md, CHANGELOG.md

Copilot AI review requested due to automatic review settings February 16, 2026 02:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for Deno projects via LSP integration, using the built-in deno lsp command. The implementation follows established patterns from other language servers in the codebase, particularly TypeScript, given Deno's JavaScript/TypeScript compatibility. The language server is marked as experimental and requires explicit configuration to avoid conflicts with the TypeScript language server for .ts files.

Changes:

  • Added DenoLanguageServer class with npm-based auto-installation fallback when Deno isn't found on PATH
  • Registered Deno as an experimental language in the Language enum with appropriate file matchers (.ts, .tsx, .js, .jsx)
  • Added comprehensive tests including symbol lookup and cross-file reference tests with realistic Deno code samples

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/solidlsp/language_servers/deno_language_server.py Main Deno LSP implementation with dependency management and LSP protocol handlers
src/solidlsp/ls_config.py Language enum registration, file matchers, and experimental flag configuration
test/solidlsp/deno/test_deno_basic.py Basic Deno language server tests for symbol lookup and references
test/serena/test_serena_agent.py Integration tests for Serena agent with Deno support
test/resources/repos/deno/test_repo/* Test repository with valid Deno code using JSR and Deno.land imports
pyproject.toml Added pytest marker for Deno tests
README.md Added Deno to supported languages list
docs/01-about/020_programming-languages.md Documented Deno support with setup notes
CHANGELOG.md Added entry for Deno support

Comment thread src/solidlsp/language_servers/deno_language_server.py Outdated
Comment thread src/solidlsp/language_servers/deno_language_server.py Outdated
@nktkas

nktkas commented Feb 16, 2026

Copy link
Copy Markdown
Author

Need to explore the possibility of auto-detection based on the deno.json / deno.jsonc file.

@nktkas

nktkas commented Feb 16, 2026

Copy link
Copy Markdown
Author

This commit (615bce2) adds a small universal code to the general logic of the project.
If such a change is not acceptable, this commit can be rolled back; this PR will work without it.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Comment thread docs/01-about/020_programming-languages.md
Inside `case self.DENO`, mypy narrows self to Literal['deno'], so self.TYPESCRIPT is not accessible. Use Language.TYPESCRIPT instead.

@MischaPanch MischaPanch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution! Only minor comments, except the one on the language detection mechanism

@opcode81 pls see my comment there. We may either fully address it ourselves on this branch, after my proposal has been implemented, or the author wants to perform the refactoring, or we merge it without the refactoring and postpone it.


# Resolve conflicts between languages that share file extensions.
# Languages can declare project markers that give them precedence over another language.
for language in list(language_counts):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

list is unnecessary

markers, overrides = override
if overrides not in language_counts:
continue
if any(os.path.exists(os.path.join(repo_path, m)) for m in markers):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here we rather need a method in Language, like get_conflicting_languages_to_have_preference_over(repo_path) -> list[Language]

The long function name is an indication that we lack a proper abstraction for the new concept introduced by this PR: not an experimental language but an actual conflict between viable alternatives that can only be resolved by looking into the project. While a full refactoring may be out of scope for this contribution (unless you would like to do that, in which case, go ahead!), at least we shouldn't expose the markers as part of the public interface. It should be internal to Language. The new method should also get a detailed docstring, explaining why it's needed

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The autodetection should then also be tested, using the new method on the typescipt and the deno test repos


Auto-detected when deno.json, deno.jsonc, or deno.lock is found in the project root.

You can pass the following entries in ls_specific_settings["deno"]:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we document all extra settings in our docs, pls extend it there too

@pytest.mark.deno
class TestDenoLanguageServer:
@pytest.mark.parametrize("language_server", [Language.DENO], indirect=True)
def test_find_symbol(self, language_server: SolidLanguageServer) -> None:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you pls add a test making sure request_hover works? We found that some LS have problems with this, making it worth testing. I will extend our guide on LS support implementation accordingly

@MischaPanch

Copy link
Copy Markdown
Member

@nktkas ping

@MischaPanch

Copy link
Copy Markdown
Member

Deno support was added with #1778

@MischaPanch MischaPanch closed this Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants