Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ dist/
test/testFixture/.vscode
*.vsix
.DS_Store
test-resources
test-resources
yarn-error.log
6 changes: 4 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceRoot}"],
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": ["${workspaceRoot}/dist/**/*.js"],
"preLaunchTask": "compile typescript",
Expand Down Expand Up @@ -36,13 +35,16 @@
},
{
"name": "Launch Web Extension",
"type": "pwa-extensionHost",
"type": "extensionHost",
"debugWebWorkerHost": true,
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionDevelopmentKind=web"
],
"env": {
"VSCODE_REDHAT_TELEMETRY_DEBUG":"true"
},
"outFiles": ["${workspaceRoot}/dist/**/*.js"],
"preLaunchTask": "compile webpack"
},
Expand Down
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@
"@vscode/test-web": "0.0.11",
"buffer": "^6.0.3",
"chai": "^4.2.0",
"crypto-browserify": "^3.12.0",
"eslint": "^7.6.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-prettier": "^3.1.4",
Expand All @@ -284,19 +285,20 @@
"typescript": "4.4.3",
"umd-compat-loader": "^2.1.2",
"url": "^0.11.0",
"util": "^0.12.4",
"util": "^0.12.5",
"vscode-extension-tester": "^5.3.0",
"vscode-test": "^1.4.0",
"webpack": "^5.52.1",
"webpack-cli": "^4.8.0"
"webpack": "^5.76.1",
"webpack-cli": "^5.0.1"
},
"dependencies": {
"@redhat-developer/vscode-redhat-telemetry": "0.5.2",
"@redhat-developer/vscode-redhat-telemetry": "^0.6.0",
"fs-extra": "^9.1.0",
"request-light": "^0.5.7",
"vscode-languageclient": "7.0.0",
"vscode-nls": "^3.2.1",
"vscode-uri": "^2.0.3",
"whatwg-fetch": "^3.6.2",
"yaml-language-server": "next"
}
}
10 changes: 5 additions & 5 deletions src/webworker/yamlClientMain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import { startClient, LanguageClientConstructor, RuntimeEnvironment } from '../e
import { LanguageClient } from 'vscode-languageclient/browser';
import { SchemaExtensionAPI } from '../schema-extension-api';
import { IJSONSchemaCache } from '../json-schema-content-provider';

import { getRedHatService } from '@redhat-developer/vscode-redhat-telemetry/lib/webworker';
// this method is called when vs code is activated
export async function activate(context: ExtensionContext): Promise<SchemaExtensionAPI> {
export async function activate(context: ExtensionContext): Promise<SchemaExtensionAPI | undefined> {
const extensionUri = context.extensionUri;
const serverMain = extensionUri.with({
path: extensionUri.path + '/dist/languageserver-web.js',
Expand All @@ -25,12 +25,12 @@ export async function activate(context: ExtensionContext): Promise<SchemaExtensi

const schemaCache: IJSONSchemaCache = {
getETag: () => undefined,
getSchema: () => undefined,
getSchema: async () => undefined,
putSchema: () => Promise.resolve(),
};

const telemetry = await (await getRedHatService(context)).getTelemetryService();
const runtime: RuntimeEnvironment = {
telemetry: { send: () => undefined, sendStartupEvent: () => undefined },
telemetry,
schemaCache,
};
return startClient(context, newLanguageClient, runtime);
Expand Down
2 changes: 1 addition & 1 deletion test/telemetry.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as sinonChai from 'sinon-chai';
import * as chai from 'chai';
import * as vscode from 'vscode';
import { TelemetryErrorHandler, TelemetryOutputChannel } from '../src/telemetry';
import { TelemetryEvent, TelemetryService } from '@redhat-developer/vscode-redhat-telemetry/lib/interfaces/telemetry';
import { TelemetryEvent, TelemetryService } from '@redhat-developer/vscode-redhat-telemetry';

const expect = chai.expect;
chai.use(sinonChai);
Expand Down
8 changes: 6 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,13 @@ const clientWeb = {
resolve: {
mainFields: ['module', 'main'],
extensions: ['.ts', '.js'], // support ts-files and js-files
alias: {},
alias: {
'node-fetch': 'whatwg-fetch',
'object-hash': 'object-hash/dist/object_hash.js',
},
fallback: {
path: require.resolve('path-browserify'),
'node-fetch': require.resolve('whatwg-fetch'),
util: require.resolve('util'),
fs: false,
},
Expand Down Expand Up @@ -102,7 +106,7 @@ const clientWeb = {
},
plugins: [
new webpack.ProvidePlugin({
process: 'process/browser.js', // provide a shim for the global `process` variable
process: path.resolve(path.join(__dirname, 'node_modules/process/browser.js')), // provide a shim for the global `process` variable
}),
],
externals: {
Expand Down
Loading