Skip to content

Commit

Permalink
add missing regex unicode modifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszsamson committed Oct 8, 2023
1 parent 6ad4e43 commit 5efc5d8
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,7 @@ defmodule ElixirLS.LanguageServer.Providers.Completion do
# Don't add the closing parenthesis to the snippet if the cursor is
# immediately before a valid argument. This usually happens when we
# want to wrap an existing variable or literal, e.g. using IO.inspect/2.
!snippets_supported? || Regex.match?(~r/^[\p{L}0-9_:"'%<@\[\{]/, text_after_cursor) ->
!snippets_supported? || Regex.match?(~r/^[\p{L}0-9_:"'%<@\[\{]/u, text_after_cursor) ->
"#{name}("

true ->
Expand Down Expand Up @@ -1235,7 +1235,7 @@ defmodule ElixirLS.LanguageServer.Providers.Completion do
defp use_name_only?(module_name, function_name) do
module_name in @use_name_only or {module_name, function_name} in @use_name_only or
String.starts_with?(function_name, "__") or
function_name =~ ~r/^[^\p{L}]+$/
function_name =~ ~r/^[^\p{L}]+$/u
end

defp sort_items(items) do
Expand All @@ -1255,7 +1255,7 @@ defmodule ElixirLS.LanguageServer.Providers.Completion do
# _underscored_function
# __MODULE__
# operators
{priority, label =~ ~r/^[^\p{L}]/, label}
{priority, label =~ ~r/^[^\p{L}]/u, label}
end)
end

Expand Down

0 comments on commit 5efc5d8

Please sign in to comment.