typeprof 0.21.0 → 0.21.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 18bdb9e24afde0cb827e78bc77825f9d316fa4959f0276b961f8fd897787810a
4
- data.tar.gz: '095fdf956b09a88940adfe99f68bc6d6afe6d01f2e521b0ca8801691b3df7ab3'
3
+ metadata.gz: 87b881146ffc3f78049ac01775f0bd6cae8efeec13a77da7eab2a61e3027a802
4
+ data.tar.gz: 61507f6552b6440fa58ea298ed80956a32e97b149b46d0969a594e8d1b0920bc
5
5
  SHA512:
6
- metadata.gz: df332ec8c3b08f13d6bf35dd3ae60604ddb31ea4e27d959b0c027b0fb616ab74df582b292ff27169daf6a962f34b21550a21214826ac8a2815829a57b94dd5ed
7
- data.tar.gz: cf47173a218dca213e96cc3ebeb84b86c1376cca6f5f06703fb95c1d3de6c0d289d719324ac9d887eefbb36662458bd636250239389fe16bd0f34a66f402abb7
6
+ metadata.gz: dce6a8c024aa553089224545ca89a6148a590390791f9411b6a70791ad23cb70a9e97d4405264882c3cfccc8cd30e69443cc6330cb81c33f996fa2363dc0369a
7
+ data.tar.gz: c6f6e02dc30a6c8b7ecbee01f05f171b467a95526b4541173b303803287ea208eb816223353a704866b7f0b87b266462560554bb997bdbe67d3b5c9373385a4f
@@ -7,10 +7,10 @@ jobs:
7
7
  strategy:
8
8
  fail-fast: false
9
9
  matrix:
10
- ruby-version: [2.7, 3.0,head]
10
+ ruby-version: [2.7, 3.0, 3.1, head]
11
11
  runs-on: ubuntu-latest
12
12
  steps:
13
- - uses: actions/checkout@v2
13
+ - uses: actions/checkout@v3
14
14
  with:
15
15
  submodules: true
16
16
  - name: Set up Ruby
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- typeprof (0.21.0)
4
+ typeprof (0.21.3)
5
5
  rbs (>= 1.8.1)
6
6
 
7
7
  GEM
@@ -10,15 +10,15 @@ GEM
10
10
  coverage-helpers (1.0.0)
11
11
  docile (1.4.0)
12
12
  power_assert (2.0.1)
13
- rake (13.0.1)
14
- rbs (1.8.1)
13
+ rake (13.0.6)
14
+ rbs (2.6.0)
15
15
  simplecov (0.21.2)
16
16
  docile (~> 1.1)
17
17
  simplecov-html (~> 0.11)
18
18
  simplecov_json_formatter (~> 0.1)
19
19
  simplecov-html (0.12.3)
20
- simplecov_json_formatter (0.1.3)
21
- stackprof (0.2.17)
20
+ simplecov_json_formatter (0.1.4)
21
+ stackprof (0.2.19)
22
22
  test-unit (3.5.3)
23
23
  power_assert
24
24
 
@@ -36,4 +36,4 @@ DEPENDENCIES
36
36
  typeprof!
37
37
 
38
38
  BUNDLED WITH
39
- 2.3.0.dev
39
+ 2.2.15
@@ -92,7 +92,7 @@ module TypeProf
92
92
  aargs = scratch.globalize_type(aargs, caller_env, caller_ep)
93
93
  subst = aargs.consistent_with_method_signature?(@msig)
94
94
  unless subst
95
- scratch.warn(caller_ep, "The arguments is not compatibile to RBS block")
95
+ scratch.warn(caller_ep, "The arguments is not compatible to RBS block")
96
96
  end
97
97
  # check?
98
98
  #subst = { Type::Var.new(:self) => caller_env.static_env.recv_ty }
@@ -158,7 +158,10 @@ module TypeProf
158
158
  decls.each do |decl|
159
159
  decl = decl.decl
160
160
 
161
- type_params2 = decl.type_params.params.map {|param| [param.name, param.variance] }
161
+ type_params2 = decl.type_params
162
+ # A hack to deal with the imcompatibility between rbs 1.8 and 2.0
163
+ type_params2 = type_params2.params if type_params2.respond_to?(:params)
164
+ type_params2 = type_params2.map {|param| [param.name, param.variance] }
162
165
  raise "inconsistent type parameter declaration" if type_params && type_params != type_params2
163
166
  type_params = type_params2
164
167
 
data/lib/typeprof/lsp.rb CHANGED
@@ -5,6 +5,8 @@ require "uri"
5
5
  module TypeProf
6
6
  def self.start_lsp_server(config)
7
7
  if config.lsp_options[:stdio]
8
+ $stdin.binmode
9
+ $stdout.binmode
8
10
  reader = LSP::Reader.new($stdin)
9
11
  writer = LSP::Writer.new($stdout)
10
12
  # pipe all builtin print output to stderr to avoid conflicting with lsp
@@ -498,9 +500,11 @@ module TypeProf
498
500
  when "typeprof.enableSignature"
499
501
  @server.signature_enabled = true
500
502
  @server.send_request("workspace/codeLens/refresh")
503
+ respond(nil)
501
504
  when "typeprof.disableSignature"
502
505
  @server.signature_enabled = false
503
506
  @server.send_request("workspace/codeLens/refresh")
507
+ respond(nil)
504
508
  when "typeprof.createPrototypeRBS"
505
509
  class_kind, class_name, sig_str = @params[:arguments]
506
510
  code_range =
data/lib/typeprof/type.rb CHANGED
@@ -855,7 +855,7 @@ module TypeProf
855
855
  sig_help = {}
856
856
  add_farg = -> farg, name, help: false, key: sig_help.size do
857
857
  name = "`#{ name }`" if RBS::Parser::KEYWORDS.key?(name.to_s)
858
- name = "noname_#{ name }" if name.is_a?(Integer)
858
+ name = "noname" if name.is_a?(Integer) || name == :"*"
859
859
  fargs_str << ", " if fargs_str != "("
860
860
  i = fargs_str.size
861
861
  fargs_str << (Config.current.options[:show_parameter_names] && name ? "#{ farg } #{ name }" : farg)
@@ -1,3 +1,3 @@
1
1
  module TypeProf
2
- VERSION = "0.21.0"
2
+ VERSION = "0.21.3"
3
3
  end
data/typeprof.gemspec CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
24
24
  # Specify which files should be added to the gem when it is released.
25
25
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
26
26
  spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
27
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(doc|test|spec|features|smoke|testbed)/}) }
27
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(doc|test|spec|features|smoke|testbed|vscode)/}) }
28
28
  end
29
29
  spec.bindir = "exe"
30
30
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: typeprof
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.0
4
+ version: 0.21.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yusuke Endoh
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-20 00:00:00.000000000 Z
11
+ date: 2022-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rbs
@@ -67,16 +67,6 @@ files:
67
67
  - tools/setup-insns-def.rb
68
68
  - typeprof-lsp
69
69
  - typeprof.gemspec
70
- - vscode/.gitignore
71
- - vscode/.vscode/launch.json
72
- - vscode/.vscodeignore
73
- - vscode/README.md
74
- - vscode/development.md
75
- - vscode/package-lock.json
76
- - vscode/package.json
77
- - vscode/sandbox/test.rb
78
- - vscode/src/extension.ts
79
- - vscode/tsconfig.json
80
70
  homepage: https://github.com/ruby/typeprof
81
71
  licenses:
82
72
  - MIT
@@ -98,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
88
  - !ruby/object:Gem::Version
99
89
  version: '0'
100
90
  requirements: []
101
- rubygems_version: 3.3.0.dev
91
+ rubygems_version: 3.3.7
102
92
  signing_key:
103
93
  specification_version: 4
104
94
  summary: TypeProf is a type analysis tool for Ruby code based on abstract interpretation
data/vscode/.gitignore DELETED
@@ -1,5 +0,0 @@
1
- /out
2
- node_modules
3
- .vscode/*
4
- !.vscode/launch.json
5
- *.vsix
@@ -1,16 +0,0 @@
1
- {
2
- "version": "0.1.0",
3
- "configurations": [
4
- {
5
- "name": "Launch Extension",
6
- "type": "extensionHost",
7
- "request": "launch",
8
- "runtimeExecutable": "${execPath}",
9
- "args": ["--extensionDevelopmentPath=${workspaceRoot}" ],
10
- "stopOnEntry": false,
11
- "sourceMaps": true,
12
- "outFiles": [ "${workspaceRoot}/out/src/**/*.js" ],
13
- "preLaunchTask": "npm: vscode:prepublish"
14
- }
15
- ]
16
- }
data/vscode/.vscodeignore DELETED
@@ -1,7 +0,0 @@
1
- /sandbox
2
- .vscode/**
3
- /src
4
- **/*.ts
5
- **/*.js.map
6
- **/tsconfig.json
7
- development.md
data/vscode/README.md DELETED
@@ -1,22 +0,0 @@
1
- # Ruby TypeProf VSCode Integration
2
-
3
- *NOTE: This extenstion is very preliminary.*
4
-
5
- This is a VSCode extension to help you write Ruby code by using an code analyzer called [Ruby TypeProf](https://github.com/ruby/typeprof/) as a backend.
6
-
7
- ## How to use this extension
8
-
9
- *TBD*
10
-
11
- Requirements:
12
-
13
- 1. Use Ruby 3.1.0 or later, and TypeProf 0.20.0 or later
14
- 2. Add `gem "typeprof"` to your `Gemfile`, and execute `bundle install`
15
-
16
- Troubleshooting:
17
-
18
- *TBD*
19
-
20
- ## How to develop this extension
21
-
22
- See [development.md](https://github.com/ruby/typeprof/blob/master/development.md).
@@ -1,31 +0,0 @@
1
- # LSP client for vscode
2
-
3
- Note: this is under development
4
-
5
- ## How to run
6
-
7
- ```
8
- $ cd vscode
9
- $ npm install
10
- $ npx run tsc -p ./
11
- $ cd ..
12
- $ code --extensionDevelopmentPath=vscode/ .
13
- ```
14
-
15
- Alternatively, you can do it in vscode itself.
16
-
17
- ```
18
- $ cd vscode
19
- $ code
20
- ```
21
-
22
- And then press F5 to run another vscode with extension.
23
-
24
- ## How to release
25
-
26
- ```
27
- $ npm run package
28
- $ npx vsce publish
29
- ```
30
-
31
- See also: https://code.visualstudio.com/api/working-with-extensions/publishing-extension