This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using LanguageServer, CSTParser, StaticLint, SymbolServer | |
server = LanguageServerInstance(IOBuffer(), IOBuffer(), "", "nothing") | |
@async run(server) | |
initstr = """ | |
{"jsonrpc":"2.0","id":0,"method":"initialize","params":{ | |
"processId": 0, | |
"clientInfo": { | |
"name": "vscode", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using LanguageServer, CSTParser, StaticLint, SymbolServer | |
server = LanguageServerInstance(IOBuffer(), IOBuffer(), "/home/zac/.julia/environments/v1.5/", "") | |
@async run(server) | |
for n in names(LanguageServer, all = true) eval(:(import LanguageServer.$n)) end | |
for n in names(StaticLint, all = true) eval(:(import StaticLint.$n)) end | |
# paths to change on lines: 17, 18, 310 | |
workingdir = "/home/zac/.julia/dev/StaticLint" | |
initstr = """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
str = """ | |
using Base.Test | |
@testset "ts1" begin | |
x=1 | |
x==1 | |
end | |
@testset "ts2" begin | |
x=2 | |
x==1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Used to generate dotop1 and isopsuffix | |
function _genchartest(x::Vector{UInt32}, fname) | |
n = length(x) | |
out = [] | |
i = 1 | |
while i <= n | |
out1 = [x[i]] | |
while i+1 <= n && x[i+1] == x[i] + 1 | |
push!(out1, x[i + 1]) | |
i += 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using JuMP, GLPK, GLPKMathProgInterface | |
########## Inputs | |
N = 4 # number of departments | |
n = 300 # number of candidates | |
# defines preferences over each department (columns) for each candidate (rows) | |
# each cell indicates utility of getting job (from 0 to 1). | |
# TODO: use nonlinear (exp) preferences | |
# importance of matching each candidates preferences can be altered by multiplying a row by a constant (0..1), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using LanguageServer | |
using CSTParser | |
for n in names(LanguageServer, true, true) | |
eval(:(import LanguageServer.$n)) | |
end | |
import LanguageServer.JSONRPC:Request, parse | |
import LanguageServer: process, lint | |
Range = LanguageServer.Range | |
root = "nope" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using LanguageServer | |
using CSTParser | |
for n in names(LanguageServer, true, true) | |
eval(:(import LanguageServer.$n)) | |
end | |
import LanguageServer.JSONRPC:Request, parse | |
import LanguageServer: process, lint | |
Range = LanguageServer.Range | |
root = Pkg.dir("QueryOperators") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pkgdeps(pkg::String, metadir = "/home/zac/.julia/v0.6/METADATA") | |
deps = [] | |
for pdir in readdir(metadir) | |
if isdir(joinpath(metadir,pdir)) && "versions" in readdir(joinpath(metadir,pdir)) | |
for ver in readdir(joinpath(metadir, pdir, "versions")) | |
if isfile(joinpath(metadir, pdir, "versions",ver,"requires")) | |
reqs = readlines(joinpath(metadir, pdir, "versions",ver,"requires")) | |
for r in reqs | |
if first(split(r, " ")) == pkg | |
push!(deps, (pdir, ver)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module FixParameterisedFunctionDeprecation | |
using CSTParser | |
import CSTParser: EXPR, Call, Curly, Tokens, OPERATOR, BinarySyntaxOpCall, UnarySyntaxOpCall, DeclarationOp, PUNCTUATION | |
function fixdep(file, overwrite = false) | |
str = readstring(file) | |
x = CSTParser.parse(str, true) | |
diags = [] | |
lint(x, diags, 0) | |
line_breaks = find(x->x=='\n', str) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using LanguageServer, Base.Test | |
for n in names(LanguageServer, true, true) | |
eval(:(import LanguageServer.$n)) | |
end | |
import LanguageServer.JSONRPC:Request, parse | |
Range = LanguageServer.Range | |
root = Pkg.dir("DataValueArrays") |
NewerOlder