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

Update docs for indexing enhancements #3283

Merged
merged 1 commit into from
Mar 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 1 addition & 27 deletions jekyll/add-ons.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -302,33 +302,7 @@ class MyIndexingEnhancement < RubyIndexer::Enhancement
end
```

Finally, we need to register our enhancement in the index once during the add-on's activation.

```ruby
module RubyLsp
module MyLibrary
class Addon < ::RubyLsp::Addon
def activate(global_state, message_queue)
# Register the enhancement as part of the indexing process
global_state.index.register_enhancement(MyIndexingEnhancement.new(global_state.index))
end

def deactivate
end

def name
"MyLibrary"
end

def version
"0.1.0"
end
end
end
end
```

Done! With this the Ruby LSP should automatically handle calls to `my_dsl_that_creates_methods` and create an accurate
With this the Ruby LSP should automatically handle calls to `my_dsl_that_creates_methods` and create an accurate
representation of the declarations that will be available in the runtime.

### Registering formatters
Expand Down
Loading