Files
clice/include/Basic/Lifecycle.h
2025-01-13 23:14:10 +08:00

92 lines
3.1 KiB
C++

#pragma once
#include "Workspace.h"
#include "Feature/Lookup.h"
#include "Feature/DocumentHighlight.h"
#include "Feature/DocumentLink.h"
#include "Feature/Hover.h"
#include "Feature/CodeLens.h"
#include "Feature/FoldingRange.h"
#include "Feature/DocumentSymbol.h"
#include "Feature/SemanticTokens.h"
#include "Feature/InlayHint.h"
#include "Feature/CodeCompletion.h"
#include "Feature/SignatureHelp.h"
#include "Feature/CodeAction.h"
#include "Feature/Formatting.h"
#include "Support/Support.h"
namespace clice::proto {
struct ClientCapabilities {
/// General client capabilities.
struct {
/// The position encodings supported by the client. Client and server
/// have to agree on the same position encoding to ensure that offsets
/// (e.g. character position in a line) are interpreted the same on both
/// side.
///
/// To keep the protocol backwards compatible the following applies: if
/// the value 'utf-16' is missing from the array of position encodings
/// servers can assume that the client supports UTF-16. UTF-16 is
/// therefore a mandatory encoding.
///
/// If omitted it defaults to ['utf-16'].
///
/// Implementation considerations: since the conversion from one encoding
/// into another requires the content of the file / line the conversion
/// is best done where the file is read which is usually on the server
/// side.
std::vector<PositionEncodingKind> positionEncodings = {PositionEncodingKind::UTF16};
} general;
};
struct InitializeParams {
/// Information about the client.
struct {
/// The name of the client as defined by the client.
std::string name;
/// The client's version as defined by the client.
std::string version;
} clientInfo;
/// The capabilities provided by the client (editor or tool).
ClientCapabilities capabilities;
/// The workspace folders configured in the client when the server starts.
/// This property is only available if the client supports workspace folders.
/// It can be `null` if the client supports workspace folders but none are
/// configured.
std::vector<WorkspaceFolder> workspaceFolders;
};
struct ServerCapabilities {
/// The position encoding the server picked from the encodings offered
/// by the client via the client capability `general.positionEncodings`.
///
/// If the client didn't provide any position encodings the only valid
/// value that a server can return is 'utf-16'.
///
/// If omitted it defaults to 'utf-16'.
PositionEncodingKind positionEncoding = PositionEncodingKind::UTF16;
};
struct InitializeResult {
/// The capabilities the language server provides.
ServerCapabilities capabilities;
/// Information about the server.
struct {
/// The name of the server as defined by the server.
std::string name;
/// The server's version as defined by the server.
std::string version;
} serverInfo;
};
struct InitializedParams {};
} // namespace clice::proto