holistic-ruby 0.1.1 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/holistic/application.rb +12 -4
- data/lib/holistic/database/migrations.rb +20 -0
- data/lib/holistic/database/node.rb +29 -0
- data/lib/holistic/database/table.rb +53 -53
- data/lib/holistic/document/file/record.rb +10 -0
- data/lib/holistic/document/file/repository.rb +24 -0
- data/lib/holistic/document/file/store.rb +13 -0
- data/lib/holistic/document/location.rb +4 -6
- data/lib/holistic/document/unsaved/record.rb +0 -4
- data/lib/holistic/extensions/events.rb +9 -1
- data/lib/holistic/extensions/ruby/stdlib.rb +26 -12
- data/lib/holistic/language_server/requests/lifecycle/initialize.rb +5 -10
- data/lib/holistic/language_server/requests/text_document/completion.rb +11 -8
- data/lib/holistic/language_server/requests/text_document/did_close.rb +6 -12
- data/lib/holistic/language_server/requests/text_document/did_open.rb +1 -0
- data/lib/holistic/language_server/requests/text_document/did_save.rb +5 -9
- data/lib/holistic/language_server/requests/text_document/find_references.rb +7 -4
- data/lib/holistic/language_server/requests/text_document/go_to_definition.rb +3 -2
- data/lib/holistic/ruby/autocompletion/suggest.rb +65 -15
- data/lib/holistic/ruby/parser/constant_resolution.rb +60 -9
- data/lib/holistic/ruby/parser/live_editing/process_file_changed.rb +24 -21
- data/lib/holistic/ruby/parser/nesting_syntax.rb +1 -0
- data/lib/holistic/ruby/parser/program_visitor.rb +57 -44
- data/lib/holistic/ruby/parser.rb +14 -9
- data/lib/holistic/ruby/reference/delete.rb +18 -0
- data/lib/holistic/ruby/reference/find_referenced_scope.rb +2 -2
- data/lib/holistic/ruby/reference/record.rb +7 -8
- data/lib/holistic/ruby/reference/repository.rb +19 -41
- data/lib/holistic/ruby/reference/store.rb +18 -0
- data/lib/holistic/ruby/scope/delete.rb +29 -0
- data/lib/holistic/ruby/scope/kind.rb +6 -5
- data/lib/holistic/ruby/scope/lexical.rb +11 -0
- data/lib/holistic/ruby/scope/list_references.rb +2 -2
- data/lib/holistic/ruby/scope/location.rb +9 -9
- data/lib/holistic/ruby/scope/outline.rb +8 -8
- data/lib/holistic/ruby/scope/record.rb +15 -47
- data/lib/holistic/ruby/scope/repository.rb +24 -25
- data/lib/holistic/ruby/scope/store.rb +45 -0
- data/lib/holistic/ruby/type_inference/processing_queue.rb +19 -0
- data/lib/holistic/ruby/type_inference/solve.rb +23 -21
- data/lib/holistic/ruby/type_inference/solve_pending_references.rb +3 -1
- data/lib/holistic/version.rb +1 -1
- metadata +13 -9
- data/lib/holistic/document/file.rb +0 -36
- data/lib/holistic/ruby/parser/table_of_contents.rb +0 -17
- data/lib/holistic/ruby/reference/register.rb +0 -15
- data/lib/holistic/ruby/reference/unregister.rb +0 -11
- data/lib/holistic/ruby/scope/register.rb +0 -31
- data/lib/holistic/ruby/scope/unregister.rb +0 -27
- data/lib/holistic/ruby/type_inference/conclusion.rb +0 -20
@@ -1,31 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Holistic::Ruby::Scope
|
4
|
-
module Register
|
5
|
-
extend self
|
6
|
-
|
7
|
-
def call(repository:, parent:, kind:, name:, location:)
|
8
|
-
child_scope = append_location_to_existing_scope(scope: parent, name:, location:) || add_new_scope(parent:, kind:, name:, location:)
|
9
|
-
|
10
|
-
repository.register_scope(child_scope)
|
11
|
-
|
12
|
-
child_scope
|
13
|
-
end
|
14
|
-
|
15
|
-
private
|
16
|
-
|
17
|
-
def append_location_to_existing_scope(scope:, name:, location:)
|
18
|
-
child_scope = scope.children.find { _1.name == name }
|
19
|
-
|
20
|
-
return if child_scope.nil?
|
21
|
-
|
22
|
-
child_scope.tap { _1.locations << location }
|
23
|
-
end
|
24
|
-
|
25
|
-
def add_new_scope(parent:, kind:, name:, location:)
|
26
|
-
child_scope = Record.new(kind:, name:, parent:, location:)
|
27
|
-
|
28
|
-
child_scope.tap { parent.children << _1 }
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Holistic::Ruby::Scope
|
4
|
-
module Unregister
|
5
|
-
extend self
|
6
|
-
|
7
|
-
def call(repository:, fully_qualified_name:, file_path:)
|
8
|
-
scope = repository.find_by_fully_qualified_name(fully_qualified_name)
|
9
|
-
|
10
|
-
return :scope_not_found if scope.nil?
|
11
|
-
|
12
|
-
updated_locations = scope.locations.reject! { |scope_location| scope_location.declaration.file_path == file_path }
|
13
|
-
|
14
|
-
return :scope_not_defined_in_speciefied_file if updated_locations.nil?
|
15
|
-
|
16
|
-
if updated_locations.empty?
|
17
|
-
scope.parent.children.delete(scope)
|
18
|
-
|
19
|
-
repository.delete_by_fully_qualified_name(fully_qualified_name)
|
20
|
-
else
|
21
|
-
repository.register_scope(scope)
|
22
|
-
end
|
23
|
-
|
24
|
-
:definition_unregistered
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Holistic::Ruby::TypeInference
|
4
|
-
STATUS_PENDING = :pending
|
5
|
-
STATUS_DONE = :done
|
6
|
-
|
7
|
-
Conclusion = ::Data.define(:status, :dependency_identifier) do
|
8
|
-
def self.pending
|
9
|
-
new(status: STATUS_PENDING, dependency_identifier: nil)
|
10
|
-
end
|
11
|
-
|
12
|
-
def self.unresolved
|
13
|
-
new(status: STATUS_DONE, dependency_identifier: nil)
|
14
|
-
end
|
15
|
-
|
16
|
-
def self.done(dependency_identifier)
|
17
|
-
new(status: STATUS_DONE, dependency_identifier:)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|