@aws/language-server-runtimes
Advanced tools
Comparing version 0.2.32 to 0.2.33
{ | ||
"name": "@aws/language-server-runtimes", | ||
"version": "0.2.32", | ||
"version": "0.2.33", | ||
"description": "Runtimes to host Language Servers for AWS", | ||
@@ -5,0 +5,0 @@ "files": [ |
@@ -88,3 +88,3 @@ import { _EM } from 'vscode-jsonrpc'; | ||
logLevel?: LogLevel; | ||
aws: AWSInitializationOptions; | ||
aws?: AWSInitializationOptions; | ||
}; | ||
@@ -91,0 +91,0 @@ } |
@@ -44,2 +44,5 @@ "use strict"; | ||
change: protocol_1.TextDocumentSyncKind.Incremental, | ||
save: { | ||
includeText: true, | ||
}, | ||
}, | ||
@@ -46,0 +49,0 @@ }, |
@@ -64,2 +64,5 @@ "use strict"; | ||
change: protocol_1.TextDocumentSyncKind.Incremental, | ||
save: { | ||
includeText: true, | ||
}, | ||
}, | ||
@@ -82,2 +85,5 @@ }, | ||
change: protocol_1.TextDocumentSyncKind.Incremental, | ||
save: { | ||
includeText: true, | ||
}, | ||
}, | ||
@@ -120,2 +126,5 @@ }, | ||
change: protocol_1.TextDocumentSyncKind.Incremental, | ||
save: { | ||
includeText: true, | ||
}, | ||
}, | ||
@@ -156,2 +165,5 @@ completionProvider: { resolveProvider: true }, | ||
change: protocol_1.TextDocumentSyncKind.Incremental, | ||
save: { | ||
includeText: true, | ||
}, | ||
}, | ||
@@ -158,0 +170,0 @@ completionProvider: { resolveProvider: true }, |
@@ -37,24 +37,19 @@ "use strict"; | ||
this.initialize = (params, token) => __awaiter(this, void 0, void 0, function* () { | ||
var _a, _b, _c; | ||
try { | ||
this.clientSupportsNotifications = | ||
(_c = (_b = (_a = params.initializationOptions) === null || _a === void 0 ? void 0 : _a.aws.awsClientCapabilities) === null || _b === void 0 ? void 0 : _b.window) === null || _c === void 0 ? void 0 : _c.notifications; | ||
if (!this.initializeHandler) { | ||
return; | ||
var _a, _b, _c, _d, _e; | ||
if (!((_a = params.initializationOptions) === null || _a === void 0 ? void 0 : _a.aws)) { | ||
this.logger.log(`Unknown initialization error\nwith initialization options: ${JSON.stringify(params.initializationOptions)}`); | ||
} | ||
this.clientSupportsNotifications = | ||
(_e = (_d = (_c = (_b = params.initializationOptions) === null || _b === void 0 ? void 0 : _b.aws) === null || _c === void 0 ? void 0 : _c.awsClientCapabilities) === null || _d === void 0 ? void 0 : _d.window) === null || _e === void 0 ? void 0 : _e.notifications; | ||
if (!this.initializeHandler) { | ||
return; | ||
} | ||
const initializeResult = yield (0, util_1.asPromise)(this.initializeHandler(params, token)); | ||
if (!(initializeResult instanceof protocol_1.ResponseError)) { | ||
this.initializeResult = initializeResult; | ||
if (initializeResult === null || initializeResult === void 0 ? void 0 : initializeResult.serverInfo) { | ||
this.notificationRouter = new routerByServerName_1.RouterByServerName(initializeResult.serverInfo.name, this.encoding); | ||
} | ||
const initializeResult = yield (0, util_1.asPromise)(this.initializeHandler(params, token)); | ||
if (!(initializeResult instanceof protocol_1.ResponseError)) { | ||
this.initializeResult = initializeResult; | ||
if (initializeResult === null || initializeResult === void 0 ? void 0 : initializeResult.serverInfo) { | ||
this.notificationRouter = new routerByServerName_1.RouterByServerName(initializeResult.serverInfo.name, this.encoding); | ||
} | ||
} | ||
return initializeResult; | ||
} | ||
catch (error) { | ||
this.lspConnection.console.log(`Error in initialize handler: "${error}",\nwith initialization options: ${JSON.stringify(params.initializationOptions)}`); | ||
return new protocol_1.ResponseError(protocol_1.ErrorCodes.InternalError, error instanceof Error | ||
? `${error.message}\nwith initialization options: ${JSON.stringify(params.initializationOptions)}` | ||
: `Unknown initialization error\nwith initialization options: ${JSON.stringify(params.initializationOptions)}`); | ||
} | ||
return initializeResult; | ||
}); | ||
@@ -61,0 +56,0 @@ this.tryExecuteCommand = (params, token) => __awaiter(this, void 0, void 0, function* () { |
@@ -43,4 +43,4 @@ "use strict"; | ||
function getServerDataDirPath(serverName, initializeParams) { | ||
var _a; | ||
const clientSpecifiedLocation = (_a = initializeParams === null || initializeParams === void 0 ? void 0 : initializeParams.initializationOptions) === null || _a === void 0 ? void 0 : _a.aws.clientDataFolder; | ||
var _a, _b; | ||
const clientSpecifiedLocation = (_b = (_a = initializeParams === null || initializeParams === void 0 ? void 0 : initializeParams.initializationOptions) === null || _a === void 0 ? void 0 : _a.aws) === null || _b === void 0 ? void 0 : _b.clientDataFolder; | ||
if (clientSpecifiedLocation) { | ||
@@ -69,5 +69,5 @@ return path_1.default.join(clientSpecifiedLocation, serverName); | ||
function getClientNameFromParams(initializeParams) { | ||
var _a; | ||
var _a, _b; | ||
const clientInfo = initializeParams === null || initializeParams === void 0 ? void 0 : initializeParams.clientInfo; | ||
const awsClientInfo = (_a = initializeParams === null || initializeParams === void 0 ? void 0 : initializeParams.initializationOptions) === null || _a === void 0 ? void 0 : _a.aws.clientInfo; | ||
const awsClientInfo = (_b = (_a = initializeParams === null || initializeParams === void 0 ? void 0 : initializeParams.initializationOptions) === null || _a === void 0 ? void 0 : _a.aws) === null || _b === void 0 ? void 0 : _b.clientInfo; | ||
return [(awsClientInfo === null || awsClientInfo === void 0 ? void 0 : awsClientInfo.name) || (clientInfo === null || clientInfo === void 0 ? void 0 : clientInfo.name) || '', (awsClientInfo === null || awsClientInfo === void 0 ? void 0 : awsClientInfo.extension.name) || ''] | ||
@@ -74,0 +74,0 @@ .filter(Boolean) |
import { CompletionItem, CompletionList, CompletionParams, ConfigurationOptions, DidChangeConfigurationParams, DidChangeTextDocumentParams, DidChangeWorkspaceFoldersParams, DidCloseTextDocumentParams, DidOpenTextDocumentParams, DocumentFormattingParams, ExecuteCommandParams, GetConfigurationFromServerParams, Hover, HoverParams, InitializeError, InitializeParams, InitializedParams, InlineCompletionItem, InlineCompletionItemWithReferences, InlineCompletionList, InlineCompletionListWithReferences, InlineCompletionParams, LogInlineCompletionSessionResultsParams, NotificationHandler, ProgressToken, ProgressType, PublishDiagnosticsParams, ChatOptions, RequestHandler, ServerCapabilities, TextEdit, SemanticTokensParams, SemanticTokens, SignatureHelp, SignatureHelpParams, ShowMessageParams, ShowMessageRequestParams, MessageActionItem, ShowDocumentParams, ShowDocumentResult, LSPAny, ApplyWorkspaceEditParams, ApplyWorkspaceEditResult, DidSaveTextDocumentParams, DeleteFilesParams, CreateFilesParams, RenameFilesParams } from '../protocol'; | ||
export * from '../protocol/lsp'; | ||
export { GetConfigurationFromServerParams } from '../protocol'; | ||
export type PartialServerCapabilities<T = any> = Pick<ServerCapabilities<T>, 'completionProvider' | 'hoverProvider' | 'executeCommandProvider' | 'semanticTokensProvider' | 'signatureHelpProvider'>; | ||
export type PartialServerCapabilities<T = any> = Pick<ServerCapabilities<T>, 'completionProvider' | 'hoverProvider' | 'executeCommandProvider' | 'semanticTokensProvider' | 'signatureHelpProvider' | 'workspace'>; | ||
export type PartialInitializeResult<T = any> = { | ||
@@ -6,0 +6,0 @@ /** |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
405412
4771