-
Notifications
You must be signed in to change notification settings - Fork 33
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
Lint Server #70
Comments
wow, that'd be really sweet. I'm not quite sure what it entails. I'd lean towards a separate package if it requires dependency on a few non-core packages. Your judgement call. Do let us know if you need any adjustment in to code to make that work. |
I was writing a Linting plugin for Sublime and I am quite disappointed how slow it is so I was toying with the persistent process and I got it somehow working on OS X, have no idea how much this code might be relevant for other systems. Just sharing a proof of concept and that it works: using Lint
import Base.string
function string( m::LintMessage )
s = @sprintf( "%s:%d ", m.file, m.line )
s = s * @sprintf( "[%-15s] ", m.scope )
arr = [ "INFO", "WARN", "ERROR", "FATAL" ]
s = s * @sprintf( "%-5s ", arr[ m.level+1 ] )
ident = min( 60, length(s) )
lines = split(m.message, "\n")
for (i,l) in enumerate(lines)
if i==1
s = s * l
else
s = s * "\n" * (" " ^ ident) * l
end
end
return s
end
server = listen(2222)
while true
conn = accept(server)
@async begin
try
while true
line = readline(conn)
# println(typeof(line))
# println(ispath(strip(line)))
# println(strip(line))
m = lintfile(strip(line), returnMsgs = true)
for i in m
write(conn, string(i))
write(conn, "\n")
end
end
catch err
print("connection ended with error $err")
end
end
end then from bash you can call The script is by no means fool proof. |
OK, I was really frustrated so made it work, again a bit of a hack, but works for SublimeLinter. Let me know if you want to pull this. |
I'm happy to give it a try. |
It is now possible to use Emacs with a persistent lint process, so we need a way of running Lint.jl as a persistent process that we can query.
Does this belong in Lint.jl? If not, I'm happy to write a separate little package.
The text was updated successfully, but these errors were encountered: