Map Database  •  FAQ  •  RSS  •  Register  •  Login

Autocomplete for VSCode

<<

RandomLyrics

User avatar

Sword Fighter

Posts: 283

Joined: 21 Jul 2013, 02:15

KaM Skill Level: Fair

Post 10 Oct 2017, 22:30

Autocomplete for VSCode

Hi, inspired by Strangelove's Autocomplete for Notepad++ topic i've created something for vscode.

Image

Instruction:
1. Install Visual Studio Code (its free https://code.visualstudio.com/)
2. Open VSCode
3. Install Extension OmniPascal //Gives colors and helps with class references(intelisense)
Image
4. Open Folder with your map
Image
5. Press Ctrl + Shift + P -> type "Open User Settings"
6. Copy this like on photo below:
  Code:
"files.associations": {
        "*.script": "objectpascal"
    }

Image
7. Press Ctrl + S
8. Press Ctrl + Shift + P -> type "Open User Snippets" -> type "ObjectPascal"
9. Replace all text from opened file with text from "VSCodeKamRemakeSnippets.txt".
10. Press Ctrl + S.
11. Done. Try typing snippets in your script like presented on .gif :)

Contains data from (date: 11.10.2017):
https://github.com/Kromster80/kam_remak ... ptsLookups
https://github.com/Kromster80/kam_remak ... amicEvents
https://github.com/Kromster80/kam_remak ... micActions
https://github.com/Kromster80/kam_remak ... amicStates

Post any bugs/modifications ideas here.
You do not have the required permissions to view the files attached to this post.
Last edited by RandomLyrics on 18 Oct 2017, 19:58, edited 1 time in total.
<<

Rey

Scout

Posts: 143

Joined: 12 Oct 2016, 07:41

KaM Skill Level: Skilled

Post 11 Oct 2017, 08:17

Re: Autocomplete for VSCode

I do not use VS, but nice to see new plugins here :)
Looks much better, then in Notepad++. There is only 1 string of function description In Notepad++, which is not enought. Function search is also great.

Same question for you here - have you done this manually ?

Because in new version we will have many new functions and its really annoying to add all of them manually (but still possible).
So I was thinking to automate this. Probably as part of Scripting parser - who is already parsing sourse code and make nice github wiki page from it.
<<

RandomLyrics

User avatar

Sword Fighter

Posts: 283

Joined: 21 Jul 2013, 02:15

KaM Skill Level: Fair

Post 11 Oct 2017, 16:33

Re: Autocomplete for VSCode

I used this to get Json from kam remake wiki's pages: http://convertjson.com/html-table-to-json.htm and save each table as .txt
then i wrote c# program that transform it to "snippet form" for visual code.
So for future use we could automate it, right now it only need some html crawler that will read wiki's pages (instead manualy use of convertjson.com).
Also we could pack whole as a vscode extension, so user will just install vscoude and install extension. :)
<<

Strangelove

User avatar

Crossbowman

Posts: 208

Joined: 30 Jul 2013, 06:32

KaM Skill Level: Fair

Post 11 Oct 2017, 17:59

Re: Autocomplete for VSCode

Pretty dope! (thats what the kids say nowdays, dont they? :D)
Will try it out the next time I am doing some scripting!
Love the Bomb!

Campaign viewtopic.php?f=5&t=1749
MultiplayerMaps viewtopic.php?f=5&t=2302
AutoComplete viewtopic.php?f=32&t=2722
<<

RandomLyrics

User avatar

Sword Fighter

Posts: 283

Joined: 21 Jul 2013, 02:15

KaM Skill Level: Fair

Post 11 Oct 2017, 22:18

Re: Autocomplete for VSCode

Thanks :))
Hmm im thinking about add some utils code snippets like:

type "uType" for:
  Code:
type $tName =
   $vName: $vType;
        ...
   end;

type "uVar" for:
  Code:
var $Name: $Type;

type "uFor" for:
  Code:
for $From:= 0 to $To do begin
   $
end;


It could realy help with worlflow. Just give some snippets ideas like this. Ill add them :)

Return to Dynamic Scripting

Who is online

Users browsing this forum: No registered users and 2 guests