Closed bantya closed 2 months ago
I will have a look at improving error handling but... the extension is not supposed to work for PHP syntax. Was the issue title a mistake?
It's not reproducible. At least on Build 3143:
I am closing this issue but if you manage to come up with the test case to reproduce it please share it and reopen the issue.
In order for it to work with php, you will need to write a custom mapper or wait until a universal mapper is available and then simply define the rules ( or let it read the syntax file and use those rules to parse it )...
Universal mapper is now available (CodeMap v1.0.9).
The brief description of how to use it is available directly from the setting file: https://github.com/oleg-shilo/sublime-codemap/blob/master/code_map.sublime-settings.
I've just added basic PHP Mappings to XCodeMapper - https://bitbucket.org/Acecool/acecooldev_sublimetext3 - ( You only need the GMod Lua folder if you are using Garry's Mod Lua with my AcecoolDev_Framework for Gamemodes / Addon development )... I also added support for other languages... I'll be adding multi-type per file support soon so php can support: JavaScript, HTML, CSS, SQL, PHP.... HTML will need to support JavaScript, HTML, CSS.... ASP will need to support JavaScript, HTML, CSS, SQL, ASP... Etc..
If you want to help by submitting new mappings, please let me know.. I'm still working on the class-child-functions category algorithm to ensure it'll work in all cases... Python uses indentation to show where something belongs but PHP, JavaScript etc.. can use either { }s to denote ownership / scope or none for single-line if statements, etc... So I need to set up another system so the mapper can properly configure how it is defined...
Anyway - I've added the following to php mappings - right now it is quite basic... Basically just detecting comments, php tags ( I've commented out the output entry in PreOnAddEntry callback, detecting functions and classes, and also showing requires / includes... I've commented a few definition / debugging lines out as it appears a bit messy...
I've also set OnCalcDepth to 0 so everything lines up...
For now, you can modify the XCodeMapper_PHP_User class to add your own mappings / earmarks in the OnSetupSyntax callback function... Follow the same pattern as the PHP class above it ( The User class is for you to do with what you will, you can even get rid of the default mappings by setting the class-name from class XCodeMapper_PHP_User( XCodeMapper_PHP ): to class XCodeMapper_PHP_User( XCodeMapperBase ): which will ensure the base xcodemapper is used which doesn't come with any mappings other than the Note / Task, etc... If you don't want those, get rid of the super( ) call inside of OnSetupSyntax...
Hopefully this helps :-)
Here's what it looks like: https://www.dropbox.com/s/75uomnode92geim/map_acecooldev_framework_sublime_text_unregistered__screenshot_20180109064559_6705.png?dl=0
This package does not work for php code in Sublime Dev Build 3142. For
CodeMap: Toggle Visibility
opens vertical column on right side but with no content inside it. The console output for this command is:On closing the opened
Code - Map
file console outputs:While, command
CodeMap: Reveal in CodeMap
does nothing with no console output:Please solve this issue and make CodeMap great again!