VScode Sorbet enable only the LSP, instead of the typecheck

77 Views Asked by At

We have a large Ruby on Rails started at ROR version 4 (recently upgraded to ROR 7, with Ruby 3.2.1).

-> Now the issue is till date we were using the JetBrains RubyMine with docker-compose setup, RubyMine - docker-compose setup, everything was working fine with rubocop, debugger. gem files navigation, and RubyMines intellisense.

-> Now we are planning to stop the RubyMine subscription and started the migration to VScode.

I'm trying to containerize the setup using VSCodes devcontainer feature with the existing docker-compose.yml file configured exsting. I have successfully setted up the ruby-lsp (from shopify). But when I try to setup Sorbet, I have following confusions and issues,

I only wanted the Sorbet's LSP for my project (type checking is not required) - main

For sorbet I need the Sorbet's gem to be installed, but I don't want the existing application's Gemfile to be polluted. Therefore I have created another Gemfile under the .devcontainer folder and added required gems.

Is solargraph is any way better than sorbet.

What is the best way to achieve this requirement?

// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile
{
    "name": "Smart-Homes - VS Code",

    "dockerComposeFile": "../../docker-compose.yml",

    "service": "smart-homes-web_v1",

    // "postCreateCommand": "cd /src && BUNDLE_GEMFILE=/src/.devcontainer/Gemfile.dev bundle install --gemfile=/src/.devcontainer/Gemfile.dev",

    // Features to add to the dev container. More info: https://containers.dev/features.
    "features": {
        "ghcr.io/devcontainers/features/git:1": {
            "version": "latest"
        }
    },

    // Use 'forwardPorts' to make a list of ports inside the container available locally.
    // "forwardPorts": [],

    // Uncomment the next line to run commands after the container is created.
    // "postCreateCommand": "cat /etc/os-release",

    // Configure tool-specific properties.
    "customizations": {
        "vscode": {
            "extensions": [
                "Shopify.ruby-extensions-pack",
                "Shopify.ruby-lsp",
                "sorbet.sorbet-vscode-extension",
                "KoichiSasada.vscode-rdbg"
            ]
        }
    },

    // Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root.
    // "remoteUser": "devcontainer"

    "workspaceFolder": "/src"
}

This is my devcontainer config, and also each time I want to bundle the gems even though the docker-compose does that.

Please help out.

I have successfuly launched the code base in devcontainer using the above config.

The Ruby LSP is working as expected.

But for sorbet,

  1. I have successfully initialized the tapioca But the issue is I only want the sorbet's LSP, type checking is not my need.

So what will be the best conclusion.

  1. Can I able to add the required gems without intefering my main application?
0

There are 0 best solutions below