Code Monkey home page Code Monkey logo

Comments (8)

jimmymcp avatar jimmymcp commented on August 18, 2024

Hi,

I've only seen that when the app fails to compile. I assume that you can compile and publish without any problem?

from al-test-runner.

bjarkihall avatar bjarkihall commented on August 18, 2024

Yes, I can use both rapid and normal publish via the command palette. I've taken a look at the source and it doesn't seem like anything has changed in MS's end - the names of the commands are the same.

I tried it again with only my project loaded and publishBeforeTest works - it seems like multi-root workspaces are somehow disabling this feature.

I also tried preTestCommand but it doesn't seem to output anything to the console in the multi-root workspace, so I'm guessing this line isn't getting any config from my .vscode/settings.json in the current workspace:

const config = vscode.workspace.getConfiguration('al-test-runner');

from al-test-runner.

bjarkihall avatar bjarkihall commented on August 18, 2024

Should config.publishBeforeTest maybe be config.get('publishBeforeTest') ? (workspaces API)

from al-test-runner.

jimmymcp avatar jimmymcp commented on August 18, 2024

I'm assuming you've got two apps in the workspace, Test and Prod, Test depends on Prod?

It may be that Test is being published, but not Prod. I haven't investigated but that's what I'm seeing. That used to work but seems not to in the latest version of VS Code and/or AL Language.

from al-test-runner.

bjarkihall avatar bjarkihall commented on August 18, 2024

I've actually been trying this with 3 apps - prod, test and a third one that's just an independent app - just in case the dependencies were causing the issue. It doesn't seem this is strictly caused by the AL Language extension but the extensibility API of vscode.

I haven't debugged this with breakpoints but vscode.workspace.getConfiguration seems to return a WorkspaceConfiguration object which exposes the properties via the get method - I'm guessing once you're in a multiroot workspace all properties you try to retrieve via dot-notation give you the undefined value.

Could that be the issue?

from al-test-runner.

jimmymcp avatar jimmymcp commented on August 18, 2024

I don't know. I've just been testing with different combinations of settings for the user, workspace and both. Everything that I have tried has worked as expected 🤔

from al-test-runner.

bjarkihall avatar bjarkihall commented on August 18, 2024

I finally managed to clone the repo and debug, turns out the getConfiguration just picks the first workspaceFolder in a multi-root workspace (vscode.workspace.workspaceFolders is an array of them and the first one seems to be picked by default: vscode.workspace.workspaceFolders[0].uri).

getConfiguration has a second parameter to define the scope more narrowly and it turns out this line retrieves the value correctly (in my case, vscode.workspace.getWorkspaceFolder(vscode.window.activeTextEditor.document.uri).index === 2):

vscode.workspace.getConfiguration('al-test-runner', vscode.window.activeTextEditor.document.uri).publishBeforeTest

from al-test-runner.

bjarkihall avatar bjarkihall commented on August 18, 2024

Looks like you've already had to deal with this one, since you have a function called getWorkspaceFolder.
I did this change and packed into a utility function which seems to be the general pattern I saw in the extension file:

vscode.workspace.getConfiguration('al-test-runner', vscode.Uri.file(getWorkspaceFolder()));

from al-test-runner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.