BGforgeNet / VScode-BGforge-MLS

BGforge MultiLanguage server
https://forums.bgforge.net/viewforum.php?f=35
Other
16 stars 5 forks source link

Added missing "\" #10

Closed 4Luke4 closed 5 years ago

burner1024 commented 5 years ago

there are some conflicts...

4Luke4 commented 5 years ago

there are some conflicts...

Yeah, probably because I forgot to update my fork before committing.....

However, when I click on "Resolve conflicts", it keeps processing weidu.completion.yml (i.e., it never stops....) Do you have any suggestion?

burner1024 commented 5 years ago

ctrl-f5? Or you can pull upstream and resolve locally. It's probably choking on replaced dashes

4Luke4 commented 5 years ago

ctrl-f5? Or you can pull upstream and resolve locally. It's probably choking on replaced dashes

Done. Please tell me if I messed up everything.....

burner1024 commented 5 years ago

Seems that VScode just doesn't support newlines in plain text doc. I think to get it working, we'll need to write the corresponding doc in markdown and add support for this in MLS.

burner1024 commented 5 years ago

OK, so competion item recognizes markdown natively. But line endings should be marked with "\n", not just "\". And the additional slash at the beginning of the next string is not necessary.

Captura de pantalla de 2019-06-13 00-39-02 Captura de pantalla de 2019-06-13 00-39-12

4Luke4 commented 5 years ago

OK, so competion item recognizes markdown natively. But line endings should be marked with "\n", not just "\". And the additional slash at the beginning of the next string is not necessary.

Ok, so basically I need to replace all \ with \n, right?

burner1024 commented 5 years ago

only the trailing ones

4Luke4 commented 5 years ago

only the trailing ones

Done.

4Luke4 commented 5 years ago

Moreover, how can I add BEGIN, END, LAF and LPF to Autocompletion?

burner1024 commented 5 years ago

I thought you're comfortable enough with yaml structure already, what's the problem? (In any case, let's keep it separate.)

Also, you might want to take a look at snippets instead or in addition. They allow to insert larger, predefined text blolcks (such as LAF.. INT_VAR ... STR_VAR.. END), and the fill in the blanks easily. Examples here.

burner1024 commented 5 years ago

And yaml is broken again. See the linter.

4Luke4 commented 5 years ago

And yaml is broken again. See the linter.

VScode highlights nothing for me.... What's exactly the issue?

burner1024 commented 5 years ago

Looks good now.

4Luke4 commented 5 years ago

@burner1024

Forgot to make the release?

burner1024 commented 5 years ago

No, just waiting to see if you send any more pulls. Also, some updates for Fallout module are coming soon, I want to batch that.

4Luke4 commented 5 years ago

No, just waiting to see if you send any more pulls. Also, some updates for Fallout module are coming soon, I want to batch that.

I see. Well, I may add INT_VAR, STR_VAR, RET, BEGIN and END to the 'constants' section and try to write down some snippets to automate LAF/LPF invocations......

burner1024 commented 5 years ago

Released it.

We now have a semi-automatic system to pull Fallout syntax changes. Would be awesome to implement something similar for WeiDU and IESDP.

4Luke4 commented 5 years ago

Also, you might want to take a look at snippets instead or in addition. They allow to insert larger, predefined text blolcks (such as LAF.. INT_VAR ... STR_VAR.. END), and the fill in the blanks easily. Examples here.

So, something like this

{
    "LAUNCH_ACTION_FUNCTION": {
        "prefix": "LAF",
        "body": [
          "${1|INT_VAR,STR_VAR,RET|}",
          "\t$0",
          "END"
        ],
        "description": "Launch an action function."
    }
}
{"PATCH_IF": {
        "prefix": "PATCH_IF",
        "body": [
          "PATCH_IF $1 then $0"
        ],
        "description": "PATCH_IF clause"
    }
}

?

Moreover, how can I test them? Should I add weidu-ssl.json in \snippets and put everything there?

burner1024 commented 5 years ago

So, something like this

Looks ok, but need to test to be sure. You can launch the development version of the extension by pressing F5 in VScode.

4Luke4 commented 5 years ago

@burner1024

Sorry for reviving this, but it seems that some \n are not functional (look at the attached screenshot). Do you know why?

Missing  n
burner1024 commented 5 years ago

I'm not sure, but I was able to get it to work using the the other syntax (doc: |): Captura de pantalla de 2019-07-01 19-41-47

What concerns me more is that markdown is not displayed properly in completion:

Captura de pantalla de 2019-07-01 19-28-27 Was it always like that?