Add label_for_symbol
to extension API (#10179)
This PR adds `label_for_symbol` to the extension API. As a motivating example, we implemented `label_for_symbol` for the Haskell extension. Release Notes: - N/A Co-authored-by: Max <max@zed.dev>
This commit is contained in:
parent
5d88d9c0d7
commit
4a325614f0
10 changed files with 238 additions and 43 deletions
|
@ -3,7 +3,7 @@ package zed:extension;
|
|||
world extension {
|
||||
import lsp;
|
||||
|
||||
use lsp.{completion};
|
||||
use lsp.{completion, symbol};
|
||||
|
||||
export init-extension: func();
|
||||
|
||||
|
@ -117,4 +117,5 @@ world extension {
|
|||
}
|
||||
|
||||
export labels-for-completions: func(language-server-id: string, completions: list<completion>) -> result<list<option<code-label>>, string>;
|
||||
export labels-for-symbols: func(language-server-id: string, symbols: list<symbol>) -> result<list<option<code-label>>, string>;
|
||||
}
|
||||
|
|
|
@ -41,4 +41,39 @@ interface lsp {
|
|||
snippet,
|
||||
other(s32),
|
||||
}
|
||||
|
||||
record symbol {
|
||||
kind: symbol-kind,
|
||||
name: string,
|
||||
}
|
||||
|
||||
variant symbol-kind {
|
||||
file,
|
||||
module,
|
||||
namespace,
|
||||
%package,
|
||||
class,
|
||||
method,
|
||||
property,
|
||||
field,
|
||||
%constructor,
|
||||
%enum,
|
||||
%interface,
|
||||
function,
|
||||
variable,
|
||||
constant,
|
||||
%string,
|
||||
number,
|
||||
boolean,
|
||||
array,
|
||||
object,
|
||||
key,
|
||||
null,
|
||||
enum-member,
|
||||
struct,
|
||||
event,
|
||||
operator,
|
||||
type-parameter,
|
||||
other(s32),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue