Skip to content

Commit 1e78a4c

Browse files
committed
l10n missing from .vsix
1. The `l10n` folder, which contains all the translations, was not present anywhere in the built .vsix. The translations are required in order to run yaml-language-server, so I copied from yaml-language-server to `dist/l10n`. 2. The location of l10n was listed as `../yaml-language-server/l10n`. This doesn't work if yaml-language-server isn't cloned locally, and doesn't work when running as a .vsix, so I changed it to `./dist/l10n`. 3. During the CI run, npm isn't installing the latest prerelease of yaml-language-server. I added a step to force it to use the latest yaml-language-server. This is important, because the above bugs could have been caught earlier if we were actually testing against the newest yaml-language-server. Fixes #1152 Signed-off-by: David Thompson <davthomp@redhat.com>
1 parent 70b0aca commit 1e78a4c

File tree

4 files changed

+18
-13
lines changed

4 files changed

+18
-13
lines changed

.github/workflows/CI.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ jobs:
3535
- name: Install dependencies
3636
run: npm ci
3737

38+
# Install latest yaml-language-server
39+
- name: Update yaml-language-server
40+
run: npm i yaml-language-server@next
41+
3842
# Build extension
3943
- name: Run build
4044
run: npm run build

package-lock.json

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

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,10 @@
256256
"lint": "eslint -c .eslintrc.js --ext .ts src test",
257257
"test": "npm run test-compile && sh scripts/e2e.sh",
258258
"ui-test": "npm run test-compile && extest setup-and-run out/test/ui-test/allTestsSuite.js -c 1.76.2",
259-
"vscode:prepublish": "webpack --mode production",
259+
"vscode:prepublish": "webpack --mode production && npm run copy-l10n",
260+
"copy-l10n": "cp -r node_modules/yaml-language-server/l10n dist/l10n",
260261
"watch": "webpack --mode development --watch --info-verbosity verbose",
261-
"test-compile": "npm run clean && tsc -p ./ && webpack --mode development",
262+
"test-compile": "npm run clean && tsc -p ./ && webpack --mode development && npm run copy-l10n",
262263
"run-in-chromium": "npm run compile && vscode-test-web --browserType=chromium --extensionDevelopmentPath=. ."
263264
},
264265
"devDependencies": {

src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export function startClient(
113113
): SchemaExtensionAPI {
114114
const telemetryErrorHandler = new TelemetryErrorHandler(runtime.telemetry, lsName, 4);
115115
const outputChannel = window.createOutputChannel(lsName);
116-
const l10nPath = context.asAbsolutePath('../yaml-language-server/l10n');
116+
const l10nPath = context.asAbsolutePath('./dist/l10n');
117117
// Options to control the language client
118118
const clientOptions: LanguageClientOptions = {
119119
// Register the server for on disk and newly created YAML documents

0 commit comments

Comments
 (0)