The lime task detection didn't contribute a task for the following configuration

This has been a problem for me on my Mac ever since I started using haxe with vscode. I have the latest lime and haxe extensions for vscode, I have a Project.xml in my project root, this works absolutely fine on the same projecton my windows laptop, but on Mac I get the following from Terminal → Run Build Task

Error: The lime task detection didn't contribute a task for the following configuration:
{
    "type": "lime",
    "command": "test",
    "group": {
        "kind": "build",
        "isDefault": true
    }
}
The task will be ignored.

I’ve solved this by replacing the tasks and launch json file with custom ones, but I can’t commit those so I always keep reverting or stashing the changes when I need to.

I realize I’m probably the only mac haxe coder, so is there anything I can do to help find the cause of this issue?

You are not the only one on macOS. That’s the main environment that I use daily.

I just gave your task configuration a try, and it works on my machine.

You have the Lime VSCode extension installed, right? And you haven’t disabled it?

Even if I add an error to my code and restart VSCode, which causes the “Unable to build cache - completion features may be slower than expected. Try fixing the error(s) and restarting the language server.” message to appear, my Lime tasks still seem to work (even if they result in compile errors).

Do you have an .hxml file in the root of your project that might be taking precedence over project.xml?

You’re def not the only one on Mac for Haxe/Lime/OpenFL development :slight_smile:

This usually happens to me if there are multiple tasks.json files present in the same project directory (even if they’re in different subdirs deep in the project structure)

@joshtynjala

You have the Lime VSCode extension installed, right? And you haven’t disabled it?

correct, i have the latest lime, and haxe extensions, both are enabled, nad I’m using vsc version 1.69.1

Try fixing the error(s) and restarting the language server.”

This happens to me with every haxeflixel demo, using the autogenerated vscode setup, which works on windows vscode. in fact in windows even when I have errors, I have build options for “haxe:active configuration” and a similar one for lime, these do not appear on my mac.

Do you have an .hxml file in the root of your project that might be taking precedence over project.xml?

Nope

@igazine

This usually happens to me if there are multiple tasks.json files present in the same project directory

this is not the case.

It’s also worth mentioning that I’ve tested dozens of different projects, ranging from projects generated by flixel commands, to flixel-demos, to openfl demos, to projects created by others, and this build config has never worked for me in years

You ran haxelib run lime setup in a terminal at some point, right?

most certainly, but let me try again just to be sure
actually, the lime command works already, so I did. but i did just install 8.0.0 so lets try again and restart, just to be sure

A few more things to check…

In your VSCode status bar, do you have Lime selected as your Haxe completion provider? And which Lime target is selected? (in the screenshot below, I currently have “Neko / Debug” selected as the target, but there are a ton to choose from).

If you go to Terminal → Run Task, are there any “lime” tasks available?

Do you get any kind of error notification at the bottom left of your window (the bell icon) when you open your project?

Do you have multiple root folders in your VSCode workspace? As I recall, the Haxe extension requires you to open a single folder only, and you can’t have a “multi-root” workspace.

Would you be willing to post a screenshot of your entire VSCode window? It might give us some clues to help more.

I’ve attached a picture but to answer your questions:

In your VSCode status bar, do you have Lime selected as your Haxe completion provider

yes

If you go to Terminal → Run Task, are there any “lime” tasks available?

yes!? i’ve never actually tried this, but when i select it I get the errror: There is no task provider registered for tasks of type "lime".

Do you get any kind of error notification at the bottom left of your window (the bell icon) when you open your project?

Nope

Do you have multiple root folders in your VSCode workspace?

Nope

Would you be willing to post a screenshot of your entire VSCode window? It might give us some clues to help more.

Same on other projects, too

I wonder if it’s because your project file name starts with a capital P. I believe macOS has a case-sensitive file system, while Windows does not. Can you try renaming it from Project.xml to project.xml?

same result with lowercase p. even restarted vscode and junk

Looking at your screenshot… is it just the one “lime” task that you see? No more than that? There should be at least a couple dozen for all combinations of supported targets, build vs test actions, and debug vs release. It’s supposed to auto-populate so that you don’t even necessarily need to create a tasks.json, unless you want to set a specific one as the default build task.

This is the haxeflixel tasks.json template, this is what all my flixel-demos use. I always replace it with specific targets builds, because I thought that’s what I was supposed to do, but that is not the case on windows, I just run the active config and it builds whatever target/debug level I have selected. no other tasks are generated

There is nothing wrong with your tasks.json, and it is supposed to work. It’s not working, though, so I’m trying to ask you questions to get more clues that might help me figure out why it isn’t working.

So I ask again: Is it just the one “lime: test” task from tasks.json that you see when you go to TerminalRun Task? Or are there many “lime” tasks that you can choose from?

As I mentioned in my previous post, there should be quite a few. Even if you have a custom tasks.json, these tasks automatically provided by the Lime extension are always supposed to be available. Here’s a screenshot of what I see:

And it can scroll well beyond that.

If you aren’t seeing these automatically provided tasks, your tasks.json isn’t going to work either because VSCode searches through the automatically provided “lime” tasks to find the one that matches what is in tasks.json. And if that is the case, it suggests to me that there may be an exception while trying to populate the list of tasks, and we may be able to search in a particular place to find where that exception message is reported.

There is nothing wrong with your tasks.json, and it is supposed to work. It’s not working, though, so I’m trying to ask you questions to get more clues that might help me figure out why it isn’t working.

So I ask again: Is it just the one “lime: test” task from tasks.json that you see when you go to TerminalRun Task? Or are there many “lime” tasks that you can choose from?

Sorry for the miscommunication I thought you were saying that something was wrong with my task.json so I thought sharing the exact contents would be helpful. In my screenshot above I listed the only task that appears, which is lime: test, and also the error that results from choosing it. I do not have any other tasks listed at all. In my windows machine, it lists lime: build (active configuration) as well as a dropdown to show more, which reveals everything in your recent screenshot above. My Mac however has no such dropdown, just the one task.

I really appreciate you taking the time to go through all the possibilities with me, I’m not trying to be unhelpful, I think there was just some confusion

I think that you might have task.autoDetect set to off in your VSCode settings. I just configured it that way, and I can now reproduce your issue. task.autoDetect needs to be on, or the “lime” tasks won’t work.

1 Like

This was it! I’m not sure why I set that in my global settings (maybe I didn’t want it to automatically choose what was set as the default build for some project I was using), but thank you so much!

1 Like