puppetlabs / puppetlabs/puppet-editor-services

[RFC] What would it take to not use Ruby for the Language Server?

Open
#304 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Ruby
Stars
52
Forks
21
Avg merge
15h
Merged PRs (30d)
3

Description

Out of Scope

Debug Server - The debug server requires compilation which HAS to have a ruby runtime.

In Scope

  • As far as I know there are only two languages which support a lexer/parser for the Puppet Language: Ruby (of course!) and Golang via Lyra
  • Golang does have a Language Server Protocol module so there wouldn't be a need to create our own server and protocol.
  • Golang compiles to a small binary on many platforms

Therefore Golang would be considered an alternate language for the Puppet Editor Services

Feature All in Go Needs information from Ruby Hosted entirely in Ruby Notes
Code Folding Just needs the Puppet Lexer
Diagnostics Needs puppet-lint. There's nothing comparable in Go
Diagnostics The puppetfile-resolver is in Ruby. But it could be done in Go. Except the puppetfile is actually ruby code
Hover The parser is needed to locate the cursor in the document (which could be Go) however the actual information comes from the Sidecar, which requires YARD and Puppet Strings, which requires Ruby. But it is out-of-process/async-able
Autocomplete See Hover comments
Definition See Hover comments
Document Symbol Requires parser
Format on Type Currently it uses the Puppet Lint lexer which is Ruby only. But it could be changed to use the Puppet lexer based on the code folding
Signature Provider See Hover comments
Puppet - Resource Requires Puppet providers (Ruby) therefore can't be in Go
Puppet - Get Facts Facter (2/4) is in Ruby
Puppet - Node Graph Requires compilation therefore can't be in Go
Workspace Symbol See Hover comments

'

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or entry points. Start by reviewing the feature table and the Ruby and Go parser, language-server, diagnostics, resolver, and Puppet integration dependencies it identifies. Done would require a scoped, agreed design for which components can move to Go and which must remain in Ruby.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, ruby
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.