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
2 changes: 1 addition & 1 deletion workspaces/ballerina/ballerina-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ballerina",
"displayName": "Ballerina",
"description": "Ballerina Language support, debugging, graphical visualization, AI-based data-mapping and many more.",
"version": "5.3.1",
"version": "5.3.2",
"publisher": "wso2",
"icon": "resources/images/ballerina.png",
"homepage": "https://wso2.com/ballerina/vscode/docs",
Expand Down
10 changes: 6 additions & 4 deletions workspaces/ballerina/ballerina-extension/src/core/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -813,10 +813,12 @@ export class BallerinaExtension {
// Set the executable permissions
await this.setExecutablePermissions();

// Set the Ballerina version
const filePath = path.join(this.ballerinaInstallationDir, 'distributions', 'ballerina-version');
fs.writeFileSync(filePath, `ballerina-${latestDistributionVersion}`);
console.log(`Updated ${filePath} with version: ${latestDistributionVersion}`);
// Set the Ballerina version in ballerina-version files
const distributionFilePath = path.join(this.ballerinaInstallationDir, 'distributions', 'ballerina-version');
const ballerinaUserHomeFilePath = path.join(this.getBallerinaUserHome(), 'ballerina-version');
fs.writeFileSync(distributionFilePath, `ballerina-${latestDistributionVersion}`);
fs.writeFileSync(ballerinaUserHomeFilePath, `ballerina-${latestDistributionVersion}`);
console.log(`Updated ${distributionFilePath} and ${ballerinaUserHomeFilePath} with version: ${latestDistributionVersion}`);

// Set the Ballerina Home and Command for the user
this.setBallerinaCommandForUser();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ export async function buildProjectArtifactsStructure(projectDir: string, langCli
export async function updateProjectArtifacts(publishedArtifacts: ArtifactsNotification): Promise<void> {
// Current project structure
const currentProjectStructure: ProjectStructureResponse = StateMachine.context().projectStructure;
const projectUri = URI.parse(StateMachine.context().projectUri);
const isWithinProject = URI.parse(publishedArtifacts.uri).path.toLowerCase().includes(projectUri.path.toLowerCase());
const projectUri = URI.file(StateMachine.context().projectUri);
const isWithinProject = URI.parse(publishedArtifacts.uri).fsPath.toLowerCase().includes(projectUri.fsPath.toLowerCase());
if (currentProjectStructure && isWithinProject) {
const entryLocations = await traverseUpdatedComponents(publishedArtifacts.artifacts, currentProjectStructure);
const notificationHandler = ArtifactNotificationHandler.getInstance();
Expand Down Expand Up @@ -104,7 +104,7 @@ async function getComponents(artifacts: Record<string, BaseArtifact>, artifactTy
}

async function getEntryValue(artifact: BaseArtifact, icon: string, moduleName?: string) {
const targetFile = Utils.joinPath(URI.parse(StateMachine.context().projectUri), artifact.location.fileName).fsPath;
const targetFile = Utils.joinPath(URI.file(StateMachine.context().projectUri), artifact.location.fileName).fsPath;
const entryValue: ProjectStructureArtifactResponse = {
id: artifact.id,
name: artifact.name,
Expand Down Expand Up @@ -183,7 +183,7 @@ async function injectAIAgent(serviceArtifact: BaseArtifact) {
const agentName = serviceArtifact.name.split('-')[1].trim().replace(/\//g, '');

// Retrieve the service model
const targetFile = Utils.joinPath(URI.parse(StateMachine.context().projectUri), serviceArtifact.location.fileName).fsPath;
const targetFile = Utils.joinPath(URI.file(StateMachine.context().projectUri), serviceArtifact.location.fileName).fsPath;
const updatedService = await new ServiceDesignerRpcManager().getServiceModelFromCode({
filePath: targetFile,
codedata: {
Expand Down
Loading