Skip to content

Conversation

@onbjerg
Copy link
Contributor

@onbjerg onbjerg commented Aug 15, 2025

Adds a basic LSP exposed as solar lsp. The default behavior for solar is still to compile.

The LSP itself is implemented as a thin VFS that sits on top of files on disk. It's pretty dumb, so every time a file is changed, the entirety of the project is reparsed and relowered. Diagnostics from this process is published to the client.

The VFS itself makes use of ropes for file content.

The structure is heavily inspired by rust-analyzer, albeit with some simplifications given Solar is pretty fast and Solidity projects are usually fairly small.

Closes #417

@onbjerg onbjerg added C-enhancement Category: an issue proposing an enhancement or a PR with one A-lsp Area: LSP labels Aug 15, 2025
@onbjerg
Copy link
Contributor Author

onbjerg commented Aug 15, 2025

Going to migrate to async-lsp since tower-lsp is both unmaintained and semantically incorrect.

@onbjerg onbjerg force-pushed the onbjerg/lsp-scaffolding branch 11 times, most recently from 5b46d64 to dbe18cf Compare August 16, 2025 01:46
@onbjerg onbjerg force-pushed the onbjerg/lsp-scaffolding branch 6 times, most recently from 4cad319 to 6b47d04 Compare August 18, 2025 12:26
@onbjerg onbjerg self-assigned this Aug 18, 2025
@onbjerg onbjerg added this to Solar Aug 18, 2025
@onbjerg onbjerg force-pushed the onbjerg/lsp-scaffolding branch 4 times, most recently from b361c90 to 5e87c38 Compare August 18, 2025 16:36
.notification::<notif::Exit>(|_, _| ControlFlow::Break(Ok(())));

// Notifications
router
Copy link
Member

Choose a reason for hiding this comment

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

why don't we implement the LanguageServer trait?

@onbjerg onbjerg force-pushed the onbjerg/lsp-scaffolding branch from 5e87c38 to f2a35c1 Compare August 18, 2025 16:40
@mmsaki
Copy link

mmsaki commented Aug 29, 2025

getting ICE compiler errors from the incremental document sync while using current solar lsp.

@onbjerg
Copy link
Contributor Author

onbjerg commented Aug 29, 2025

Hi @mmsaki, it's currently a draft and not entirely complete, so it's expected to not work in all cases. Can you share what project you tried using it in for future reference? I'll make sure it works before merging

@onbjerg onbjerg force-pushed the onbjerg/lsp-scaffolding branch 4 times, most recently from 0efd93e to 63ae5f5 Compare September 3, 2025 17:52
@onbjerg onbjerg force-pushed the onbjerg/lsp-scaffolding branch from 63ae5f5 to 55f30f8 Compare September 9, 2025 21:21
@onbjerg onbjerg force-pushed the onbjerg/lsp-scaffolding branch 2 times, most recently from 44ccde5 to 51051d1 Compare September 15, 2025 11:35
DaniPopes added a commit that referenced this pull request Sep 15, 2025
Allow the tracing output to be written to either stdout or stderr,
defaulting to stdout. Can be extended with support for files later, if
desired.

Useful for #401 to get more detailed output

---------

Co-authored-by: DaniPopes <[email protected]>
@onbjerg onbjerg added this to the 0.2.0 milestone Sep 17, 2025
@onbjerg onbjerg force-pushed the onbjerg/lsp-scaffolding branch from 51051d1 to 6a28652 Compare September 17, 2025 23:25
@codspeed-hq
Copy link

codspeed-hq bot commented Sep 17, 2025

CodSpeed Performance Report

Merging #401 will not alter performance

Comparing onbjerg/lsp-scaffolding (6b3b622) with main (d0cc4ff)

Summary

✅ 35 untouched

@onbjerg onbjerg force-pushed the onbjerg/lsp-scaffolding branch from 6a28652 to 6b3b622 Compare September 18, 2025 04:42
@DaniPopes DaniPopes moved this from In Progress to Todo in Solar Oct 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-lsp Area: LSP C-enhancement Category: an issue proposing an enhancement or a PR with one

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

Basic LSP lifecycle

4 participants