-
Notifications
You must be signed in to change notification settings - Fork 226
Support Sorbet typed: false files for completion requests
#1245
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
Changes from 2 commits
659b07d
5c6364c
4d3c576
de8f237
134bad2
2f933d2
7545635
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,13 +36,15 @@ class Completion < Listener | |
| index: RubyIndexer::Index, | ||
| nesting: T::Array[String], | ||
| dispatcher: Prism::Dispatcher, | ||
| typechecker_enabled: T::Boolean, | ||
| ).void | ||
| end | ||
| def initialize(index, nesting, dispatcher) | ||
| def initialize(index, nesting, dispatcher, typechecker_enabled) | ||
| super(dispatcher) | ||
| @_response = T.let([], ResponseType) | ||
| @index = index | ||
| @nesting = nesting | ||
| @typechecker_enabled = typechecker_enabled | ||
|
|
||
| dispatcher.register( | ||
| self, | ||
|
|
@@ -63,7 +65,7 @@ def on_string_node_enter(node) | |
| # Handle completion on regular constant references (e.g. `Bar`) | ||
| sig { params(node: Prism::ConstantReadNode).void } | ||
| def on_constant_read_node_enter(node) | ||
| return if DependencyDetector.instance.typechecker | ||
| return if @typechecker_enabled | ||
|
||
|
|
||
| name = node.slice | ||
| candidates = @index.prefix_search(name, @nesting) | ||
|
|
@@ -82,7 +84,7 @@ def on_constant_read_node_enter(node) | |
| # Handle completion on namespaced constant references (e.g. `Foo::Bar`) | ||
| sig { params(node: Prism::ConstantPathNode).void } | ||
| def on_constant_path_node_enter(node) | ||
| return if DependencyDetector.instance.typechecker | ||
| return if @typechecker_enabled | ||
|
|
||
| name = node.slice | ||
|
|
||
|
|
@@ -125,7 +127,7 @@ def on_constant_path_node_enter(node) | |
|
|
||
| sig { params(node: Prism::CallNode).void } | ||
| def on_call_node_enter(node) | ||
| return if DependencyDetector.instance.typechecker | ||
| return if @typechecker_enabled | ||
| return unless self_receiver?(node) | ||
|
|
||
| name = node.message | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.