Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Commit

Permalink
Merge pull request #551 from rubyide/remove_environment_support
Browse files Browse the repository at this point in the history
Remote environment support
  • Loading branch information
wingrunr21 authored Nov 19, 2019
2 parents 79d6435 + 71ddf06 commit dcfbb84
Show file tree
Hide file tree
Showing 81 changed files with 1,292 additions and 1,053 deletions.
24 changes: 22 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,22 @@ jobs:
- run:
name: Run Tests
command: yarn test
test_client:
<<: *defaults
working_directory: ~/vscode-ruby/packages/vscode-ruby-client
steps:
- checkout:
path: ~/vscode-ruby
- restore_cache:
name: Restore Yarn Package Cache
keys:
- vscode-ruby-{{ checksum "~/vscode-ruby/yarn.lock" }}-{{ arch }}
- run:
name: Install Dependencies
command: yarn install --frozen-lockfile
- run:
name: Run Tests
command: yarn test
test_common:
<<: *defaults
working_directory: ~/vscode-ruby/packages/vscode-ruby-common
Expand Down Expand Up @@ -127,7 +143,8 @@ jobs:
- run:
name: Install emscripten
command: |
brew install emscripten binaryen
brew unlink node
brew install emscripten binaryen node@12
emcc --help
sed -i '' "s/LLVM_ROOT.*/LLVM_ROOT = '\/usr\/local\/opt\/emscripten\/libexec\/llvm\/bin'/g" ~/.emscripten
sed -i '' "s/BINARYEN_ROOT.*/BINARYEN_ROOT = '\/usr\/local\/opt\/binaryen'/g" ~/.emscripten
Expand All @@ -142,7 +159,7 @@ jobs:
command: gem install ruby-debug-ide debase -N
- run:
name: Run Tests
command: yarn test
command: PATH="/usr/local/opt/node@12/bin:$PATH" yarn test
workflows:
version: 2
build_and_test:
Expand All @@ -155,6 +172,9 @@ workflows:
- test_debugger:
requires:
- setup
- test_client:
requires:
- setup
- test_extension:
requires:
- setup
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ coverage
.cache
lerna-debug.log
*.wasm
build/*
13 changes: 8 additions & 5 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,29 @@
"request": "launch",
"runtimeExecutable": "${execPath}",
"sourceMaps": true,
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
"outFiles": ["${workspaceFolder}/dist/extension/**/*.js"]
"args": [
"--extensionDevelopmentPath=${workspaceFolder}/packages/vscode-ruby-client",
"--extensionDevelopmentPath=${workspaceFolder}/packages/vscode-ruby"
],
"outFiles": ["${workspaceFolder}/packages/vscode-ruby-client/dist/client/**/*.js"]
},
{
"type": "node",
"request": "launch",
"name": "Debug Server",
"cwd": "${workspaceRoot}",
"program": "${workspaceRoot}/src/debugger/main.ts",
"program": "${workspaceRoot}/packages/vscode-ruby-debugger/src/main.ts",
"args": ["--server=4711"],
"sourceMaps": true,
"outFiles": ["${workspaceRoot}/out/**/*.js"]
"outFiles": ["${workspaceRoot}/packages/vscode-ruby-debugger/dist/**/*.js"]
},
{
"name": "Attach to Language Server",
"type": "node",
"request": "attach",
"port": 6009,
"sourceMaps": true,
"outFiles": ["${workspaceRoot}/dist/server/**/*.js"]
"outFiles": ["${workspaceRoot}/packages/language-server-ruby/dist/**/*.js"]
}
],
"compounds": [
Expand Down
8 changes: 3 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@
"eslint.enable": true,
"eslint.packageManager": "yarn",
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"],
"eslint.provideLintTask": true,
"eslint.lintTask.enable": true,
"eslint.workingDirectories": [
{ "directory": "./packages/language-server-ruby", "changeProcessCWD": true },
{ "directory": "./packages/vscode-ruby", "changeProcessCWD": true },
{ "directory": "./packages/vscode-ruby-client", "changeProcessCWD": true },
{ "directory": "./packages/vscode-ruby-common", "changeProcessCWD": true },
{ "directory": "./packages/vscode-ruby-debugger", "changeProcessCWD": true }
],

// Prettier
"prettier.eslintIntegration": false,

// Format with Prettier
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
Expand Down
65 changes: 14 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,63 +1,26 @@
# Visual Studio Code Ruby Extension
# Visual Studio Code Ruby Extensions

[![CircleCI](https://img.shields.io/circleci/build/github/rubyide/vscode-ruby?label=circleci&token=c9eaf03305b3fe24e8bc819f3f48060431e8e78f)](https://circleci.com/gh/rubyide/vscode-ruby)
[![Build status](https://ci.appveyor.com/api/projects/status/vlgs2y7tsc4xpj4c?svg=true)](https://ci.appveyor.com/project/rebornix/vscode-ruby)
[![codecov](https://codecov.io/gh/rubyide/vscode-ruby/branch/master/graph/badge.svg)](https://codecov.io/gh/rubyide/vscode-ruby)

This extension provides Ruby language and debugging support for Visual Studio Code.
This is the monorepo for the Visual Studio Code Ruby extensions.

## Features
Head on over to the [Ruby extension README](https://github.com/rubyide/vscode-ruby/blob/master/packages/vscode-ruby-client/README.md) to get started!

- Automatic Ruby environment detection with support for rvm, rbenv, chruby, and asdf
- Lint support via RuboCop, Standard, and Reek
- Format support via RuboCop, Standard, Rufo, and RubyFMT
- Semantic code folding support
- Semantic highlighting support
- Basic Intellisense support
## Packages

## Installation
- [`vscode-ruby`](https://github.com/rubyide/vscode-ruby/blob/master/packages/vscode-ruby) - extension providing syntax highlighting, language configuration, and snippets for Ruby
- [`vscode-ruby-client`](https://github.com/rubyide/vscode-ruby/blob/master/packages/vscode-ruby-client) - extension logic including the language server client
- [`vscode-ruby-common`](https://github.com/rubyide/vscode-ruby/blob/master/packages/vscode-ruby-common) - common utilities that are shared among several other packages (eg environment detection)
- [`vscode-ruby-debugger`](https://github.com/rubyide/vscode-ruby/blob/master/packages/vscode-ruby-debugger) - implementation of the debugger
- [`language-server-ruby`](https://github.com/rubyide/vscode-ruby/blob/master/packages/language-server-ruby) - language server implementation
<!-- - [`ruby-debug-ide-protocol`](https://github.com/rubyide/vscode-ruby/blob/master/packages/ruby-debug-ide-protocol) - implementation of the [ruby-debug-ide protocol](https://github.com/ruby-debug/ruby-debug-ide/blob/master/protocol-spec.md)r -->

Search for `ruby` in the [VS Code Extension Gallery](https://code.visualstudio.com/docs/editor/extension-gallery) and install it!
## Docs

## Initial Configuration
Documentation is available in the [docs](https://github.com/rubyide/vscode-ruby/tree/master/docs) folder

By default, the extension provides sensible defaults for developers to get a better experience using Ruby in Visual Studio Code. However, these defaults do not include settings to enable features like formatting or linting. Given how dynamic Ruby projects can be (are you using rvm, rbenv, chruby, or asdf? Are your gems globally installed or via bundler? etc), the extension requires additional configuration for additional features to be available.
## Developing

### Using the Language Server

It is **highly recommended** that you enable the Ruby language server (via the Use Language Server setting or `ruby.useLanguageServer` config option). The server does not default to enabled while it is under development but it provides a significantly better experience than the legacy extension functionality. See [docs/language-server.md](https://github.com/rubyide/vscode-ruby/blob/master/docs/language-server.md) for more information on the language server.

Legacy functionality will most likely not receive additional improvements and will be fully removed when the extension hits v1.0

### Example Initial Configuration:

```json
"ruby.useBundler": true, //run non-lint commands with bundle exec
"ruby.useLanguageServer": true, // use the internal language server (see below)
"ruby.lint": {
"rubocop": {
"useBundler": true // enable rubocop via bundler
},
"reek": {
"useBundler": true // enable reek via bundler
}
},
"ruby.format": "rubocop" // use rubocop for formatting
```

Reviewing the [linting](https://github.com/rubyide/vscode-ruby/blob/master/docs/linting.md) and [formatting](https://github.com/rubyide/vscode-ruby/blob/master/docs/formatting.md) docs is recommended

For full details on configuration options, please take a look at the `Ruby` section in the VS Code settings UI. Each option is associated with a name and description.

### Legacy Configuration

[docs/legacy.md](https://github.com/rubyide/vscode-ruby/blob/master/docs/legacy.md) contains the documentation around the legacy functionality

## Troubleshooting

See [docs/troubleshooting.md](https://github.com/rubyide/vscode-ruby/blob/master/docs/troubleshooting.md)

## Other Notable Extensions

- [Ruby Solargraph](https://marketplace.visualstudio.com/items?itemName=castwide.solargraph) - Solargraph is a language server that provides intellisense, code completion, and inline documentation for Ruby.
- [VSCode Endwise](https://github.com/kaiwood/vscode-endwise) - Wisely add "end" in Ruby
See the [developing](https://github.com/rubyide/vscode-ruby/blob/master/docs/developing.md) docs
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ build_script:
# - emsdk_env.bat
- yarn run lerna run build --scope vscode-ruby-debugger
test_script:
- yarn test
- yarn run lerna run test --ignore vscode-ruby

cache:
- .yarn-cache
Expand Down
7 changes: 4 additions & 3 deletions docs/developing.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@

## Repository Structure

This repository uses [`lerna`]() combined with [yarn workspaces]() to organize itself.
This repository uses [`lerna`](https://github.com/lerna/lerna) combined with [yarn workspaces](https://yarnpkg.com/lang/en/docs/workspaces/) to organize itself.

The overall extension is broken out into several packages within the `packages` directory:

- [`vscode-ruby`](https://github.com/rubyide/vscode-ruby/blob/master/packages/vscode-ruby) - extension logic including the language server client
- [`vscode-ruby`](https://github.com/rubyide/vscode-ruby/blob/master/packages/vscode-ruby) - extension providing syntax highlighting, language configuration, and snippets for Ruby
- [`vscode-ruby-client`](https://github.com/rubyide/vscode-ruby/blob/master/packages/vscode-ruby-client) - extension logic including the language server client
- [`vscode-ruby-common`](https://github.com/rubyide/vscode-ruby/blob/master/packages/vscode-ruby-common) - common utilities that are shared among several other packages (eg environment detection)
- [`vscode-ruby-debugger`](https://github.com/rubyide/vscode-ruby/blob/master/packages/vscode-ruby-debugger) - implementation of the debugger
- [`language-server-ruby`](https://github.com/rubyide/vscode-ruby/blob/master/packages/language-server-ruby) - language server implementation
- [`ruby-debug-ide-protocol`](https://github.com/rubyide/vscode-ruby/blob/master/packages/ruby-debug-ide-protocol) - implementation of the [ruby-debug-ide protocol](https://github.com/ruby-debug/ruby-debug-ide/blob/master/protocol-spec.md)
<!-- - [`ruby-debug-ide-protocol`](https://github.com/rubyide/vscode-ruby/blob/master/packages/ruby-debug-ide-protocol) - implementation of the [ruby-debug-ide protocol](https://github.com/ruby-debug/ruby-debug-ide/blob/master/protocol-spec.md) -->

Each package utilizes `webpack` or `tsc` to build the `dist` directory, depending up on whether `node_modules` needs to be bundled

Expand Down
Binary file added images/syntax_after.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/syntax_before.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit dcfbb84

Please sign in to comment.