Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/esbuild-0.25.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lonhutt authored Feb 13, 2025
2 parents 75bdd68 + a73ed6f commit 56afcc3
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Setup Node version
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 22
cache: 'npm'

- name: 📦 Install dependencies
Expand Down
5 changes: 5 additions & 0 deletions src/extension.api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { BazelProjectView } from './types';

export interface BazelVscodeExtensionAPI {
readonly parseProjectFile: BazelProjectView;
}
12 changes: 10 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ import {
BazelLanguageServerTerminal,
getBazelTerminal,
} from './bazelLangaugeServerTerminal';
import { getBazelProjectFile } from './bazelprojectparser';
import { BazelTaskManager } from './bazelTaskManager';
import { registerBuildifierFormatter } from './buildifier';
import { Commands, executeJavaLanguageServerCommand } from './commands';
import { BazelVscodeExtensionAPI } from './extension.api';
import { registerLSClient } from './loggingTCPServer';
import { ProjectViewManager } from './projectViewManager';
import { BazelRunTargetProvider } from './provider/bazelRunTargetProvider';
Expand All @@ -29,7 +31,9 @@ import {

const workspaceRoot = getWorkspaceRoot();

export async function activate(context: ExtensionContext) {
export async function activate(
context: ExtensionContext
): Promise<BazelVscodeExtensionAPI> {
// activates
// LS processes current .eclipse/.bazelproject file
// if it DNE create one
Expand Down Expand Up @@ -137,9 +141,13 @@ export async function activate(context: ExtensionContext) {

// always update the project view after the initial project load
registerLSClient();

return Promise.resolve({
parseProjectFile: await getBazelProjectFile(),
});
}

export function deactivate() { }
export function deactivate() {}

function syncProjectView(): void {
if (!isRedhatJavaReady()) {
Expand Down
14 changes: 14 additions & 0 deletions test/suite/extension.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,24 @@ import * as assert from 'assert';
import { setTimeout } from 'node:timers/promises';
import { env } from 'process';
import * as vscode from 'vscode';
import { extensions } from 'vscode';
import { Commands } from '../../src/commands';
import { BazelVscodeExtensionAPI } from '../../src/extension.api';
import { Jdtls } from './Jdtls';

suite('Java Language Extension - Standard', () => {
suiteSetup(async function () {
await extensions.getExtension('sfdc.bazel-vscode-java')?.activate();
});

test('version should be correct', async function () {
const api: BazelVscodeExtensionAPI = extensions.getExtension(
'sfdc.bazel-vscode-java'
)?.exports;

assert.ok(api.parseProjectFile !== null);
});

test('RedHat Java Extension should be present', () => {
assert.ok(vscode.extensions.getExtension('redhat.java'));
});
Expand Down

0 comments on commit 56afcc3

Please sign in to comment.