Skip to content

Commit 78499b7

Browse files
author
Akila Tennakoon
committed
Merge remote-tracking branch 'origin/main' into feature/diff-v2
2 parents 9393f1f + 3c6399c commit 78499b7

28 files changed

+542
-73
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@ jobs:
7777
fail-fast: true
7878
matrix:
7979
include:
80-
- { os: "ubuntu-latest", arch: "x64", platform: "linux" }
81-
- { os: "ubuntu-latest", arch: "arm64", platform: "linux" }
82-
- { os: "ubuntu-latest", arch: "arm", platform: "linux" }
83-
- { os: "macos-latest", arch: "x64", platform: "darwin" }
84-
- { os: "macos-latest", arch: "arm64", platform: "darwin" }
85-
- { os: "windows-latest", arch: "x64", platform: "win32" }
80+
- { os: "ubuntu-latest", arch: "x64", platform: "linux", go-arch: "amd64" }
81+
- { os: "ubuntu-latest", arch: "arm64", platform: "linux", go-arch: "arm64" }
82+
- { os: "ubuntu-latest", arch: "arm", platform: "linux", go-arch: "arm" }
83+
- { os: "macos-latest", arch: "x64", platform: "darwin", go-arch: "amd64" }
84+
- { os: "macos-latest", arch: "arm64", platform: "darwin", go-arch: "arm64" }
85+
- { os: "windows-latest", arch: "x64", platform: "win32", go-arch: "amd64" }
8686
runs-on: ${{ matrix.os }}
8787
steps:
8888
- uses: actions/checkout@v5
@@ -127,9 +127,9 @@ jobs:
127127
GOPROXY: direct
128128
run: |
129129
if [[ "${{ runner.os }}" == "Windows" ]]; then
130-
go build -C ./cfn-init -v -o ../bundle/production/bin/cfn-init.exe
130+
GOARCH=${{ matrix.go-arch }} go build -C ./cfn-init/cmd -v -o ../../bundle/production/bin/cfn-init.exe
131131
else
132-
go build -C ./cfn-init -v -o ../bundle/production/bin/cfn-init
132+
GOARCH=${{ matrix.go-arch }} go build -C ./cfn-init/cmd -v -o ../../bundle/production/bin/cfn-init
133133
fi
134134
cp ./cfn-init/THIRD-PARTY-LICENSES.txt ./bundle/production/bin/
135135

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@aws/cloudformation-languageserver",
33
"displayName": "AWS CloudFormation",
4-
"version": "0.0.3",
4+
"version": "0.0.4",
55
"id": "aws-cloudformation-languageserver",
66
"description": "AWS CloudFormation Language Server implementation",
77
"publisher": "aws",
@@ -30,10 +30,10 @@
3030
"test:leaks": "NODE_ENV=test vitest run --pool=forks --logHeapUsage",
3131
"lint": "eslint --max-warnings 0 .",
3232
"lint:fix": "npm run lint -- --fix",
33-
"build:go:dev": "GOPROXY=direct go build -C cfn-init -v -o ../bundle/development/bin/cfn-init",
34-
"build:go:prod": "GOPROXY=direct go build -C cfn-init -v -o ../bundle/production/bin/cfn-init",
33+
"build:go:dev": "GOPROXY=direct go build -C cfn-init/cmd -v -o ../../bundle/development/bin/cfn-init",
34+
"build:go:prod": "GOPROXY=direct go build -C cfn-init/cmd -v -o ../../bundle/production/bin/cfn-init",
3535
"test:go": "GOPROXY=direct go test -C cfn-init ./...",
36-
"bundle": "rm -rf out && webpack --env mode=development",
36+
"bundle": "rm -rf out && webpack --env mode=development && npm run build:go:dev",
3737
"bundle:alpha": "rm -rf out && webpack --env mode=production --env env=alpha",
3838
"bundle:beta": "rm -rf out && webpack --env mode=production --env env=beta",
3939
"bundle:prod": "rm -rf out && webpack --env mode=production --env env=prod",

src/document/DocumentManager.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ export class DocumentManager implements SettingsConfigurable {
9797
delay,
9898
)
9999
.catch((error) => {
100+
if (error instanceof Error && error.message.includes('Request cancelled')) {
101+
return;
102+
}
100103
this.log.error(error, 'Failed to send document metadata');
101104
});
102105
}

src/handlers/CodeActionHandler.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@ import { CodeActionParams, CodeAction, Command } from 'vscode-languageserver';
22
import { ServerRequestHandler } from 'vscode-languageserver/lib/common/server';
33
import { ServerComponents } from '../server/ServerComponents';
44
import { LoggerFactory } from '../telemetry/LoggerFactory';
5+
import { TelemetryService } from '../telemetry/TelemetryService';
56

67
const log = LoggerFactory.getLogger('CodeActionHandler');
78

89
export function codeActionHandler(
910
components: ServerComponents,
1011
): ServerRequestHandler<CodeActionParams, (Command | CodeAction)[] | undefined | null, (Command | CodeAction)[], void> {
1112
return (params, _token, _workDoneProgress, _resultProgress) => {
13+
TelemetryService.instance.get('CodeActionHandler').count('count', 1);
14+
1215
try {
1316
return components.codeActionService.generateCodeActions(params);
1417
} catch (error) {

src/handlers/CodeLensHandler.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import { CodeLens, CodeLensParams } from 'vscode-languageserver';
22
import { ServerRequestHandler } from 'vscode-languageserver/lib/common/server';
33
import { ServerComponents } from '../server/ServerComponents';
4+
import { TelemetryService } from '../telemetry/TelemetryService';
45

56
export function codeLensHandler(
67
components: ServerComponents,
78
): ServerRequestHandler<CodeLensParams, CodeLens[] | undefined | null, CodeLens[], void> {
89
return (params, _token, _workDoneProgress, _resultProgress) => {
10+
TelemetryService.instance.get('CodeLensHandler').count('count', 1);
911
return components.codeLensProvider.getCodeLenses(params.textDocument.uri);
1012
};
1113
}

src/handlers/CompletionHandler.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { CompletionParams, CompletionList, CompletionItem } from 'vscode-languageserver';
22
import { ServerRequestHandler } from 'vscode-languageserver/lib/common/server';
33
import { ServerComponents } from '../server/ServerComponents';
4+
import { TelemetryService } from '../telemetry/TelemetryService';
45

56
export function completionHandler(
67
components: ServerComponents,
@@ -11,6 +12,7 @@ export function completionHandler(
1112
void
1213
> {
1314
return (params, _token, _workDoneProgress, _resultProgress) => {
15+
TelemetryService.instance.get('CompletionHandler').count('count', 1);
1416
return components.completionRouter.getCompletions(params);
1517
};
1618
}

src/handlers/ConfigurationHandler.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import { DidChangeConfigurationParams } from 'vscode-languageserver';
22
import { ServerComponents } from '../server/ServerComponents';
33
import { LoggerFactory } from '../telemetry/LoggerFactory';
4+
import { TelemetryService } from '../telemetry/TelemetryService';
45

56
const log = LoggerFactory.getLogger('ConfigurationHandler');
67

78
export function configurationHandler(components: ServerComponents): (params: DidChangeConfigurationParams) => void {
89
return (_params: DidChangeConfigurationParams): void => {
910
// Pull configuration from LSP workspace and notify all components via subscriptions (fire-and-forget)
1011
components.settingsManager.syncConfiguration().catch((error) => {
12+
TelemetryService.instance.get('ConfigurationHandler').count('count', 1);
1113
log.error(error, `Failed to sync configuration`);
1214
});
1315
};

src/handlers/DefinitionHandler.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { DefinitionParams, Location, Definition, DefinitionLink } from 'vscode-languageserver';
22
import { ServerRequestHandler } from 'vscode-languageserver/lib/common/server';
33
import { ServerComponents } from '../server/ServerComponents';
4+
import { TelemetryService } from '../telemetry/TelemetryService';
45

56
export function definitionHandler(
67
components: ServerComponents,
@@ -11,6 +12,7 @@ export function definitionHandler(
1112
void
1213
> {
1314
return (params, _token, _workDoneProgress, _resultProgress) => {
15+
TelemetryService.instance.get('DefinitionHandler').count('count', 1);
1416
return components.definitionProvider.getDefinitions(params);
1517
};
1618
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import { DocumentSymbol, DocumentSymbolParams } from 'vscode-languageserver';
22
import { ServerRequestHandler } from 'vscode-languageserver/lib/common/server';
33
import { ServerComponents } from '../server/ServerComponents';
4+
import { TelemetryService } from '../telemetry/TelemetryService';
45

56
export function documentSymbolHandler(
67
components: ServerComponents,
78
): ServerRequestHandler<DocumentSymbolParams, DocumentSymbol[] | null | undefined, DocumentSymbol[], void> {
89
return (params, _token, _workDoneProgress, _resultProgress) => {
10+
TelemetryService.instance.get('DocumentSymbolHandler').count('count', 1);
911
return components.documentSymbolRouter.getDocumentSymbols(params);
1012
};
1113
}

0 commit comments

Comments
 (0)