JuliaEditorSupport / julia-intellij

:computer: Julia Plugin for IntelliJ IDEA ┗:smiley:┛ ┏:smiley:┓ ┗:smiley:┛
GNU General Public License v3.0
294 stars 29 forks source link

Julia Type Hint #160

Open zxj5470 opened 6 years ago

zxj5470 commented 6 years ago

Just like Kotlin type Hint or JavaX-Var-Hint

ice1000 commented 6 years ago

This feature requires type inference

zxj5470 commented 6 years ago

just needs a API to get return type from PSI

ice1000 commented 6 years ago

The return type must be inferred

zxj5470 commented 5 years ago

image

ice1000 commented 5 years ago

What's the rule of parsing version number?

julia> v""
ERROR: LoadError: ArgumentError: invalid version string:
Stacktrace:
 [1] VersionNumber(::String) at ./version.jl:111
 [2] @v_str(::LineNumberNode, ::Module, ::Any) at ./version.jl:138
in expression starting at REPL[1]:1

Can we report errors on this?

ice1000 commented 5 years ago

66666666666666666

zxj5470 commented 5 years ago

add an option for versionString in Annotator to check it...

zxj5470 commented 5 years ago

Do we need to transform these into Kotlin?

    function VersionNumber(major::VInt, minor::VInt, patch::VInt,
            pre::Tuple{Vararg{Union{UInt64,String}}},
            bld::Tuple{Vararg{Union{UInt64,String}}})
        major >= 0 || throw(ArgumentError("invalid negative major version: $major"))
        minor >= 0 || throw(ArgumentError("invalid negative minor version: $minor"))
        patch >= 0 || throw(ArgumentError("invalid negative patch version: $patch"))
        for ident in pre
            if ident isa Integer
                ident >= 0 || throw(ArgumentError("invalid negative pre-release identifier: $ident"))
            else
                if !occursin(r"^(?:|[0-9a-z-]*[a-z-][0-9a-z-]*)$"i, ident) ||
                    isempty(ident) && !(length(pre)==1 && isempty(bld))
                    throw(ArgumentError("invalid pre-release identifier: $(repr(ident))"))
                end
            end
        end
        for ident in bld
            if ident isa Integer
                ident >= 0 || throw(ArgumentError("invalid negative build identifier: $ident"))
            else
                if !occursin(r"^(?:|[0-9a-z-]*[a-z-][0-9a-z-]*)$"i, ident) ||
                    isempty(ident) && length(bld)!=1
                    throw(ArgumentError("invalid build identifier: $(repr(ident))"))
                end
            end
        end
        new(major, minor, patch, pre, bld)
    end