oleg-shilo / codemap.vscode

Code map (syntax tree) of the active document
MIT License
85 stars 28 forks source link

fixes on regexps and fews addons #4

Closed andreabenini closed 6 years ago

andreabenini commented 6 years ago

File renamed to mapper_erlang.ts (typescript), syntax for .erl and .hrl files, icon changes and few minor fixes on functions and defines regexps Added "-include()" statements syntax Added "-behaviour()" statements syntax FIX: Function arguments in many regexps: functions defines, includes, char '|' is reserved in CodeMap but a possible char in between Erlang function params

oleg-shilo commented 6 years ago

Hi Ben, I am a bit busy right now but I will try to merge and do the release at the end of the week. Can you please send me a hello-world style hrl sample for testing. Thank you

andreabenini commented 6 years ago

Here are few addons to my settings.json file (now vscode is raising warnings due to these unknown directives)

    // Add .erl and .hrl mappers to CodeMap syntax
    "codemap.erl": "/opt/VisualStudioCode/codemap/mapper_erlang.ts",
    "codemap.hrl": "/opt/VisualStudioCode/codemap/mapper_erlang.ts",

Erlang usually maps its source files to .erl, .hrl is used to list/include some sort of defines (just like .c and .h). You can find hello.erl and hello.hrl as attachments, hello.erl doesn't do anything but includes a full blown OTP behaviour (a so called gen_server). I have tried to include everything in it: defines, functions, behaviour, includes. It's still rough but seems to work fine, I wish I can include more default icons (not so important) to enrich functions types (private, exported) or define types. Heavily using regexps to avoid loops and js bare string comparison (even if suggestions are welcomed)

hello.hrl.txt hello.erl.txt

oleg-shilo commented 6 years ago

Excellent. Thank you.

oleg-shilo commented 6 years ago

All done. Published. Worked like a charm. Thank you.