Skip to content

Commit 2727922

Browse files
committed
Update
1 parent d2f2e8f commit 2727922

7 files changed

+39
-9
lines changed

FEATURES.md

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
- [Go to Controller Action Route](#go-to-controller-action-route)
77
- [Go to Controller Action View](#go-to-controller-action-view)
88
- [Go to Definition](#go-to-definition)
9-
- [Active Record DSLs and Associations](#active-record-dsls-and-associations-1)
10-
- [Route Helpers](#route-helpers)
9+
- [Go to Active Record DSL Definitions](#go-to-active-record-dsl-definitions)
10+
- [Go to Active Record Associations](#go-to-active-record-associations)
11+
- [Go to Route Helper Definitions](#go-to-route-helper-definitions)
1112
- [Ruby File Operations](#ruby-file-operations)
1213
- [Commands](#commands)
1314
- [Rails Generate](#rails-generate)
@@ -20,34 +21,61 @@
2021

2122
## Document Symbol
2223

24+
Document Symbol is a way to represent the structure of a document. They are used to provide a quick overview of the
25+
document and to allow for quick navigation.
26+
27+
Ruby LSP already provides document symbols for Ruby files, such as classes, modules, methods, etc. But the Rails addon
28+
provides additional document symbols for Rails specific features.
29+
30+
In VS Code, you can open the document symbols view by pressing `Ctrl + Shift + O`.
31+
2332
### Active Record DSLs and Associations
2433

25-
![Document Symbol for Active Record DSLs and Associations](./ruby-lsp-rails-ar-dsl-document-symbol.gif)
34+
Navigates between Active Record DSLs and Associations using the `Document Symbol` feature.
35+
36+
![Document Symbol for Active Record DSLs and Associations](./ruby-lsp-rails-document-symbol-ar-model.gif)
2637

2738
### Active Support Test Cases
2839

40+
Navigates between Active Support test cases using the `Document Symbol` feature.
41+
2942
![Document Symbol for tests](./ruby-lsp-rails-test-document-symbol.gif)
3043

3144
## Go to Controller Action Route
3245

46+
Navigates to the route definition of a controller action using the `Code Lens` feature.
47+
3348
![Go to Controller Action Route](./ruby-lsp-rails-controller-action-to-route.gif)
3449

3550
## Go to Controller Action View
3651

52+
Navigates to the view file(s) of a controller action using the `Code Lens` feature.
53+
3754
![Go to Controller Action View](./ruby-lsp-rails-controller-action-to-view.gif)
3855

3956
## Go to Definition
4057

41-
### Active Record DSLs and Associations
58+
Go to definition is a feature that allows you to navigate to the definition of a symbol.
59+
60+
In VS Code, you can trigger go to definition in 3 different ways:
61+
62+
- Select `Go to Definition` from the context menu
63+
- `F12` on a symbol
64+
- `Cmd + Click` on a symbol
65+
66+
In the following demos, we will use the `Cmd + Click` method to trigger go to definition.
4267

43-
This feature enables quick navigation between related model files in Rails projects. Developers can jump between
44-
associations like `belongs_to` and `has_many` using IDE shortcuts, improving code exploration and productivity.
68+
### Go to Active Record DSL Definitions
4569

46-
![Active Record DSLs and Associations](./ruby-lsp-rails-ar-definitions-demo.gif)
70+
![Go to Active Record DSL Definitions](./ruby-lsp-rails-go-to-ar-dsl-definitions.gif)
4771

48-
### Route Helpers
72+
### Go to Active Record Associations
4973

50-
![Route Helpers](./ruby-lsp-rails-go-to-route-definition.gif)
74+
![Go to Active Record Associations](./ruby-lsp-rails-go-to-ar-associations.gif)
75+
76+
### Go to Route Helper Definitions
77+
78+
![Go to Route Helper Definitions](./ruby-lsp-rails-go-to-route-definitions.gif)
5179

5280
## Ruby File Operations
5381

@@ -70,6 +98,8 @@ the above commands.
7098

7199
## Run and Debug
72100

101+
The Rails addon provides 3 ways to run and debug `ActiveSupport` tests using the `Code Lens` feature.
102+
73103
### Run Tests With Test Explorer
74104

75105
![Run Tests With Test Explorer](./ruby-lsp-rails-run.gif)
-1.03 MB
Binary file not shown.
-282 KB
Binary file not shown.
Loading
124 KB
Loading
Loading

0 commit comments

Comments
 (0)