Skip to content

Instantly share code, notes, and snippets.

@prabirshrestha
prabirshrestha / channel.log
Created April 16, 2022 21:02
native client lsp log
https://github.com/vim/vim/pull/10025
--------------
==== start log session ====
0.057482 : raw terminal output: "[?1049h[>4;2m[?1h=[?2004h[?1004h"
0.057531 : raw terminal output: "[?12h[?12l"
0.124131 : raw terminal output: "▽"
0.124184 : raw terminal output: " Pzz\[0%m"
@prabirshrestha
prabirshrestha / gist:93efe102437180132438a715a64dd7e9
Created February 7, 2021 17:33
rust analyzer $/progress notifications
```
Sun 07 Feb 2021 05:23:29 PM UTC:["<---",1,"rust-analyzer",{"response":{"method":"$/progress","jsonrpc":"2.0","params":{"token":"rustAnalyzer/indexing","value":{"percentage":0,"message":"1/909 (alloc)","kind":"report"}}}}]
Sun 07 Feb 2021 05:23:29 PM UTC:["<---",1,"rust-analyzer",{"response":{"method":"$/progress","jsonrpc":"2.0","params":{"token":"rustAnalyzer/indexing","value":{"percentage":0,"message":"3/909 (panic_unwind)","kind":"report"}}}}]
Sun 07 Feb 2021 05:23:29 PM UTC:["<---",1,"rust-analyzer",{"response":{"method":"$/progress","jsonrpc":"2.0","params":{"token":"rustAnalyzer/indexing","value":{"percentage":0,"message":"4/909 (profiler_builtins)","kind":"report"}}}}]
Sun 07 Feb 2021 05:23:29 PM UTC:["<---",1,"rust-analyzer",{"response":{"method":"$/progress","jsonrpc":"2.0","params":{"token":"rustAnalyzer/indexing","value":{"percentage":0,"message":"5/909 (proc_macro)","kind":"report"}}}}]
Sun 07 Feb 2021 05:23:29 PM UTC:["<---",1,"rust-analyzer",{"response":{"method":"$/progress","jsonrpc":"2.0
@prabirshrestha
prabirshrestha / Makefile
Last active March 9, 2020 02:06
generic c makefile
# Final binary
BIN = $(shell basename $$(pwd))
ifeq ($(OS),Windows_NT)
EXE+=.exe
endif
# Default to build with multiple instances for speed
MAKEFLAGS =+ -j
# VERSION = 0.1
@prabirshrestha
prabirshrestha / log.log
Created August 9, 2017 19:14
performance - very slow compared to tsserver
This file has been truncated, but you can view the full file.
DEBUG --> { method: 'initialize',
jsonrpc: '2.0',
id: 1,
params:
{ rootUri: 'file:///D:/tmp/flow-helloworld',
capabilities: {},
rootPath: 'file:///D:/tmp/flow-helloworld' } }
DEBUG <-- { jsonrpc: '2.0',
method: '$/partialResult',
params:
" save all the completions
let s:completions = []
function! asyncomni#omnifunc(findstart, base)
if a:findstart
let l:line_string = getline('.')
let l:line = line('.')
let l:col = col('.')
" locate start of the word
let l:start = l:col -1
<!DOCTYPE html>
<html>
<head>
<title>AAD Login</title>
</head>
<body>
<button id="login-button">Login</button>
<!-- https://apps.dev.microsoft.com/#/appList
https://dev.outlook.com/AppRegistration
https://account.live.com/consent/Manage
@prabirshrestha
prabirshrestha / init.vim for dein.vim
Last active December 24, 2016 05:27
bootstrap vim plugin managers
" to use existing vim configuration as neovim configuration
" ln -s ~/.vimrc ~/.config/nvim/init.vim
let mapleader = ' '
" vimrc {{{
nnoremap <leader>ev :e $MYVIMRC<cr>
nnoremap <leader>sv :source $MYVIMRC<cr>
" }}}
let s:settings = {}
@prabirshrestha
prabirshrestha / client.vim
Last active October 22, 2016 17:03
async vim with channel
function! s:Handler(handle, msg)
echom a:handle
echom a:msg
endfunction
let handle = ch_open('localhost:8000', {'mode': 'json'})
call ch_sendexpr(handle, 'hello', function('s:Handler'))
@prabirshrestha
prabirshrestha / termbox-sample.go
Last active September 14, 2015 04:33
termbox-go with (partial) react style rendering.
package main
import (
"time"
"github.com/nsf/termbox-go"
)
type appState struct {
endEventLoop bool
export function increment() {
return {
type: 'INCREMENT'
};
}
function decrement() {
return {
type: 'DECREMENT'
};