-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor project structure #76
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
91f0411
Move Runtimes protocol to dedicated folder
viktorsaws e3fd81f
Update formatting
viktorsaws b5ddfd6
Merge branch 'main' into extract_protocol
viktorsaws d07ffd4
Delete unused lsp feature files
viktorsaws c282dc8
Upgrade jose
viktorsaws 15f820a
Export more LSP types as part of protocol; switch to using them in ru…
viktorsaws 88dc846
Setup export of types for Server capability and features for caapbili…
viktorsaws 9afa68a
Move features folder to server-interface
viktorsaws 3c74fee
Move auth feature protocol to protocol module
viktorsaws 2eddfe7
Update readmes
viktorsaws f61e76c
Add aux folders to flatten imports of subpackages
viktorsaws cb6dc14
Update documentation
viktorsaws b0550f3
Update package.json with scripts for publishing out folder
viktorsaws 9dc5d7a
Merge branch 'main' into extract_protocol
viktorsaws File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
## AWS Language Servers Runtimes Protocol | ||
|
||
Implementation of AWS Language Servers Runtimes Protocol, which defines a protocol for communication between Servers and Clients. | ||
It is modelled after LSP, and provides several custom extensions to enable custom AWS Language Server Runtimes features. | ||
|
||
Protocol specification can be found in main [README](https://github.com/aws/language-server-runtimes/blob/main/README.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { ProtocolRequestType, ProtocolNotificationType0, ProtocolRequestType0 } from './lsp' | ||
|
||
export type IamCredentials = { | ||
readonly accessKeyId: string | ||
readonly secretAccessKey: string | ||
readonly sessionToken?: string | ||
} | ||
|
||
export type BearerCredentials = { | ||
readonly token: string | ||
} | ||
|
||
export interface SsoProfileData { | ||
startUrl?: string | ||
} | ||
|
||
export interface ConnectionMetadata { | ||
sso?: SsoProfileData | ||
} | ||
|
||
export interface UpdateCredentialsParams { | ||
// Plaintext Credentials (for browser based environments) or encrypted JWT token | ||
data: IamCredentials | BearerCredentials | string | ||
// If the payload is encrypted | ||
// Defaults to false if undefined or null | ||
encrypted?: boolean | ||
} | ||
|
||
export const iamCredentialsUpdateRequestType = new ProtocolRequestType<UpdateCredentialsParams, null, void, void, void>( | ||
'aws/credentials/iam/update' | ||
) | ||
|
||
export const iamCredentialsDeleteNotificationType = new ProtocolNotificationType0<void>('aws/credentials/iam/delete') | ||
|
||
export const bearerCredentialsUpdateRequestType = new ProtocolRequestType< | ||
UpdateCredentialsParams, | ||
null, | ||
void, | ||
void, | ||
void | ||
>('aws/credentials/token/update') | ||
|
||
export const bearerCredentialsDeleteNotificationType = new ProtocolNotificationType0<void>( | ||
'aws/credentials/token/delete' | ||
) | ||
|
||
export const getConnectionMetadataRequestType = new ProtocolRequestType0<ConnectionMetadata, never, void, void>( | ||
'aws/credentials/getConnectionMetadata' | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from './lsp' | ||
export * from './auth' | ||
export * from './chat' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export { TextDocument, Position } from 'vscode-languageserver-textdocument' | ||
|
||
// LSP protocol is a core dependency for LSP feature provided by runtimes. | ||
// Since we aim to provide whole range of LSP specification for Clients and Capabilities, | ||
// we re-exporting whole LSP protocol for usage. | ||
// Scoping it down is not practical due to large surface of protocol and types relationship. | ||
// It will be limiting implementors, if they choose to type their code with more specific types from LSP. | ||
export * from 'vscode-languageserver-protocol' | ||
|
||
// Custom Runtimes LSP extensions | ||
export * from './inlineCompletions' | ||
export * from './inlineCompletionWithReferences' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
## AWS Language Server Runtimes Implementation | ||
|
||
Implementation of AWS Language Server runtimes and Runtimes features. | ||
|
||
Each runtime implements a LSP server and opens communication channel with client over LSP connection. Runtime initialised all registered Capabilities. | ||
|
||
Runtime sets up message passing, that translates Runtimes Protocol messages to a function calls to Capabilities features, defined in Server and server features interfaces. | ||
|
||
Runtime implementation acts as a intermediate layer between Runtime Client and a Runtime Servers, injected into runtime at build time. | ||
The runtime implements message passing between Client application and injected Servers, and interface with both by predefined APIs: | ||
* **Runtime Protocol**: a protocol to define communication between Runtime and Client application (e.g. Runtime<->AWS Toolkit extension). It uses LSP (and JSON-RPC) connection as a transport. | ||
* **Runtime Server Interface**: defines an interface of the Server and features exposed to Runtime Server developers (e.g. Runtime<->AWS CodeWhisperer server). | ||
|
||
|
||
See main project [README](https://github.com/aws/language-server-runtimes/blob/main/README.md) for more detailed explanation of the architecture. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there still a copy/paste here from the 3.18 branch of
vscode-languageserver
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, 3.18 LSP is not yet published