Skip to content

Commit c8ea116

Browse files
committed
chore(amazonq): merge main
2 parents 467e33b + fbc667e commit c8ea116

File tree

123 files changed

+5507
-1261
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+5507
-1261
lines changed

.eslintrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module.exports = {
77
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
88
rules: {
99
semi: ['error', 'never'],
10+
'no-constant-condition': ['error', { checkLoops: false }],
1011
'@typescript-eslint/no-unused-vars': 0,
1112
'@typescript-eslint/no-explicit-any': 0,
1213
'@typescript-eslint/explicit-module-boundary-types': 0,

.github/workflows/new_pr.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
jobs:
77
notify:
88
name: Slack notification
9-
if: github.event.pull_request.user.login != 'dependabot[bot]' && github.event.pull_request.draft == false
9+
if: github.event.pull_request.user.login != 'dependabot[bot]' && github.event.pull_request.draft == false && github.event.pull_request.head.repo.fork == false
1010
runs-on: [ubuntu-latest]
1111
steps:
1212
- name: Post message

.github/workflows/npm-packaging.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ jobs:
2323
npm run compile
2424
- name: Pack public npm packages
2525
run: |
26-
npm pack -w server/aws-lsp-codewhisperer -w server/aws-lsp-partiql -w server/aws-lsp-json -w server/aws-lsp-yaml
26+
npm pack -w server/aws-lsp-codewhisperer -w server/aws-lsp-partiql -w server/aws-lsp-json -w server/aws-lsp-yaml -w server/aws-lsp-antlr4 -w core/aws-lsp-core -w chat-client
2727
- name: Create test package
2828
run: |
2929
cd tests
30-
npm install ../aws-lsp-codewhisperer-*.tgz ../aws-lsp-partiql-*.tgz ../aws-lsp-json-*.tgz ../aws-lsp-yaml-*.tgz
30+
npm install ../aws-lsp-codewhisperer-*.tgz ../aws-lsp-partiql-*.tgz ../aws-lsp-json-*.tgz ../aws-lsp-yaml-*.tgz ../aws-lsp-antlr4-*.tgz ../aws-lsp-core-*.tgz ../aws-chat-client-*.tgz
3131
- name: Test imports
3232
run: |
3333
cd tests

.mocharc.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = {
22
exclude: ['./**/node_modules/**'],
33
'fail-zero': true,
4-
'forbid-only': true,
5-
'forbid-pending': true,
4+
'forbid-only': false,
5+
'forbid-pending': false,
66
timeout: 5000,
77
}

.release-please-manifest.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"chat-client": "0.1.1",
3-
"core/aws-lsp-core": "0.0.1",
4-
"server/aws-lsp-antlr4": "0.1.0",
5-
"server/aws-lsp-codewhisperer": "0.0.27",
6-
"server/aws-lsp-json": "0.1.0",
7-
"server/aws-lsp-partiql": "0.0.4",
8-
"server/aws-lsp-yaml": "0.1.0"
2+
"chat-client": "0.1.2",
3+
"core/aws-lsp-core": "0.0.2",
4+
"server/aws-lsp-antlr4": "0.1.2",
5+
"server/aws-lsp-codewhisperer": "0.0.29",
6+
"server/aws-lsp-json": "0.1.2",
7+
"server/aws-lsp-partiql": "0.0.6",
8+
"server/aws-lsp-yaml": "0.1.2"
99
}

.vscode/launch.json

+6-4
Original file line numberDiff line numberDiff line change
@@ -88,18 +88,20 @@
8888
"ENABLE_TOKEN_PROVIDER": "true",
8989
"ENABLE_CUSTOM_COMMANDS": "true",
9090
"ENABLE_CHAT": "true",
91-
"ENABLE_CUSTOMIZATIONS": "true"
91+
"ENABLE_CUSTOMIZATIONS": "true",
92+
"ENABLE_AMAZON_Q_PROFILES": "true",
93+
"ENABLE_AWS_Q_SECTION": "true"
9294
// "HTTPS_PROXY": "http://127.0.0.1:8888",
9395
// "AWS_CA_BUNDLE": "/path/to/cert.pem"
94-
},
95-
"preLaunchTask": "compile"
96+
}
97+
// "preLaunchTask": "compile"
9698
},
9799
{
98100
"name": "CodeWhisperer Server IAM",
99101
"type": "extensionHost",
100102
"request": "launch",
101103
"runtimeExecutable": "${execPath}",
102-
"args": ["--extensionDevelopmentPath=${workspaceFolder}/client/vscode"],
104+
"args": ["--extensionDevelopmentPath=${workspaceFolder}/client/vscode", "--disable-extensions"],
103105
"outFiles": ["${workspaceFolder}/client/vscode/out/**/*.js"],
104106
"env": {
105107
"LSP_SERVER": "${workspaceFolder}/app/aws-lsp-codewhisperer-runtimes/out/iam-standalone.js",

README.md

+36-47
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,48 @@
11
# Language Servers for AWS
22

3-
Language servers for integration with IDEs and Editors
3+
Language servers for integration with IDEs and Editors, which implement the protocol (LSP extensions) defined in the [language-server-runtimes](https://github.com/aws/language-server-runtimes/tree/main/runtimes) repo.
44

5-
## Relation with Language Server Runtimes
5+
## Where things go
66

7-
This monorepo hosts language servers created using the [Language Server Runtimes](https://github.com/aws/language-server-runtimes/tree/main/runtimes)'s Server Interface. This enables the servers to use features provided by the Runtimes in the same package.
8-
9-
Want to create a new language capability? See our example [hello-world-lsp](server/hello-world-lsp) server and it's [implementation](app/hello-world-lsp-runtimes) (using our runtime), run it using the instructions provided [here](https://github.com/aws/language-servers/blob/main/CONTRIBUTING.md#with-vscode-toolkit-extension). To see a more complex example, see our [Amazon Q servers](server/aws-lsp-codewhisperer).
10-
11-
Want to create a new protocol or feature that would be available to all language servers? Head over to the [Language Server Runtimes repo](https://github.com/aws/language-server-runtimes/tree/main) and start building!
7+
- To create a new language capability, see the example [hello-world-lsp](server/hello-world-lsp) server and its [implementation](app/hello-world-lsp-runtimes) (using our runtime), and [run it](https://github.com/aws/language-servers/blob/main/CONTRIBUTING.md#with-vscode-toolkit-extension).
8+
- For a more complex (real-world) example, see the [Amazon Q language server](server/aws-lsp-codewhisperer).
9+
- To create a new protocol feature (LSP extension) for all language servers: contribute to the [language-server-runtimes](https://github.com/aws/language-server-runtimes/tree/main) repo.
1210

1311
## Structure
1412

1513
Monorepo
1614

17-
```
18-
.
19-
── app - bundled javascriot runtime applications for distribution and integration into IDEs
20-
└── aws-lsp-buildspec-runtimes - application containing the buildspec language server
21-
└── aws-lsp-cloudformation-runtimes - application containing the CloudFormation language server
22-
└── aws-lsp-s3-runtimes - application containing the S3 language server
23-
── client - Sample LSP integrations for various IDEs.
24-
Used to test out the Language Servers
25-
└── jetbrains/ - Minimal JetBrains extension to test the language server
26-
└── visualStudio/ - Minimal Visual Studio extension to test the language server
27-
└── vscode/ - Minimal vscode extension to test the language server
28-
── core - contains supporting libraries used by app and server packages
29-
└── aws-lsp-core - core support code
30-
── script - loose scripts used to create `npm foo` commands in the root folder
31-
── server - packages that contain Language Server implementations
32-
└── aws-lsp-buildspec - Language Server that wraps a JSON Schema for CodeBuild buildspec
33-
└── aws-lsp-cloudformation - Language Server that wraps a JSON Schema for CloudFormation
34-
└── aws-lsp-codewhisperer - Language Server that surfaces CodeWhisperer recommendations
35-
- experimental. Shows how recommendations can surface through
36-
completion lists and as ghost text
37-
└── aws-lsp-s3 - Example language server that provides S3 bucket names as completion items
38-
- Shows a concept where credentials can be provided from an IDE extension
39-
(See vscode and vs client readmes)
40-
└── aws-lsp-json - Language Server that wraps a JSON Schema and provides support for JSON format.
41-
Includes reusable code related to JSON language service handling.
42-
└── aws-lsp-yaml - Language Server that wraps a JSON Schema and provides support for YAML format.
43-
Includes reusable code related to YAML language service handling.
44-
```
45-
46-
## How To Contribute
47-
48-
[How to contribute to the language server.](CONTRIBUTING.md#contributing)
49-
50-
## Building The Language Server
51-
52-
[How to build the language server.](CONTRIBUTING.md#building-the-language-server)
53-
54-
## Troubleshooting
55-
56-
[Troubleshooting information.](CONTRIBUTING.md#troubleshooting)
15+
- [app/](app) - bundled javascript runtime applications for distribution and integration into IDEs
16+
- [aws-lsp-buildspec-runtimes/](app/aws-lsp-buildspec-runtimes) - application containing the buildspec language server
17+
- [aws-lsp-cloudformation-runtimes/](app/) - application containing the CloudFormation language server
18+
- [aws-lsp-s3-runtimes/](app/aws-lsp-buildspec-runtimes) - application containing the S3 language server
19+
- [client/](client) - Sample LSP integrations for various IDEs. Used to test out the Language Servers
20+
- [jetbrains/](client/jetbrains/) - Minimal JetBrains extension to test the language server
21+
- [visualStudio/](client/visualStudio/) - Minimal Visual Studio extension to test the language server
22+
- [vscode/](client/vscode/) - Minimal vscode extension to test the language server
23+
- [core/](core) - contains supporting libraries used by app and server packages
24+
- [aws-lsp-core](core/aws-lsp-core) - core support code
25+
- [script](script) - loose scripts used to create `npm foo` commands in the root folder
26+
- [server](server) - packages that contain Language Server implementations
27+
- [aws-lsp-buildspec](server/aws-lsp-buildspec) - Language Server that wraps a JSON Schema for CodeBuild buildspec
28+
- [aws-lsp-cloudformation](server/aws-lsp-cloudformation) - Language Server that wraps a JSON Schema for CloudFormation
29+
- [aws-lsp-codewhisperer](server/aws-lsp-codewhisperer) - Language Server that surfaces CodeWhisperer recommendations.
30+
- Shows recommendations through completion lists and as ghost text>
31+
- [aws-lsp-s3](server/aws-lsp-s3) - Example language server that provides S3 bucket names as completion items
32+
- Shows a concept where credentials can be provided from an IDE
33+
extension (See vscode and vs client readmes)
34+
- [aws-lsp-json](server/aws-lsp-json) - Language Server that wraps a JSON Schema and provides
35+
support for JSON format. Includes reusable code related to JSON language
36+
service handling.
37+
- [aws-lsp-yaml](server/aws-lsp-yaml) - Language Server that wraps a JSON Schema and provides
38+
support for YAML format. Includes reusable code related to YAML language
39+
service handling.
40+
41+
## Contributing
42+
43+
- [How to contribute](CONTRIBUTING.md#contributing)
44+
- [How to build](CONTRIBUTING.md#building-the-repo)
45+
- [Troubleshooting](CONTRIBUTING.md#troubleshooting)
5746

5847
## Security
5948

app/aws-lsp-antlr4-runtimes/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"webpack": "webpack"
1313
},
1414
"dependencies": {
15-
"@aws/language-server-runtimes": "^0.2.44",
15+
"@aws/language-server-runtimes": "^0.2.48",
1616
"@aws/lsp-antlr4": "*",
1717
"antlr4-c3": "^3.4.1",
1818
"antlr4ng": "^3.0.4"

app/aws-lsp-codewhisperer-runtimes/package.json

+8-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,15 @@
1010
"webpack": "webpack"
1111
},
1212
"dependencies": {
13-
"@aws/language-server-runtimes": "^0.2.40",
13+
"@aws/language-server-runtimes": "^0.2.48",
1414
"@aws/lsp-codewhisperer": "*",
15-
"copyfiles": "^2.4.1"
15+
"copyfiles": "^2.4.1",
16+
"crypto-browserify": "^3.12.1",
17+
"https-browserify": "^1.0.0",
18+
"os-browserify": "^0.3.0",
19+
"path-browserify": "^1.0.1",
20+
"stream-browserify": "^3.0.0",
21+
"stream-http": "^3.2.0"
1622
},
1723
"devDependencies": {
1824
"node-loader": "^2.1.0",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { webworker } from '@aws/language-server-runtimes/runtimes/webworker'
2+
import { RuntimeProps } from '@aws/language-server-runtimes/runtimes/runtime'
3+
import { CodeWhispererServerIAM } from '@aws/lsp-codewhisperer/out/language-server/codeWhispererServer'
4+
5+
const props: RuntimeProps = {
6+
version: '1.0.0',
7+
servers: [CodeWhispererServerIAM],
8+
name: 'AWS CodeWhisperer',
9+
}
10+
11+
webworker(props)

app/aws-lsp-codewhisperer-runtimes/src/token-standalone.ts

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
QConfigurationServerTokenProxy,
88
QNetTransformServerTokenProxy,
99
} from '@aws/lsp-codewhisperer/out/language-server/proxy-server'
10+
import { IdentityServer } from '@aws/lsp-identity'
1011

1112
const MAJOR = 0
1213
const MINOR = 1
@@ -21,6 +22,7 @@ const props: RuntimeProps = {
2122
QConfigurationServerTokenProxy,
2223
QNetTransformServerTokenProxy,
2324
QChatServerProxy,
25+
IdentityServer.create,
2426
],
2527
name: 'AWS CodeWhisperer',
2628
}

app/aws-lsp-codewhisperer-runtimes/webpack.config.js

+41-1
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,44 @@ const nodeJsIamBundleConfig = {
5454
target: 'node',
5555
}
5656

57-
module.exports = [nodeJsBearerTokenBundleConfig, nodeJsIamBundleConfig]
57+
const webworkerIamBundleConfig = {
58+
target: 'webworker',
59+
mode: 'production',
60+
output: {
61+
path: path.resolve(__dirname, 'build'),
62+
filename: '[name].js',
63+
},
64+
entry: {
65+
worker: './src/iam-webworker.ts',
66+
},
67+
resolve: {
68+
fallback: {
69+
path: 'path-browserify',
70+
os: 'os-browserify',
71+
https: 'https-browserify',
72+
http: 'stream-http',
73+
crypto: 'crypto-browserify',
74+
stream: 'stream-browserify',
75+
process: false,
76+
fs: false,
77+
vm: false,
78+
},
79+
extensions: ['.ts', '.tsx', '.js', '.jsx'],
80+
},
81+
module: {
82+
parser: {
83+
javascript: {
84+
importMeta: false,
85+
},
86+
},
87+
rules: [
88+
{
89+
test: /\.(ts|tsx)$/,
90+
loader: 'ts-loader',
91+
exclude: /node_modules/,
92+
},
93+
],
94+
},
95+
}
96+
97+
module.exports = [nodeJsBearerTokenBundleConfig, nodeJsIamBundleConfig, webworkerIamBundleConfig]

app/aws-lsp-identity-runtimes/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"compile": "tsc --build"
88
},
99
"dependencies": {
10-
"@aws/language-server-runtimes": "^0.2.40",
10+
"@aws/language-server-runtimes": "^0.2.48",
1111
"@aws/lsp-identity": "^0.0.1"
1212
}
1313
}

app/aws-lsp-json-runtimes/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"webpack": "webpack"
1212
},
1313
"dependencies": {
14-
"@aws/language-server-runtimes": "^0.2.40",
14+
"@aws/language-server-runtimes": "^0.2.48",
1515
"@aws/lsp-json": "*"
1616
},
1717
"devDependencies": {

app/aws-lsp-notification-runtimes/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"compile": "tsc --build"
88
},
99
"dependencies": {
10-
"@aws/language-server-runtimes": "^0.2.40",
10+
"@aws/language-server-runtimes": "^0.2.48",
1111
"@aws/lsp-notification": "^0.0.1"
1212
}
1313
}

app/aws-lsp-partiql-runtimes/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"package": "npm run compile && npm run compile:webpack"
1212
},
1313
"dependencies": {
14-
"@aws/language-server-runtimes": "^0.2.34",
15-
"@aws/lsp-partiql": "^0.0.4"
14+
"@aws/language-server-runtimes": "^0.2.48",
15+
"@aws/lsp-partiql": "^0.0.5"
1616
},
1717
"devDependencies": {
1818
"ts-loader": "^9.4.4",

app/aws-lsp-yaml-json-webworker/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"serve:webpack": "NODE_ENV=development webpack serve"
1212
},
1313
"dependencies": {
14-
"@aws/language-server-runtimes": "^0.2.40",
14+
"@aws/language-server-runtimes": "^0.2.48",
1515
"@aws/lsp-json": "*",
1616
"@aws/lsp-yaml": "*"
1717
},

app/aws-lsp-yaml-runtimes/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"webpack": "webpack"
1212
},
1313
"dependencies": {
14-
"@aws/language-server-runtimes": "^0.2.40",
14+
"@aws/language-server-runtimes": "^0.2.48",
1515
"@aws/lsp-yaml": "*"
1616
},
1717
"devDependencies": {

app/hello-world-lsp-runtimes/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"dependencies": {
1717
"@aws/hello-world-lsp": "^0.0.1",
18-
"@aws/language-server-runtimes": "^0.2.40"
18+
"@aws/language-server-runtimes": "^0.2.48"
1919
},
2020
"devDependencies": {
2121
"@types/chai": "^4.3.5",

chat-client/CHANGELOG.md

+13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Changelog
22

3+
## [0.1.2](https://github.com/aws/language-servers/compare/chat-client/v0.1.1...chat-client/v0.1.2) (2025-03-18)
4+
5+
6+
### Features
7+
8+
* **chat-client:** handle 'openTab' requests ([#817](https://github.com/aws/language-servers/issues/817)) ([fdd0b87](https://github.com/aws/language-servers/commit/fdd0b87ad2d2c9a540d2594bb9243cad01b5887a))
9+
* **chat-client:** openTab returns error for tab create if tabs limit hit ([#832](https://github.com/aws/language-servers/issues/832)) ([aa85848](https://github.com/aws/language-servers/commit/aa8584815da1ef6298b83c8d1bb2a1011ed66fe5))
10+
11+
12+
### Bug Fixes
13+
14+
* bump mynah-ui version ([#843](https://github.com/aws/language-servers/issues/843)) ([4b4de1e](https://github.com/aws/language-servers/commit/4b4de1e01143521e5f497ae5780551dd60e0a4fd))
15+
316
## [0.1.1](https://github.com/aws/language-servers/compare/chat-client/v0.1.0...chat-client/v0.1.1) (2025-02-20)
417

518

chat-client/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ interface SomeEvent {
2222
### Inbound events
2323
| Name | Description | command | params |
2424
| --------------------------- | --------------------------------- | ------------------------ | ----------- |
25-
| sendChatPrompt response | Provides response to sendChatPrompt request | `aws/chat/sendChatPrompt` | [ChatResult](https://github.com/aws/language-server-runtimes/blob/main/types/chat.ts#L76) |
25+
| sendChatPrompt response | Provides response to sendChatPrompt request | `aws/chat/sendChatPrompt` | [ChatResult](https://github.com/aws/language-server-runtimes/blob/10e67de47600f20bf090ce8ec0ea318038a387f2/types/chat.ts#L77C18-L77C28) |
26+
| openTab request | Request to open tab (creates tab if no `tabId` provided) | `aws/chat/openTab` | [OpenTabParams](https://github.com/aws/language-server-runtimes/blob/10e67de47600f20bf090ce8ec0ea318038a387f2/types/chat.ts#L200) |
2627
| sendToPrompt | Request to send selection to prompt | `sendToPrompt` | [SendToPromptParams](https://github.com/aws/language-server-runtimes/blob/fe2669c34479d4925f2bdbe5527417ea8aed6c39/chat-client-ui-types/src/uiContracts.ts#L50C18-L50C36) |
2728
| genericCommand | Request to execute generic command | `genericCommand` | [GenericCommandParams](https://github.com/aws/language-server-runtimes/blob/fe2669c34479d4925f2bdbe5527417ea8aed6c39/chat-client-ui-types/src/uiContracts.ts#L76) |
2829
| errorMessage | Request to show error in chat UI | `errorMessage` | [ErrorParams](https://github.com/aws/language-server-runtimes/blob/fe2669c34479d4925f2bdbe5527417ea8aed6c39/chat-client-ui-types/src/uiContracts.ts#L88C18-L88C29) |
@@ -31,6 +32,7 @@ interface SomeEvent {
3132
### Outbound events
3233
| Name | Description | command | params |
3334
| --------------------------- | --------------------------- | ------------------------ | ----------- |
35+
| openTab response | Provides response to openTab request | `aws/chat/openTab` | [UiMessageResultParams](https://github.com/aws/language-server-runtimes/blob/10e67de47600f20bf090ce8ec0ea318038a387f2/chat-client-ui-types/src/uiContracts.ts#L129) with `result` of type [OpenTabResult](https://github.com/aws/language-server-runtimes/blob/main/types/chat.ts#L201) |
3436
| disclaimerAcknowledged | Notifies destination that legal disclaimer was acknowlegded by a user | `disclaimerAcknowledged` | N/A |
3537

3638
TODO: Provide full list of events

0 commit comments

Comments
 (0)