Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to nightly changes #20

Merged
merged 1 commit into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "FuzzyCompletions"
uuid = "fb4132e2-a121-4a70-b8a1-d5b831dcdcc2"
authors = ["Shuhei Kadowaki <[email protected]>"]
version = "0.5.4"
version = "0.5.5"

[deps]
REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
Expand Down
16 changes: 12 additions & 4 deletions src/FuzzyCompletions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,6 @@ import REPL.REPLCompletions:
subscript_regex,
superscripts,
superscript_regex,
afterusing,
dict_identifier_key

@static if VERSION ≥ v"1.10.0-DEV.941"
Expand Down Expand Up @@ -460,7 +459,10 @@ function complete_keyword_argument(partial, last_idx, context_module)
end

suggestions = Completion[KeywordArgumentCompletion(kwarg, partial) for kwarg in kwargs]
repl_completions = @static if VERSION ≥ v"1.10.0-DEV.981"
repl_completions = @static if VERSION ≥ v"1.12.0-DEV.639"
REPL.REPLCompletions.complete_symbol!(REPL.REPLCompletions.Completion[],
nothing, last_word, context_module)
elseif VERSION ≥ v"1.10.0-DEV.981"
REPL.REPLCompletions.complete_symbol(nothing, last_word, Returns(true), context_module)
else
REPL.REPLCompletions.complete_symbol(last_word, (mod,x)->true, context_module)
Expand Down Expand Up @@ -601,7 +603,13 @@ end

end # @static if isdefined(Base, :TOML)

function completions(string::String, pos::Int, context_module::Module = Main, shift::Bool=true;
after_using_or_import(string, startpos) = @static if VERSION ≥ v"1.12.0-DEV.699"
REPL.REPLCompletions.get_import_mode(string) ∈ (:using_module, :import_module)
else
REPL.REPLCompletions.afterusing(string, startpos)
end

function completions(string::String, pos::Int, context_module::Module = Main, shift::Bool=true;
enable_questionmark_methods::Bool = true,
enable_dict_keys::Bool = true,
enable_expanduser::Bool = true,
Expand Down Expand Up @@ -741,7 +749,7 @@ function completions(string::String, pos::Int, context_module::Module = Main, sh
ffunc = (mod,x)->true
suggestions = Completion[]
comp_keywords = true
if enable_packages && afterusing(string, startpos)
if enable_packages && after_using_or_import(string, startpos)
# We're right after using or import. Let's look only for packages
# and modules we can reach from here

Expand Down
Loading