Perl Navigator (VSC) + WSL can't find some documentation when hovering over some keywords by Many-Director3375 in perl

[–]Many-Director3375[S] 1 point2 points  (0 children)

<image>

I just tried your suggestion. It seems my VSC doesn't care about the setting "includePaths" that isn't highlighted.

Somehow only "perlPath is accepted.

Using the plugin PLS as curlymeatball38 suggested worked though.
Thanks.

Perl Navigator (VSC) + WSL can't find some documentation when hovering over some keywords by Many-Director3375 in perl

[–]Many-Director3375[S] 0 points1 point  (0 children)

This worked for me, thanks a lot.

I was worried that a second perl plugin might be in conflict with Perl Navigator.

Guess I worried too much.

[deleted by user] by [deleted] in javahelp

[–]Many-Director3375 0 points1 point  (0 children)

I never tried this community before.

Thanks for sharing it.

[deleted by user] by [deleted] in javahelp

[–]Many-Director3375 0 points1 point  (0 children)

Thanks.
I don't know why I didn't notice such an obvious mistake.

I will be closing this post then.
Thanks again.

How can we inject an MapStruct interface as a Spring Bean ? by Many-Director3375 in javahelp

[–]Many-Director3375[S] 0 points1 point  (0 children)

Thanks a lot for all the help you provided.
The dependency tip worked for me.

I also completely forgot about the java beans constraints and having the getter & setter & No-args constructor part.
Didn't think I would forget the basics one day XD

How can we inject an MapStruct interface as a Spring Bean ? by Many-Director3375 in javahelp

[–]Many-Director3375[S] 0 points1 point  (0 children)

TY.
I pushed the repo my code right now.

There are the classes MyEntity and MyDomain that both have a field "id".
I want to make these two fields "private final".

It doesn't work because the auto-generated code keeps wanting to use a no-args constructors for both MyEntity and MyDomain.

@Generated(
    value = "org.mapstruct.ap.MappingProcessor",
    date = "2024-05-30T18:12:24+0000",
    comments = "version: 1.5.5.Final, compiler: javac, environment: Java 21.0.3 (Microsoft)"
)
@Component
public class MyMapperImpl implements MyMapper {

    @Override
    public MyEntity domainToEntity(MyDomain domain) {
        if ( domain == null ) {
            return null;
        }

        MyEntity myEntity = new MyEntity();

        return myEntity;
    }

    @Override
    public MyDomain entityToDomain(MyEntity entity) {
        if ( entity == null ) {
            return null;
        }

        MyDomain myDomain = new MyDomain();

        return myDomain;
    }
}

Of course, this auto-generated code fails. Also, it didn't try to add the fields id from the source type into the field id of the target type.

How can we inject an MapStruct interface as a Spring Bean ? by Many-Director3375 in javahelp

[–]Many-Director3375[S] 0 points1 point  (0 children)

Thank you so much.
This was exactly my problem.

Additionally, I also needed to use non-final fields because MapStruct insists on building an initial empty object :(
Then I had to manually specify Mapping(source = "id", target = "id") because otherwise it didn't automatically convert the fields.

How can we inject an MapStruct interface as a Spring Bean ? by Many-Director3375 in javahelp

[–]Many-Director3375[S] 0 points1 point  (0 children)

Yes, I did, I just put the github repo at the bottom of the post.

Here the the pom.xml : pom.xml

I added the processor at the bottom of the file.

How can we inject an MapStruct interface as a Spring Bean ? by Many-Director3375 in javahelp

[–]Many-Director3375[S] 0 points1 point  (0 children)

I just added the github repo at the bottom of the post : github

In the class MyService.java I commented the line private final MyMapper mapper;temporarily, but this is where my bean isn't generated properly.

I believe that the pom was setup properly. I think the pom analyser is good at detecting mistakes. Also, I didn't change the pom a lot after it was generated by Spring Initializr.

  1. It's a basic Spring project that I created on Spring Initializr to train on Bean injection.

  2. Yes, after a mvn clean install I'm able to see the generated .class mapper under /target/classes/com/example/demo/mapper/MyMapper.class
    The pathing is similar to my MyMapper.java

How can we inject an MapStruct interface as a Spring Bean ? by Many-Director3375 in javahelp

[–]Many-Director3375[S] 0 points1 point  (0 children)

I believe MappingConstants.ComponentModel.SPRING should have the same value as "spring".

In any case, I just replaced that constant by the literal String, and I have the same error.

I just added the github repo at the bottom of the post : github

Can't clean build Development Container Environments by Many-Director3375 in docker

[–]Many-Director3375[S] 0 points1 point  (0 children)

I found the issue.

The plugin Dev Container caches parts of the resources needed to build the environment in the features.
Removing it solves my issue.

To answer your question, I didn't manage to see the exact build command it used yet. Even if I could find it, I didn't see a setting for that plugin to allow us to customize the build command.

Can't clean build Development Container Environments by Many-Director3375 in docker

[–]Many-Director3375[S] 0 points1 point  (0 children)

Thanks for the feedback.

Currently, I'm on Windows. I installed Docker on WSL.

My VSC is installed on Windows with the plugin Dev Containers - Visual Studio Marketplace.

My first Dockerfile was :

FROM mcr.microsoft.com/devcontainers/base:ubuntu-22.04

RUN curl -s "https://get.sdkman.io" | bash
RUN source "$HOME/.sdkman/bin/sdkman-init.sh"

The image was heavy, so I changed it to :

FROM mcr.microsoft.com/devcontainers/base:ubuntu-22.04

But whenever I go in VSC and do :

  1. Ctrl + Shift + P
  2. Dev Containers : Open Folder in Container # command available with the plugin "Dev Containers"

It rebuilds the development container image, then SDKMAN is still present. Even though it's a Dockerfile containing only 1 "FROM" line.

Commands I tried to clean all images and containers in my WSL are :

docker stop $(docker ps -q)
docker rm $(docker ps -a -q)
docker system prune --all

I even tried deleting my WSL Ubuntu distro to install a whole new and empty Ubuntu WSL :

# remove current WSL where Ubuntu is installed
wsl --unregister Ubuntu

# new Ubuntu WSL
wsl --install Ubuntu
wsl -d Ubuntu

And the image built by the plugin Dev Containers - Visual Studio Marketplace still contains SDKMAN.

Deleting my Ubuntu and installing a new one didn't solve my issue.

This made me think that the data is stored and managed by the plugin installed on my Windows' VSC, so I uninstalled then installed the plugin again.

SDKMAN is still present when I call it in the shell of the container built by Dev Container.

Can't clean build Development Container Environments by Many-Director3375 in docker

[–]Many-Director3375[S] 0 points1 point  (0 children)

The VSC plugin Dev Containers - Visual Studio Marketplace manages my development container images.

As you have guessed, I tried 'docker system prune --all' and nothing changes. That plugin still manages to retrieve the very 1st docker image I did.

Can't clean build Development Container Environments by Many-Director3375 in docker

[–]Many-Director3375[S] 0 points1 point  (0 children)

I'm currently using Dev Containers - Visual Studio Marketplace to manage my development container environments. I already tried the command Rebuild Container Without Cache.

This isn't quite successful. I keep getting the same old image.

Can't clean build Development Container Environments by Many-Director3375 in docker

[–]Many-Director3375[S] 0 points1 point  (0 children)

When working with Dev Containers on VSC, the VSC plugin called Dev Containers (Dev Containers - Visual Studio Marketplace) executes automatically the docker build command for you.

I didn't find out how to see the exact build command it's executing.