@aws/language-server-runtimes
Advanced tools
Comparing version 0.2.20 to 0.2.21
{ | ||
"name": "@aws/language-server-runtimes", | ||
"version": "0.2.20", | ||
"version": "0.2.21", | ||
"description": "Runtimes to host Language Servers for AWS", | ||
@@ -36,3 +36,3 @@ "files": [ | ||
"dependencies": { | ||
"@aws/language-server-runtimes-types": "^0.0.6", | ||
"@aws/language-server-runtimes-types": "^0.0.7", | ||
"jose": "^5.9.3", | ||
@@ -44,3 +44,3 @@ "rxjs": "^7.8.1", | ||
"devDependencies": { | ||
"@types/mocha": "^10.0.8", | ||
"@types/mocha": "^10.0.9", | ||
"@types/node": "^22.7.4", | ||
@@ -53,3 +53,3 @@ "assert": "^2.0.0", | ||
"ts-sinon": "^2.0.2", | ||
"typescript": "^5.6.2" | ||
"typescript": "^5.6.3" | ||
}, | ||
@@ -56,0 +56,0 @@ "typesVersions": { |
@@ -7,1 +7,2 @@ export * from './lsp'; | ||
export * from './identity-management'; | ||
export * from './notification'; |
@@ -23,2 +23,3 @@ "use strict"; | ||
__exportStar(require("./identity-management"), exports); | ||
__exportStar(require("./notification"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -58,2 +58,13 @@ import { _EM } from 'vscode-jsonrpc'; | ||
clientInfo?: ExtendedClientInfo; | ||
/** | ||
* Client data folder, used as an application data folder to store LSP server-specific data. | ||
* LSP servers are expected to use the folder for storing their configuration files, | ||
* temporary data, and user-specific settings. Servers should create subfolder | ||
* within the client data folder for storing server-specific data. | ||
* | ||
* The folder is expected to be created by client, separate folder per application | ||
* (e.g. multiple IDEs on a client machine should not share the same folder), | ||
* and is extected to maintain data across updates and re-installations. | ||
*/ | ||
clientDataFolder?: string; | ||
} | ||
@@ -60,0 +71,0 @@ /** |
@@ -226,2 +226,17 @@ # Language Server Runtimes | ||
### Notification | ||
The notification feature can be used to send custom customer-facing notifications to clients. Notifications can contain actions, like show URL, but also followup actions, like request customer acknowledgement. When customer reacts to followup actions, asynchronous notification can be sent from client to server to notify server about this. | ||
Notifications should be used in rare / exceptional cases that require customer attention (like some change happened or action recommended), but are not blocking the main flow. Clients can decide to throttle notifications, if too many are sent. | ||
Consider using LSP [ShowMessage notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#window_showMessage) instead, if your notification does not require actions or followup actions. | ||
#### Feature Specification | ||
| Description | Method | Params | Method type | Response Type | | ||
| ------------------------------------ | --------------------------------------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- | | ||
| Show notification to customer | `aws/window/showNotification` | `NotificationParams` | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) | n/a | | ||
| Send notification followup back to server | `aws/window/notificationFollowup` | `NotificationFollowupParams` | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) | n/a | | ||
## Runtime Host Environments | ||
@@ -228,0 +243,0 @@ |
@@ -168,4 +168,11 @@ "use strict"; | ||
isFile: path => (0, promises_1.stat)(path).then(({ isFile }) => isFile()), | ||
writeFile: (path, data) => (0, promises_1.writeFile)(path, data), | ||
appendFile: (path, data) => (0, promises_1.appendFile)(path, data), | ||
mkdir: (path, options) => (0, promises_1.mkdir)(path, options), | ||
}, | ||
}; | ||
const notification = { | ||
showNotification: params => lspConnection.sendNotification(protocol_1.showNotificationRequestType.method, params), | ||
onNotificationFollowup: handler => lspConnection.onNotification(protocol_1.notificationFollowupRequestType.method, handler), | ||
}; | ||
const credentialsProvider = auth.getCredentialsProvider(); | ||
@@ -200,2 +207,3 @@ const runtime = { | ||
workspace: { | ||
applyWorkspaceEdit: params => lspConnection.workspace.applyEdit(params), | ||
getConfiguration: section => lspConnection.workspace.getConfiguration(section), | ||
@@ -238,3 +246,13 @@ onDidChangeWorkspaceFolders: handler => lspConnection.onNotification(protocol_1.DidChangeWorkspaceFoldersNotification.method, handler), | ||
}; | ||
return s({ chat, credentialsProvider, lsp, workspace, telemetry, logging, runtime, identityManagement }); | ||
return s({ | ||
chat, | ||
credentialsProvider, | ||
lsp, | ||
workspace, | ||
telemetry, | ||
logging, | ||
runtime, | ||
identityManagement, | ||
notification, | ||
}); | ||
}); | ||
@@ -241,0 +259,0 @@ // Free up any resources or threads used by Servers |
@@ -51,2 +51,5 @@ "use strict"; | ||
remove: _dir => Promise.resolve(), | ||
writeFile: (_path, _data) => Promise.resolve(), | ||
appendFile: (_path, _data) => Promise.resolve(), | ||
mkdir: (_path, _options) => Promise.resolve(''), | ||
}, | ||
@@ -69,2 +72,6 @@ }; | ||
}; | ||
const notification = { | ||
showNotification: params => lspConnection.sendNotification(protocol_1.showNotificationRequestType.method, params), | ||
onNotificationFollowup: handler => lspConnection.onNotification(protocol_1.notificationFollowupRequestType.method, handler), | ||
}; | ||
// Set up auth without encryption | ||
@@ -99,2 +106,3 @@ const auth = new auth_1.Auth(lspConnection); | ||
workspace: { | ||
applyWorkspaceEdit: params => lspConnection.workspace.applyEdit(params), | ||
getConfiguration: section => lspConnection.workspace.getConfiguration(section), | ||
@@ -130,3 +138,13 @@ onDidChangeWorkspaceFolders: handler => lspConnection.onNotification(protocol_1.DidChangeWorkspaceFoldersNotification.method, handler), | ||
}; | ||
return s({ chat, credentialsProvider, lsp, workspace, telemetry, logging, runtime, identityManagement }); | ||
return s({ | ||
chat, | ||
credentialsProvider, | ||
lsp, | ||
workspace, | ||
telemetry, | ||
logging, | ||
runtime, | ||
identityManagement, | ||
notification, | ||
}); | ||
}); | ||
@@ -133,0 +151,0 @@ // Free up any resources or threads used by Servers |
@@ -10,1 +10,2 @@ export { Server } from './server'; | ||
export * from './identity-management'; | ||
export * from './notification'; |
@@ -22,2 +22,3 @@ "use strict"; | ||
__exportStar(require("./identity-management"), exports); | ||
__exportStar(require("./notification"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
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 } from '../protocol'; | ||
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 } from '../protocol'; | ||
export * from '../protocol/lsp'; | ||
@@ -38,2 +38,3 @@ export { GetConfigurationFromServerParams } from '../protocol'; | ||
onDidChangeWorkspaceFolders: (handler: NotificationHandler<DidChangeWorkspaceFoldersParams>) => void; | ||
applyWorkspaceEdit: (params: ApplyWorkspaceEditParams) => Promise<ApplyWorkspaceEditResult>; | ||
}; | ||
@@ -40,0 +41,0 @@ window: { |
@@ -1,2 +0,2 @@ | ||
import { Logging, Lsp, Telemetry, Workspace, CredentialsProvider, Chat, Runtime } from '.'; | ||
import { Logging, Lsp, Telemetry, Workspace, CredentialsProvider, Chat, Runtime, Notification } from '.'; | ||
import { IdentityManagement } from './identity-management'; | ||
@@ -27,2 +27,3 @@ /** | ||
identityManagement: IdentityManagement; | ||
notification: Notification; | ||
}) => () => void; |
@@ -29,4 +29,9 @@ import { TextDocument, WorkspaceFolder } from '../protocol'; | ||
remove: (dir: string) => Promise<void>; | ||
writeFile: (path: string, data: string) => Promise<void>; | ||
appendFile: (path: string, data: string) => Promise<void>; | ||
mkdir: (path: string, options?: { | ||
recursive: boolean; | ||
}) => Promise<string | undefined>; | ||
}; | ||
}; | ||
export {}; |
@@ -1,2 +0,2 @@ | ||
import { Server, CredentialsProvider, Logging, Lsp, Telemetry, Workspace, Chat, Runtime } from '../server-interface'; | ||
import { Server, CredentialsProvider, Logging, Lsp, Telemetry, Workspace, Chat, Runtime, Notification } from '../server-interface'; | ||
import { StubbedInstance } from 'ts-sinon'; | ||
@@ -30,2 +30,3 @@ import { CancellationToken, CompletionParams, DidChangeTextDocumentParams, DidOpenTextDocumentParams, DocumentFormattingParams, ExecuteCommandParams, HoverParams, InlineCompletionParams, SemanticTokensParams, TextDocument, SignatureHelpParams } from '../protocol'; | ||
identityManagement: StubbedInstance<IdentityManagement>; | ||
notification: StubbedInstance<Notification>; | ||
private disposables; | ||
@@ -32,0 +33,0 @@ constructor(); |
@@ -38,2 +38,3 @@ "use strict"; | ||
this.identityManagement = (0, ts_sinon_1.stubInterface)(); | ||
this.notification = (0, ts_sinon_1.stubInterface)(); | ||
this.workspace.getTextDocument.callsFake((uri) => __awaiter(this, void 0, void 0, function* () { return this.documents[uri]; })); | ||
@@ -40,0 +41,0 @@ this.workspace.getAllTextDocuments.callsFake(() => __awaiter(this, void 0, void 0, function* () { return Object.values(this.documents); })); |
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
Sorry, the diff of this file is not supported yet
304568
138
3511
323
+ Added@aws/language-server-runtimes-types@0.0.7(transitive)
- Removed@aws/language-server-runtimes-types@0.0.6(transitive)