mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-16 07:15:24 +00:00
Add experimental VSCode api
This commit is contained in:
parent
9d473a0b9f
commit
55371be807
9 changed files with 136 additions and 618 deletions
|
@ -2,6 +2,7 @@
|
|||
* This file mirrors `crates/rust-analyzer/src/lsp_ext.rs` declarations.
|
||||
*/
|
||||
|
||||
import { InlayHint } from "vscode";
|
||||
import * as lc from "vscode-languageclient";
|
||||
|
||||
export interface AnalyzerStatusParams {
|
||||
|
@ -99,24 +100,9 @@ export interface TestInfo {
|
|||
|
||||
export const relatedTests = new lc.RequestType<lc.TextDocumentPositionParams, TestInfo[], void>("rust-analyzer/relatedTests");
|
||||
|
||||
export type InlayHint = InlayHint.TypeHint | InlayHint.ParamHint | InlayHint.ChainingHint;
|
||||
|
||||
export namespace InlayHint {
|
||||
export const enum Kind {
|
||||
TypeHint = "TypeHint",
|
||||
ParamHint = "ParameterHint",
|
||||
ChainingHint = "ChainingHint",
|
||||
}
|
||||
interface Common {
|
||||
range: lc.Range;
|
||||
label: string;
|
||||
}
|
||||
export type TypeHint = Common & { kind: Kind.TypeHint };
|
||||
export type ParamHint = Common & { kind: Kind.ParamHint };
|
||||
export type ChainingHint = Common & { kind: Kind.ChainingHint };
|
||||
}
|
||||
export interface InlayHintsParams {
|
||||
textDocument: lc.TextDocumentIdentifier;
|
||||
range: lc.Range,
|
||||
}
|
||||
export const inlayHints = new lc.RequestType<InlayHintsParams, InlayHint[], void>("rust-analyzer/inlayHints");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue