Page 1 of 1

Autocomplete for VSCode

PostPosted: 10 Oct 2017, 22:30
by RandomLyrics
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.

Re: Autocomplete for VSCode

PostPosted: 11 Oct 2017, 08:17
by Rey
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.

Re: Autocomplete for VSCode

PostPosted: 11 Oct 2017, 16:33
by RandomLyrics
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. :)

Re: Autocomplete for VSCode

PostPosted: 11 Oct 2017, 17:59
by Strangelove
Pretty dope! (thats what the kids say nowdays, dont they? :D)
Will try it out the next time I am doing some scripting!

Re: Autocomplete for VSCode

PostPosted: 11 Oct 2017, 22:18
by RandomLyrics
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 :)

Re: Autocomplete for VSCode

PostPosted: 20 Feb 2020, 17:44
by Alexandr_7
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.

Re: Autocomplete for VSCode

PostPosted: 10 Mar 2020, 22:43
by RandomLyrics
What's module?
Ill find and upload the c# program :)