Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language Server Infrastructure #49

Merged
merged 7 commits into from
Mar 6, 2024
Merged

Conversation

nvarner
Copy link
Contributor

@nvarner nvarner commented Mar 4, 2024

Initial implementation of a language server, implementing document sync and supporting the document symbols request (in VS Code, enables the Overview pane and symbol search).

  • I saw that .vscode is in the .gitignore. However, .vscode/launch.json and .vscode/tasks.json are valuable for testing the language server extension. I copied my settings into .vscode-template for now; is there a more preferred approach?
  • I noticed that the repo doesn't have a license (except for the /editor/code/zls directory). Is this project intended to be closed source?

@LighghtEeloo LighghtEeloo self-assigned this Mar 4, 2024
@LighghtEeloo LighghtEeloo added the enhancement New feature or request label Mar 4, 2024
@maxsnew
Copy link
Contributor

maxsnew commented Mar 4, 2024

Asking Yuchen to review. Do you have instructions on how to use it? E.g., in VSCode/emacs?

And we should add a LICENSE. MIT is fine with me and uncontroversial

Copy link
Contributor

@LighghtEeloo LighghtEeloo left a comment

Choose a reason for hiding this comment

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

Overall, the pull request LGTM. The infrastructure looks promising, so I'd say we accept it and build upon it.

.vscode-template/launch.json Outdated Show resolved Hide resolved
editor/zls/Cargo.toml Show resolved Hide resolved
editor/zls/src/document_symbols.rs Show resolved Hide resolved
editor/zls/src/document_symbols.rs Outdated Show resolved Hide resolved
@LighghtEeloo
Copy link
Contributor

LighghtEeloo commented Mar 4, 2024

Initial implementation of a language server, implementing document sync and supporting the document symbols request (in VS Code, enables the Overview pane and symbol search).

  • I saw that .vscode is in the .gitignore. However, .vscode/launch.json and .vscode/tasks.json are valuable for testing the language server extension. I copied my settings into .vscode-template for now; is there a more preferred approach?
  • I noticed that the repo doesn't have a license (except for the /editor/code/zls directory). Is this project intended to be closed source?

Directly addressing these:

  • We've got two options: make .vscode/{launch,tasks}.json tracked under zls directory, or move zls out as its own repo and allow the configs to be tracked. If zls and zydeco are too intertwined we'll keep them as are; otherwise, I'd prefer to separate them. (You can reply to this above)
  • It should be totally open source. Any recommended license? MIT seems ideal and is widely used in academia. (Edit: Never mind just saw Max's comment lol)

@nvarner
Copy link
Contributor Author

nvarner commented Mar 5, 2024

@maxsnew to run the VS Code extension during development, open editors/ in VS Code and launch "Run Extension" (defined in editors/.vscode/tasks.json). After the first run, this is bound to Ctrl+F5 on my system.

To release the extension on the VS Code Marketplace, the zls binary would currently have to be manually cross-compiled and copied into the VS Code extension for each OS/architecture you want to support. If desired, this can be more automated with a build system; I've had success setting up GitHub actions to build and deploy a language server and extensions.

I'm not familiar with Emacs, but there is a plugin which I believe provides very good LSP support. You would have to compile zls, then tell lsp-mode where to find the binary.

@LighghtEeloo
Copy link
Contributor

Nice work! We'll build our LSP on this once we figure out how to dump the type-checking results, probably after a few new features are implemented on the front end (a minimal module system, for example). Thank you for your contribution! Make any final changes you'd like, and when you feel ready, tell me to merge :)

@nvarner
Copy link
Contributor Author

nvarner commented Mar 5, 2024

Should be ready to merge now. Thanks!

@LighghtEeloo LighghtEeloo merged commit 7478a89 into zydeco-lang:main Mar 6, 2024
1 check passed
@nvarner nvarner deleted the zls branch March 6, 2024 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants