Skip to content

Commit f7d854c

Browse files
committed
addressing review comments
1 parent e5d4b68 commit f7d854c

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

vscode/src/localiser.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2023-2024, Oracle and/or its affiliates.
2+
Copyright (c) 2023-2025, Oracle and/or its affiliates.
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -21,9 +21,10 @@ import * as fs from 'fs';
2121
import { extConstants } from './constants';
2222
import { FileUtils } from './utils';
2323
import { LOGGER } from './logger';
24+
import path = require('path');
2425

2526
const DEFAULT_LANGUAGE = "en";
26-
const DEFAULT_BUNDLE_FILE = `l10n/bundle.l10n.${DEFAULT_LANGUAGE}.json`;
27+
const DEFAULT_BUNDLE_FILE = path.join("l10n", `bundle.l10n.${DEFAULT_LANGUAGE}.json`);
2728
const _format2Regexp = /{([^}]+)}/g;
2829

2930
export interface l10n {
@@ -35,8 +36,8 @@ export interface l10n {
3536
class l10Wrapper implements l10n {
3637
private defaultl10nMap: any;
3738
constructor(extensionId: string, defaultBundlePath: string) {
38-
let extnPath = vscode.extensions.getExtension(extensionId)?.extensionPath;
39-
let defaultBundleAbsoluteFsPath = FileUtils.toUri(`${extnPath}/${defaultBundlePath}`).fsPath;
39+
let extnPath = vscode.extensions.getExtension(extensionId)!!.extensionPath;
40+
let defaultBundleAbsoluteFsPath = FileUtils.toUri(path.join(extnPath,defaultBundlePath)).fsPath;
4041
let logAndThrowError = (message: string, err: unknown) => {
4142
let errMsg = "";
4243
if (err instanceof Error) {

vscode/src/test/unit/mocks/init.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2023-2024, Oracle and/or its affiliates.
2+
Copyright (c) 2023-2025, Oracle and/or its affiliates.
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -38,7 +38,7 @@ const replaceImportsWithMocks = (mocks: any) => {
3838

3939
if (request === 'vscode') {
4040
return mocks.vscode;
41-
} else if (request.includes('localiser') && !(_parent?.filename?.includes("localetest.unit.test.ts") || _parent?.filename?.includes("localetest.unit.test.js")) ) {
41+
} else if (request.includes('localiser') && !(_parent?.filename?.includes("localiser.unit.test.ts") || _parent?.filename?.includes("localiser.unit.test.js")) ) {
4242
return mocks.localiser;
4343
}
4444

vscode/src/test/unit/mocks/vscode/mockVscode.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2023-2024, Oracle and/or its affiliates.
2+
Copyright (c) 2023-2025, Oracle and/or its affiliates.
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -22,7 +22,7 @@ import { mockedEnums } from './vscodeHostedTypes';
2222
import { NotebookCellOutputItem } from './notebookCellOutputItem';
2323
import { mock,instance } from "ts-mockito";
2424
type VSCode = typeof vscode;
25-
const mockedVSCode: Partial<VSCode> & { mockedExtns?:typeof vscode.extensions,mockedL10n?:typeof vscode.l10n} = {};
25+
const mockedVSCode: Partial<VSCode> & { mockedExtns?: typeof vscode.extensions, mockedL10n?: typeof vscode.l10n } = {};
2626

2727
const mockedVscodeClassesAndTypes = () => {
2828
mockedVSCode.Uri = URI as any;

vscode/src/test/unit/mocks/vscode/namespaces/env.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ import { mock, when, anyString, anyOfClass, anything, instance } from "ts-mockit
1919

2020
type VSCode = typeof vscode;
2121
let mockedEnv: typeof vscode.env;
22-
export const mockEnvNamespace = (mockedVSCode: Partial<VSCode> & { mockedEnv?:typeof vscode.env}) => {
22+
export const mockEnvNamespace = (mockedVSCode: Partial<VSCode> & { mockedEnv?: typeof vscode.env }) => {
2323
mockedEnv = mock<typeof vscode.env>();
24-
mockedVSCode.mockedEnv=mockedEnv;
24+
mockedVSCode.mockedEnv = mockedEnv;
2525
mockedVSCode.env = instance(mockedEnv);
2626
mockTelemetryFields();
2727
}

0 commit comments

Comments
 (0)