navigator.lua/lua/navigator/protocal.json

454 lines
9.1 KiB
JSON
Raw Normal View History

2021-04-19 02:56:32 +00:00
--[[ -- incomming/outgoing
dir from result { {
from = {
detail = "command-line-arguments • interface.go",
kind = 12,
name = "m2",
range = {
end = {
character = 7,
line = 39
},
start = {
character = 5,
line = 39
}
},
selectionRange = {
end = {
character = 7,
line = 39
},
start = {
character = 5,
line = 39
}
},
uri = "file:///Users/ray.xu/lsp-test/go/interface.go"
},
fromRanges = { {
end = {
character = 8,
line = 40
},
start = {
character = 1,
line = 40
}
} }
}, {
from = {
detail = "command-line-arguments • interface.go",
kind = 12,
name = "main",
range = {
end = {
character = 9,
line = 43
},
start = {
character = 5,
line = 43
}
},
selectionRange = {
end = {
character = 9,
line = 43
},
start = {
character = 5,
line = 43
}
},
uri = "file:///Users/ray.xu/lsp-test/go/interface.go"
},
fromRanges = { {
end = {
character = 11,
line = 47
},
start = {
character = 4,
line = 47
}
}, {
end = {
character = 11,
line = 48
},
start = {
character = 4,
line = 48
}
} }
} }
--]]
-- [[ locations/reference from lsp
{ {
range = {
["end"] = {
character = 20,
line = 26
},
start = {
character = 16,
line = 26
}
},
uri = "file:///Users/ray.xu/lsp-test/go/interface.go"
}, {
range = {
["end"] = {
character = 22,
line = 35
},
start = {
character = 18,
line = 35
}
},
uri = "file:///Users/ray.xu/lsp-test/go/interface.go"
} }
--]]
-- definition
definition.lua:9: { {
range = {
end = {
character = 12,
line = 33
},
start = {
character = 5,
line = 33
}
},
uri = "file:///Users/ray.xu/lsp-test/go/interface.go"
} }
-- def preview
def-preview {
[3] = {
result = { {
range = {
end = {
character = 12,
line = 33
},
start = {
character = 5,
line = 33
}
},
uri = "file:///Users/ray.xu/lsp-test/go/interface.go"
} }
}
}
-- symbol
{ {
containerName = "command-line-arguments",
kind = 11,
location = {
range = {
end = {
character = 13,
line = 7
},
start = {
character = 5,
line = 7
}
},
uri = "file:///Users/ray.xu/lsp-test/go/interface.go"
},
name = "command-line-arguments.geometry"
}, {
containerName = "command-line-arguments",
kind = 23,
location = {
range = {
end = {
character = 9,
line = 12
},
start = {
character = 5,
line = 12
}
},
uri = "file:///Users/ray.xu/lsp-test/go/interface.go"
},
name = "command-line-arguments.rect"
}, {
containerName = "command-line-arguments",
kind = 12,
location = {
range = {
end = {
character = 9,
line = 43
},
start = {
character = 5,
line = 43
}
},
uri = "file:///Users/ray.xu/lsp-test/go/interface.go"
},
name = "command-line-arguments.main"
}, {
containerName = "command-line-arguments",
kind = 6,
location = {
range = {
end = {
character = 8,
line = 8
},
start = {
character = 4,
line = 8
}
},
uri = "file:///Users/ray.xu/lsp-test/go/interface.go"
},
name = "command-line-arguments.geometry.area"
}, {
containerName = "command-line-arguments",
kind = 8,
location = {
range = {
end = {
character = 9,
line = 13
},
start = {
character = 4,
line = 13
}
},
uri = "file:///Users/ray.xu/lsp-test/go/interface.go"
},
name = "command-line-arguments.rect.width"
}}
{
diagnostics = { {
code = "UnusedVar",
codeDescription = {
href = "https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#UnusedVar"
},
message = "d declared but not used",
range = {
end = {
character = 5,
line = 46
},
start = {
character = 4,
line = 46
}
},
severity = 1,
source = "compiler"
}, {
code = "WrongArgCount",
codeDescription = {
href = "https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#WrongArgCount"
},
message = "missing argument in conversion to circle",
range = {
end = {
character = 17,
line = 46
},
start = {
character = 9,
line = 46
}
},
severity = 1,
source = "compiler"
} },
uri = "file:///Users/ray.xu/lsp-test/go/interface.go"
}
-- range actions
{ {
edit = {
documentChanges = { {
edits = { {
newText = '\nimport (\n\t"fmt"\n\t"log"\n)\n',
range = {
end = {
character = 0,
line = 1
},
start = {
character = 0,
line = 1
}
}
} },
textDocument = {
uri = "file:///Users/ray.xu/lsp_test/go/ref.go",
version = 0
}
} }
},
kind = "source.organizeImports",
title = "Organize Imports"
}, {
command = {
arguments = { {
Fix = "undeclared_name",
Range = {
end = {
character = 20,
line = 4
},
start = {
character = 16,
line = 4
}
},
URI = "file:///Users/ray.xu/lsp_test/go/ref.go"
} },
command = "gopls.apply_fix",
title = "undeclared name: rect"
},
diagnostics = { {
code = "UndeclaredName",
codeDescription = {
href = "https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#UndeclaredName"
},
message = "undeclared name: rect",
range = {
end = {
character = 20,
line = 4
},
start = {
character = 16,
line = 4
}
},
severity = 1,
source = "compiler",
tags = { 1 }
} },
edit = {},
kind = "quickfix",
title = "undeclared name: rect"
}, {
command = {
arguments = { {
Fix = "extract_function",
Range = {
end = {
character = 16,
line = 6
},
start = {
character = 0,
line = 4
}
},
URI = "file:///Users/ray.xu/lsp_test/go/ref.go"
} },
command = "gopls.apply_fix",
title = "Extract to function"
},
edit = {},
kind = "refactor.extract",
title = "Extract to function"
} }
-- code action
{ {
diagnostics = { {
code = "UndeclaredName",
codeDescription = {
href = "https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#UndeclaredName"
},
message = "undeclared name: log",
range = {
end = {
character = 4,
line = 6
},
start = {
character = 1,
line = 6
}
},
severity = 1,
source = "compiler"
} },
edit = {
documentChanges = { {
edits = { {
newText = '\nimport "log"\n',
range = {
end = {
character = 0,
line = 1
},
start = {
character = 0,
line = 1
}
}
} },
textDocument = {
uri = "file:///Users/ray.xu/lsp_test/go/ref.go",
version = 0
}
} }
},
kind = "quickfix",
title = 'Add import: "log"'
}, {
edit = {
documentChanges = { {
edits = { {
newText = '\nimport (\n\t"fmt"\n\t"log"\n)\n',
range = {
end = {
character = 0,
line = 1
},
start = {
character = 0,
line = 1
}
}
} },
textDocument = {
uri = "file:///Users/ray.xu/lsp_test/go/ref.go",
version = 0
}
} }
},
kind = "source.organizeImports",
title = "Organize Imports"
} }