Map Database  •  FAQ  •  RSS  •  Login

Autocomplete for VSCode

<<

RandomLyrics

User avatar

Sword Fighter

Posts: 298

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 "Configure 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 28 Nov 2018, 23:32, edited 2 times in total.
<<

Rey

User avatar

KaM Remake Developer

Posts: 217

Joined: 12 Oct 2016, 07:41

KaM Skill Level: Fair

Location: Moscow

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: 298

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: 230

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!
<<

RandomLyrics

User avatar

Sword Fighter

Posts: 298

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 :)
<<

Alexandr_7

User avatar

Peasant

Posts: 2

Joined: 12 Jul 2018, 03:35

Post 20 Feb 2020, 17:44

Re: Autocomplete for VSCode

Hello.
Looked at VSCodeKamRemakeSnippets.txt
If this is done manually, then the author respect for this is a very big job. If this is software parsing, is it possible to look at the source code. I want to hammer this into my module in order to maintain the current state of this plugin.
<<

RandomLyrics

User avatar

Sword Fighter

Posts: 298

Joined: 21 Jul 2013, 02:15

KaM Skill Level: Fair

Post 10 Mar 2020, 22:43

Re: Autocomplete for VSCode

What's module?
Ill find and upload the c# program :)

Return to “Dynamic Scripting”

Who is online

Users browsing this forum: No registered users and 10 guests