ruby-lsp 0.23.13 → 0.23.14
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/VERSION +1 -1
- data/lib/ruby_indexer/lib/ruby_indexer/uri.rb +8 -3
- data/lib/ruby_indexer/test/uri_test.rb +15 -2
- data/lib/ruby_lsp/test_helper.rb +0 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49fceec4749d3523e5271e7e363f6f7e34203aa406d7e6c652f7950a3036a917
|
4
|
+
data.tar.gz: 03db90b64dbbd29bd7485eb2bfd9657e845de82d38824d61c6f3f27439968125
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1124cf716bf2a7c04b72c4dcce0bd830218c57b8e28a3e36267aeb9a9e28da4e63c392fff203b3546e4c10c1b63bb62e950f8413d9c569e11986828ddaf73e13
|
7
|
+
data.tar.gz: 92d3fe608ca8b547fe9aba4389b5f14e193dfe11f0ceafa0c1ac5fafca3d63fe875f94d803e5c594179eaf6ccbf99a0dbede08e5efe716744b343201507d404a
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.23.
|
1
|
+
0.23.14
|
@@ -15,14 +15,19 @@ module URI
|
|
15
15
|
class << self
|
16
16
|
#: (path: String, ?fragment: String?, ?scheme: String, ?load_path_entry: String?) -> URI::Generic
|
17
17
|
def from_path(path:, fragment: nil, scheme: "file", load_path_entry: nil)
|
18
|
+
# This unsafe regex is the same one used in the URI::RFC2396_REGEXP class with the exception of the fact that we
|
19
|
+
# do not include colon as a safe character. VS Code URIs always escape colons and we need to ensure we do the
|
20
|
+
# same to avoid inconsistencies in our URIs, which are used to identify resources
|
21
|
+
unsafe_regex = %r{[^\-_.!~*'()a-zA-Z\d;/?@&=+$,\[\]]}
|
22
|
+
|
18
23
|
# On Windows, if the path begins with the disk name, we need to add a leading slash to make it a valid URI
|
19
24
|
escaped_path = if /^[A-Z]:/i.match?(path)
|
20
|
-
PARSER.escape("/#{path}")
|
25
|
+
PARSER.escape("/#{path}", unsafe_regex)
|
21
26
|
elsif path.start_with?("//?/")
|
22
27
|
# Some paths on Windows start with "//?/". This is a special prefix that allows for long file paths
|
23
|
-
PARSER.escape(path.delete_prefix("//?"))
|
28
|
+
PARSER.escape(path.delete_prefix("//?"), unsafe_regex)
|
24
29
|
else
|
25
|
-
PARSER.escape(path)
|
30
|
+
PARSER.escape(path, unsafe_regex)
|
26
31
|
end
|
27
32
|
|
28
33
|
uri = build(scheme: scheme, path: escaped_path, fragment: fragment)
|
@@ -12,12 +12,12 @@ module RubyIndexer
|
|
12
12
|
|
13
13
|
def test_from_path_on_windows
|
14
14
|
uri = URI::Generic.from_path(path: "C:/some/windows/path/to/file.rb")
|
15
|
-
assert_equal("/C
|
15
|
+
assert_equal("/C%3A/some/windows/path/to/file.rb", uri.path)
|
16
16
|
end
|
17
17
|
|
18
18
|
def test_from_path_on_windows_with_lowercase_drive
|
19
19
|
uri = URI::Generic.from_path(path: "c:/some/windows/path/to/file.rb")
|
20
|
-
assert_equal("/c
|
20
|
+
assert_equal("/c%3A/some/windows/path/to/file.rb", uri.path)
|
21
21
|
end
|
22
22
|
|
23
23
|
def test_to_standardized_path_on_unix
|
@@ -68,5 +68,18 @@ module RubyIndexer
|
|
68
68
|
uri.add_require_path_from_load_entry("/some/unix/path")
|
69
69
|
assert_equal("to/file", uri.require_path)
|
70
70
|
end
|
71
|
+
|
72
|
+
def test_from_path_escapes_colon_characters
|
73
|
+
uri = URI::Generic.from_path(path: "c:/some/windows/path with/spaces/file.rb")
|
74
|
+
assert_equal("c:/some/windows/path with/spaces/file.rb", uri.to_standardized_path)
|
75
|
+
assert_equal("file:///c%3A/some/windows/path%20with/spaces/file.rb", uri.to_s)
|
76
|
+
end
|
77
|
+
|
78
|
+
def test_from_path_with_unicode_characters
|
79
|
+
path = "/path/with/unicode/文件.rb"
|
80
|
+
uri = URI::Generic.from_path(path: path)
|
81
|
+
assert_equal(path, uri.to_standardized_path)
|
82
|
+
assert_equal("file:///path/with/unicode/%E6%96%87%E4%BB%B6.rb", uri.to_s)
|
83
|
+
end
|
71
84
|
end
|
72
85
|
end
|
data/lib/ruby_lsp/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-lsp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.23.
|
4
|
+
version: 0.23.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-04-09 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: language_server-protocol
|