Skip to content

Commit fc76167

Browse files
authored
Merge branch 'ruby:master' into Add_type_arguments_support_to_singleton_types
2 parents e20d336 + f5d6342 commit fc76167

File tree

13 files changed

+40
-34
lines changed

13 files changed

+40
-34
lines changed

.clangd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CompileFlags:
2+
CompilationDatabase: ext/rbs_extension

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,7 @@ lib/**/*.dll
2121
doc/
2222

2323
**/*.gem
24+
25+
# For clangd's editor integration
26+
ext/rbs_extension/compile_commands.json
27+
ext/rbs_extension/.cache

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ gem "rdoc"
2020
gem "fileutils"
2121
gem "raap"
2222
gem "activesupport", "~> 7.0"
23+
gem "extconf_compile_commands_json"
2324

2425
group :libs do
2526
# Libraries required for stdlib test

Gemfile.lock

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
rbs (4.0.0.dev.2)
4+
rbs (4.0.0.dev.4)
55
logger
66
prism (>= 1.3.0)
77

@@ -40,6 +40,8 @@ GEM
4040
diff-lcs (1.6.2)
4141
digest (3.2.0)
4242
drb (2.2.1)
43+
erb (5.0.1)
44+
extconf_compile_commands_json (0.0.7)
4345
ffi (1.17.2)
4446
fileutils (1.7.3)
4547
goodcheck (3.1.0)
@@ -49,19 +51,19 @@ GEM
4951
strong_json (>= 1.1, < 2.2)
5052
i18n (1.14.7)
5153
concurrent-ruby (~> 1.0)
52-
json (2.10.2)
54+
json (2.12.0)
5355
json-schema (5.1.1)
5456
addressable (~> 2.8)
5557
bigdecimal (~> 3.1)
56-
language_server-protocol (3.17.0.4)
58+
language_server-protocol (3.17.0.5)
5759
lint_roller (1.1.0)
5860
listen (3.9.0)
5961
rb-fsevent (~> 0.10, >= 0.10.3)
6062
rb-inotify (~> 0.9, >= 0.9.10)
6163
logger (1.7.0)
6264
marcel (1.0.4)
6365
memory_profiler (1.1.0)
64-
mini_portile2 (2.8.8)
66+
mini_portile2 (2.8.9)
6567
minitest (5.25.5)
6668
mutex_m (0.3.0)
6769
net-protocol (0.2.2)
@@ -95,7 +97,8 @@ GEM
9597
rb-fsevent (0.11.2)
9698
rb-inotify (0.11.1)
9799
ffi (~> 1.0)
98-
rdoc (6.13.1)
100+
rdoc (6.14.0)
101+
erb
99102
psych (>= 4.0.0)
100103
regexp_parser (2.10.0)
101104
rspec (3.13.0)
@@ -111,7 +114,7 @@ GEM
111114
diff-lcs (>= 1.2.0, < 2.0)
112115
rspec-support (~> 3.13.0)
113116
rspec-support (3.13.3)
114-
rubocop (1.75.5)
117+
rubocop (1.75.6)
115118
json (~> 2.3)
116119
language_server-protocol (~> 3.17.0.2)
117120
lint_roller (~> 1.1.0)
@@ -125,7 +128,7 @@ GEM
125128
rubocop-ast (1.44.1)
126129
parser (>= 3.3.7.2)
127130
prism (~> 1.4)
128-
rubocop-on-rbs (1.6.0)
131+
rubocop-on-rbs (1.7.0)
129132
lint_roller (~> 1.1)
130133
rbs (~> 3.5)
131134
rubocop (>= 1.72.1, < 2.0)
@@ -184,6 +187,7 @@ DEPENDENCIES
184187
csv
185188
dbm
186189
digest
190+
extconf_compile_commands_json
187191
fileutils
188192
goodcheck
189193
json

Rakefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ bin = File.join(__dir__, "bin")
1111

1212
Rake::ExtensionTask.new("rbs_extension")
1313

14+
compile_task = Rake::Task[:compile]
15+
16+
task :setup_extconf_compile_commands_json do
17+
ENV["COMPILE_COMMANDS_JSON"] = "1"
18+
end
19+
20+
compile_task.prerequisites.unshift(:setup_extconf_compile_commands_json)
21+
1422
test_config = lambda do |t|
1523
t.libs << "test"
1624
t.libs << "lib"

ext/rbs_extension/extconf.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,11 @@
2525
end
2626

2727
create_makefile 'rbs_extension'
28+
29+
# Only generate compile_commands.json when compiling through Rake tasks
30+
# This is to avoid adding extconf_compile_commands_json as a runtime dependency
31+
if ENV["COMPILE_COMMANDS_JSON"]
32+
require 'extconf_compile_commands_json'
33+
ExtconfCompileCommandsJson.generate!
34+
ExtconfCompileCommandsJson.symlink!
35+
end

lib/rbs/namespace.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,3 @@ def ascend
116116
end
117117
end
118118
end
119-
120-
module Kernel
121-
def Namespace(name)
122-
warn "Kernel#Namespace() is deprecated. Use RBS::Namespace.parse instead.", category: :deprecated
123-
RBS::Namespace.parse(name)
124-
end
125-
end

lib/rbs/type_name.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,3 @@ def self.parse(string)
100100
end
101101
end
102102
end
103-
104-
module Kernel
105-
def TypeName(string)
106-
warn "Kernel#TypeName() is deprecated. Use RBS::TypeName.parse instead.", category: :deprecated
107-
RBS::TypeName.parse(string)
108-
end
109-
end

lib/rbs/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module RBS
4-
VERSION = "4.0.0.dev.2"
4+
VERSION = "4.0.0.dev.4"
55
end

sig/namespace.rbs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,3 @@ module RBS
139139
| () -> Enumerator[Namespace, void]
140140
end
141141
end
142-
143-
module Kernel
144-
# Deprecated: Use `RBS::Namespace.parse` instead
145-
%a{deprecated} def Namespace: (String) -> RBS::Namespace
146-
end

0 commit comments

Comments
 (0)