Skip to content
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
66 changes: 66 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: CI
on:
push:
branches:
- master
pull_request:
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.allow-failure }}
strategy:
fail-fast: false # don't stop CI even when one of them fails
matrix:
version:
- '1.5' # current stable
- '1.0' # lts
os:
- ubuntu-latest
- macOS-latest
- windows-latest
arch:
- x64
- x86
allow-failure: [false]
include:
# this is so verbose... any other way to simplify this ?
- version: 'nightly'
os: ubuntu-latest
arch: x64
allow-failure: true
- version: 'nightly'
os: ubuntu-latest
arch: x86
allow-failure: true
- version: 'nightly'
os: macOS-latest
arch: x64
allow-failure: true
- version: 'nightly'
os: windows-latest
arch: x64
allow-failure: true
- version: 'nightly'
os: windows-latest
arch: x86
allow-failure: true
exclude:
- os: macOS-latest
arch: x86
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-runtest@latest
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
with:
file: ./lcov.info
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
19 changes: 0 additions & 19 deletions .travis.yml

This file was deleted.

11 changes: 7 additions & 4 deletions src/FuzzyCompletions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ function bslash_completions(string, pos)
return (false, (Completion[], 0:-1, false))
end

function dict_identifier_key(str, tag, context_module)
function dict_identifier_key(str, tag, context_module = Main)
if tag === :string
str_close = str*"\""
elseif tag === :cmd
Expand Down Expand Up @@ -670,7 +670,7 @@ function completions(string, pos, context_module = Main)
# if completing a key in a Dict
identifier, partial_key, loc = dict_identifier_key(partial,inc_tag, context_module)
if identifier !== nothing
matches = find_dict_matches(identifier)
matches = find_dict_matches(identifier)::Vector{String}
length(matches)==1 && (lastindex(string) <= pos || string[nextind(string,pos)] != ']') && (matches[1]*=']')
if length(matches)>0
suggestions = Completion[DictCompletion(identifier, match, partial_key) for match in matches]
Expand Down Expand Up @@ -714,9 +714,12 @@ function completions(string, pos, context_module = Main)
ex = Meta.parse(s * ")", raise=false, depwarn=false)

if isa(ex, Expr)
if ex.head==:call
if ex.head === :call
return complete_methods(ex, context_module), first(frange):method_name_end, false
elseif ex.head==:. && ex.args[2] isa Expr && ex.args[2].head==:tuple
elseif ex.head === :. && begin
x = ex.args[2]
isa(x, Expr) && x.head === :tuple
end
return complete_methods(ex, context_module), first(frange):(method_name_end - 1), false
end
end
Expand Down
4 changes: 4 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,7 @@ end
@test comp("Nothing") == "Nothing"
@test comp("Mis") == "Missing"
end

@testset "inferrability" begin
@inferred FuzzyCompletions.completions("foo", lastindex("foo"), @__MODULE__)
end