You can't merge a primary partition with an extended partition.
If you want to do it, you will need to first move the swap to the end of the extended partition (sda2) - actually, just delete it, and recreate it at the end at some point.
So, delete the extended partition (sda2); then, you should be able to expand the primary partition.
Then create a swap file at the at the end of the disk.
It would have been best to create one big extended partition at the beginning, then create logical drives in that partition for everything. But you are OK as long as you don't want to try to create more than 4 partitions, which is the limit of primary partitions.
EDIT: I forgot one thing. If you delete the swap file, you will need to update the file /etc/fstab
because there will be a new UUID. If you want to do that, you can run blkid
to get the UUID, and paste that into fstab:
sudo blkid -c /dev/null
is the best way to invoke it to get the correct UUID
But really, you don't want to do that; you should just move the swap file/extended partition to the end of the unused space. After doing that, you can grow the primary partition.