ration / kusto-mode.el

Kusto mode for Emacs
GNU General Public License v2.0
6 stars 2 forks source link

Is this available in any of the package repositories? #1

Open hindol opened 4 years ago

ration commented 4 years ago

Thanks for the PR! I did this just for myself, I didn't even think about packaging it. I haven't touched kusto in a while, are you using it? Does it work ok?

hindol commented 4 years ago

It works great as a syntax highlighter, which is what I need anyways. Thanks for making it. Nowadays the documentation is much much better, so I can send a PR with the complete list of functions and operators.

https://docs.microsoft.com/en-us/azure/data-explorer/

ration commented 4 years ago

If you do I'll definitely merge them. If use Kusto for App Insights, I ran the queries directly from emacs re http://lahtela.me/2019/10/29/running-azure-insights-log-queries-locally.html I fed that ps script as the conpilet command.

hindol commented 4 years ago

Hi, I sent you another PR. This time with a lot of content, :)

Regarding running queries from command line, I took a different approach. I adapted the Python code here: https://github.com/Azure/azure-kusto-python/blob/master/azure-kusto-data/tests/sample.py and made a simple script run-query.py that takes a query from STDIN and writes result to STDOUT. I am looking for ways to integrate this with Emacs.

ration commented 4 years ago

Looking good!

For extra goodness I checked whether there's a kusto lsp server and sure enough there is. So I made a lsp client for it. https://github.com/ration/lsp-kusto That will allow you to have all that code completion goodness as well.

Not that have any use for it currently :smile:

hindol commented 4 years ago

Fantastic!

I was actually looking at how to package Kusto LSP as an NPM package so that installation can be made seamless.

There must also be a way to install straight from Git but my Google-fu failed me. Any idea?

ration commented 4 years ago

The kusto server? I dropped it from git

git clone https://github.com/rosshamish/kuskus
cd kuskus/kusto-language-server
npm install
npm run compile
readlink -f server/out/server.js

Put that path into kuskus-server-location in lsp-kusto.el

hindol commented 4 years ago

No, I meant something else. Sorry I wasn't clear enough.

Emacs's lsp-mode allows auto-downloading of packages. I was wondering if it allows downloading straight from a Git repo. After some searching around, seems this is not allowed.

However, I am more interested in evaluating Kusto queries directly from an Emacs buffer, because that will streamline my workflow. I am trying to hack something like this using comint mode.

ration commented 4 years ago

I think there's no direct support for but I can't see why it wouldn't be possible, albeit a bit more effort. lsp-java for example does all kinds of crazy stuff. It could just point to the compiled js file for the simplest solution.

I have no experience with comint but does look like a good approach!